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. Create Content List from Data File
Forum Updated to NodeBB v4.3 + New Features

Create Content List from Data File

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 4 Posters 780 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.
  • ahsan737A ahsan737

    Greetings,
    I have a CSV format data file, I want to create a similar content list (as shown in the picture below) for that data. And also need to provide "search contents" option. I am completely clueless how can I execute it. Please help me out.

    Best Regards,

    0_1565053173655_saved_data.jpg

    jsulmJ Online
    jsulmJ Online
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @ahsan737 How does your CSV look like?
    Parsing CSV is easy: read the file line by line and split each line using ',' character.
    Take a look at this: https://wiki.qt.io/Handling_CSV

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    ahsan737A 1 Reply Last reply
    2
    • jsulmJ jsulm

      @ahsan737 How does your CSV look like?
      Parsing CSV is easy: read the file line by line and split each line using ',' character.
      Take a look at this: https://wiki.qt.io/Handling_CSV

      ahsan737A Offline
      ahsan737A Offline
      ahsan737
      wrote on last edited by
      #3

      @jsulm I am able to read CSV, but my concern is how can I create contents list (as shown in attached picture). I am able to read data from CSV, but how can I display it in that particular style (reference picture is attached)?

      jsulmJ 1 Reply Last reply
      0
      • ahsan737A ahsan737

        @jsulm I am able to read CSV, but my concern is how can I create contents list (as shown in attached picture). I am able to read data from CSV, but how can I display it in that particular style (reference picture is attached)?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @ahsan737 Depends.
        Do you want to use Qt Widgets (then take a look at https://www.bogotobogo.com/Qt/Qt5_QListView_QStringListModel_ModelView_MVC.php) or QML?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        ahsan737A 1 Reply Last reply
        2
        • jsulmJ jsulm

          @ahsan737 Depends.
          Do you want to use Qt Widgets (then take a look at https://www.bogotobogo.com/Qt/Qt5_QListView_QStringListModel_ModelView_MVC.php) or QML?

          ahsan737A Offline
          ahsan737A Offline
          ahsan737
          wrote on last edited by
          #5

          @jsulm I have written code in C++ as I am unfamiliar with QML. Please suggest a suitable approach to display data in that specific style. and also the user should be able to click that (3 line view set which will further display complete data).

          jsulmJ 1 Reply Last reply
          0
          • ahsan737A ahsan737

            @jsulm I have written code in C++ as I am unfamiliar with QML. Please suggest a suitable approach to display data in that specific style. and also the user should be able to click that (3 line view set which will further display complete data).

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @ahsan737 said in Create Content List from Data File:

            Please suggest a suitable approach to display data in that specific style

            See my link above

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            ahsan737A 1 Reply Last reply
            2
            • jsulmJ jsulm

              @ahsan737 said in Create Content List from Data File:

              Please suggest a suitable approach to display data in that specific style

              See my link above

              ahsan737A Offline
              ahsan737A Offline
              ahsan737
              wrote on last edited by
              #7

              @jsulm I have visited that link, that model has a simple look, how can little graphics be added into it? and show 3 lines (3 lines will display data related to one measurement/object) as one unit which can be opened using click to show further details.

              Pradeep P NP 1 Reply Last reply
              0
              • ahsan737A ahsan737

                @jsulm I have visited that link, that model has a simple look, how can little graphics be added into it? and show 3 lines (3 lines will display data related to one measurement/object) as one unit which can be opened using click to show further details.

                Pradeep P NP Offline
                Pradeep P NP Offline
                Pradeep P N
                wrote on last edited by
                #8

                @ahsan737
                You can customize the UI as you like it.
                In case if you want rich UI or graphics contents I would suggest you to go with QML.

                Pradeep Nimbalkar.
                Upvote the answer(s) that helped you to solve the issue...
                Keep code clean.

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

                  Hi
                  To change how the View will render the items, you can use a delegate
                  https://doc.qt.io/qt-5/qstyleditemdelegate.html
                  That allows you to change how a cell is render ( or all cells)
                  and you would use its paint function to draw 3 lines of text.

                  ahsan737A 1 Reply Last reply
                  2
                  • mrjjM mrjj

                    Hi
                    To change how the View will render the items, you can use a delegate
                    https://doc.qt.io/qt-5/qstyleditemdelegate.html
                    That allows you to change how a cell is render ( or all cells)
                    and you would use its paint function to draw 3 lines of text.

                    ahsan737A Offline
                    ahsan737A Offline
                    ahsan737
                    wrote on last edited by ahsan737
                    #10

                    @Pradeep-P-N thank you so much for the kind suggestion, isn't it there a way to get rich Graphics using c++?

                    @mrjj Thank you, I will try to implement this. I am a beginner so sometimes it is hard to understand the Qt documentation. If you know any good example of this implementation then please share it. I am really thankful.

                    jsulmJ Pradeep P NP 2 Replies Last reply
                    0
                    • ahsan737A ahsan737

                      @Pradeep-P-N thank you so much for the kind suggestion, isn't it there a way to get rich Graphics using c++?

                      @mrjj Thank you, I will try to implement this. I am a beginner so sometimes it is hard to understand the Qt documentation. If you know any good example of this implementation then please share it. I am really thankful.

                      jsulmJ Online
                      jsulmJ Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @ahsan737 You can find links to examples in the link @mrjj provided

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      3
                      • ahsan737A ahsan737

                        @Pradeep-P-N thank you so much for the kind suggestion, isn't it there a way to get rich Graphics using c++?

                        @mrjj Thank you, I will try to implement this. I am a beginner so sometimes it is hard to understand the Qt documentation. If you know any good example of this implementation then please share it. I am really thankful.

                        Pradeep P NP Offline
                        Pradeep P NP Offline
                        Pradeep P N
                        wrote on last edited by
                        #12

                        @ahsan737
                        AFAIK, QML / QtQuick has better & rich Graphics classes & components than C++ (Qt Widget based GUI).

                        All the best.

                        Pradeep Nimbalkar.
                        Upvote the answer(s) that helped you to solve the issue...
                        Keep code clean.

                        1 Reply Last reply
                        2

                        • Login

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