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 849 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.
  • A ahsan737
    6 Aug 2019, 00:56

    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

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 6 Aug 2019, 04:25 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

    A 1 Reply Last reply 6 Aug 2019, 04:27
    2
    • J jsulm
      6 Aug 2019, 04:25

      @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

      A Offline
      A Offline
      ahsan737
      wrote on 6 Aug 2019, 04:27 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)?

      J 1 Reply Last reply 6 Aug 2019, 04:30
      0
      • A ahsan737
        6 Aug 2019, 04:27

        @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)?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 6 Aug 2019, 04:30 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

        A 1 Reply Last reply 6 Aug 2019, 04:37
        2
        • J jsulm
          6 Aug 2019, 04:30

          @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?

          A Offline
          A Offline
          ahsan737
          wrote on 6 Aug 2019, 04:37 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).

          J 1 Reply Last reply 6 Aug 2019, 04:39
          0
          • A ahsan737
            6 Aug 2019, 04:37

            @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).

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 6 Aug 2019, 04:39 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

            A 1 Reply Last reply 6 Aug 2019, 05:32
            2
            • J jsulm
              6 Aug 2019, 04:39

              @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

              A Offline
              A Offline
              ahsan737
              wrote on 6 Aug 2019, 05:32 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.

              P 1 Reply Last reply 6 Aug 2019, 06:23
              0
              • A ahsan737
                6 Aug 2019, 05:32

                @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.

                P Offline
                P Offline
                Pradeep P N
                wrote on 6 Aug 2019, 06:23 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
                • M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 6 Aug 2019, 11:23 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.

                  A 1 Reply Last reply 6 Aug 2019, 15:13
                  2
                  • M mrjj
                    6 Aug 2019, 11:23

                    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.

                    A Offline
                    A Offline
                    ahsan737
                    wrote on 6 Aug 2019, 15:13 last edited by ahsan737 8 Jun 2019, 15:15
                    #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.

                    J P 2 Replies Last reply 7 Aug 2019, 04:16
                    0
                    • A ahsan737
                      6 Aug 2019, 15:13

                      @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.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 7 Aug 2019, 04:16 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
                      • A ahsan737
                        6 Aug 2019, 15:13

                        @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.

                        P Offline
                        P Offline
                        Pradeep P N
                        wrote on 8 Aug 2019, 10:42 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

                        11/12

                        7 Aug 2019, 04:16

                        • Login

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