Important: Please read the Qt Code of Conduct -

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": or any other reference to access it? If you do, you can access the file content with a "QDataStream": or "QTextStream": 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