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. How to display a file content?
Qt 6.11 is out! See what's new in the release blog

How to display a file content?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.0k Views 2 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.
  • M Offline
    M Offline
    moyin
    wrote on last edited by A Former User
    #1

    Hi, Actually i'm developing a qt GUI application for generating configuartion files (.c), i want to provide an option to view content of a particular file by selecting a specific file from a Qcombobox, as part of GUI tool.
    can any one please give me an idea, how should i add this option into my GUI.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Not sure what part you ask about ?

      You can use
      http://doc.qt.io/qt-5/qdiriterator.html#details
      to make a list
      or you can use
      http://doc.qt.io/qt-5/qfilesystemmodel.html#details
      for a more live version.

      Then on selection, you can open the file with
      TextEdit

      1 Reply Last reply
      4
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @mrjj QDirModel is obsolete, QFileSystemModel should be used.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        mrjjM 1 Reply Last reply
        3
        • SGaistS SGaist

          @mrjj QDirModel is obsolete, QFileSystemModel should be used.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SGaist
          Thx was the one i was think of :)

          1 Reply Last reply
          1

          • Login

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