Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Showing content of a file in the tabs
Qt 6.11 is out! See what's new in the release blog

Showing content of a file in the tabs

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lycis
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved