QT excel editor - qt

I am working on a test case editor, which is something like a excel sheet.
Where i need a excel sheet cells to enter data, combobox in excel sheet cells & few buttons, text editor.
Something like shown in these links.
http://www.theirishpenguin.com/assets/images/disc_jockey_list.png
http://qt-project.org/doc/qt-5.0/qtwidgets/images/spreadsheet-demo.png
http://multimedia-and-graphics.softlandmark.com/images/screenshots/QuickTime_MOV_QT_MP4_Converter_229513.gif
Please suggest should i use :--
QT spreadsheet or QT treewidget or QT modelview ?
What will be the right class to use, to get maximum flexibility with my editor ?

Base your editor on QTableWidget - as the name suggests, it shows a table/grid, and looks very closely like Excel.
There is already an example spreadsheet application that comes from the Qt team.

Related

How to use Qt to read a file and display it quickly?

I have to use Qt show the context of a file, whose size is 70M, but is so slow that it takes several minutes to display.
QFile file("farey.txt");
file.open(QFile::ReadOnly | QFile::Text);
QTextStream ReadFile(&file);
while (!ReadFile.atEnd()) {
QString line = ReadFile.readLine();
ui->Output->append(line);
}
file.close();
Output is TextEdit, can anyone give me some help to make it faster?
Can I use Qt to dispatch a default system editor to open the file??
If you want to display your file as plain text, the widget QPlainTextEdit is better then QTextEdit. It is optimized to handle large documents, for example see QTextEdit vs QPlainTextEdit
QTextEdit is an advanced WYSIWYG viewer/editor supporting rich text
formatting using HTML-style tags.
QTextEdit can display images, lists and tables.
QPlainTextEdit is an advanced viewer/editor supporting plain text.
QPlainText uses very much the same technology and concepts as
QTextEdit, but is optimized for plain text handling.
It is possible to open a file by default system file handler using QDesktopServices, for example:
QDesktopServices::openUrl(QUrl::fromLocalFile("file_path"));
First of all, this is enough:
QFile file("farey.txt");
file.open(QFile::ReadOnly | QFile::Text);
ui->Output->setPlaintText(file.readAll());
Second one - best optimization in your case it's logic optimization. Did you really need to show all of this 70M file?
Your problem is likely the appending the contents of the file line-by-line. This forces the document to be laid out repeatedly on each line - that's the cause of the slowdown. Read the entire file in one go, and set it on the editor using setPlainText.

How to get big icons on QFileDialog?

I'm working on a Qt UI that will run on a touchscreen. At some point it will be useful to select files, in (probably) a QFileDialog.
But little icons on a QFileDialog leads to a terrible touch-user experience, I'd like them to be bigger, so the user doesn't get crazy trying to navigate in the filesystem.
Actually, I'm searching documentation to see if there is a way through css, but haven't seen yet which target/propery to use.
Given the doc of QFileDialog class:
QFileDialog::Detail 0 Displays an icon, a name, and details for each item in the directory.
QFileDialog::List 1 Displays only an icon and a name for each item in the directory.
You can't set icon size this way. I recommend you to set a custom icon provider on the QFileDialog.

Font issue when trying to export file from ReportViewer Control

I am using ReportViewer control to export data as word document(doc). when I download the file it appears like this:
There is problem with Arabic font as you see, English words are okay. Do you know how to fix this issue ?
Select the Table > from Localization > choose LayoutDirection to "RTL"

Font Awesome Icons missing from asp:Gridview Export to Excel

I have a Gridview which has some FontAwesome checkmarks (fa-check) the problem is when I export the Grid to Excel these fields come out as blank. More so, at runtime the cell.Text value is the Empty string ("") so I cannot effectively replace the text with a "YES" for instance.
I'm using the usual code for exporting (Stringwriter, HtmlTextWriter and then looping for each
Gridview Row and TableCell therein)
Any clues on how to replace this at export time?
PS: I could have duplicate/hidden columns with YES NO instead of the Font Awesome icons, then hide and unhide them at export time, but I'm looking for a more graceful way.
Any help appreciated
Please check out:
https://www.nuget.org/packages/EPPlus/
It is a more graceful way to export to XLS and has many ways to customize your export.
In addition .. since FA Fonts are font based ... including a link to your resource file so excel can find the font your trying to render?

How to export data from data grid to pdf in a flex

I have a data grid in my flex application and it is scrollable. I want to export the data in it to a pdf. What is the best way to do it. I have tried with AlivePDF but all it does it take a screenshot and does not export the whole content of daa.
I suggest you to print the datagrid see PrintDataGrid. Then the user can choose to print to a PDF file, for eaxample using one of the virtual pdf printers, like pdfcreator , that are quiete common.
In particullary you can use the PrintDataGrid see How to print flex spark datagrid by using the mx PrintDataGrid? Or is there other way to achieve this without using the mx PrintDataGrid?

Resources