Showing content of a file in the tabs



  • Hallo,

    I have program that has two parts.
    Main part is a mainwindow in which 3 Qtabs existed. Second part is a QFileDialog that will be showed if I want to create new File and has a create Button. Now I would like to show the content of new created file in my Tabs, as soon as I clicked on the create button. I also used treemodel.cpp/.h and treeitem.cpp/.h classes, from the qt exampples.

    I would be happy if someone could help me.



  • I don't really get what you want to do...

    If you created a file I suppose you have a "QFile":http://qt-project.org/doc/qt-4.8/qfile.html or any other reference to access it? If you do, you can access the file content with a "QDataStream":http://qt-project.org/doc/qt-4.8/qdatastream.html or "QTextStream":http://qt-project.org/doc/qt-4.8/qtextstream.html and display it? What do you want to do with a tree view?

    Please provide some more description about what you want to do and the layout of your code. Maybe you could provide some snippets too?



  • Hello,

    I used tree to show my data in tree view in my tabs, which existed in main window. I think I may need a parser to pares my data, which are on the newly created file, also using setupModelData method in treeModel.cpp, and add it to my tree model.

    I am still worḱing on it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.