Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Which is the right way to implement to show emp data on qml
QtWS25 Last Chance

Which is the right way to implement to show emp data on qml

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 2 Posters 1.9k Views
  • 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 Offline
    A Offline
    av2306
    wrote on last edited by
    #1

    Hi,

    I have emp data in model. (name, age, manger,grade).

    I want to show this information in GUI like rows wise. When model added/deleted new emp, should get update on gui. And, sorting also required when click on particular field.

    GridView or ListView.

    Any suggestions are welcome.

    Thanks.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      What is emp ? You should be clear when asking a question.
      I think a more suitable option would be to use TableView.

      157

      1 Reply Last reply
      0
      • A Offline
        A Offline
        av2306
        wrote on last edited by
        #3

        Sorry.
        I mean, emp means employee data. Here, I want to display each row information in customized view (fields without separator, text with specific fonts). Will Treeview supports this?

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          TreeView is not yet implemented in QML. Did you check TableView ?

          157

          1 Reply Last reply
          0
          • A Offline
            A Offline
            av2306
            wrote on last edited by
            #5

            Hi p3c0,

            I thought TableView only. But, I mistakenly mentioned TreeView.

            I had gone through http://qt-project.org/doc/qt-5/qml-qtquick-controls-tableview.html#details. But, I didn't find information about how to customize view with TreeView.

            I have to display in customized view for row(TableView Element on GUI). The row view is with white background, no seperators, have to add other qml gui elements.

            Any inputs?

            Thanks.

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              Check "this":http://qt-project.org/doc/qt-5/qtquickcontrols-tableview-example.html example. It displays Rows, SortIndicator, Headers etc..
              You can use delegates to customize rows.

              157

              1 Reply Last reply
              0
              • A Offline
                A Offline
                av2306
                wrote on last edited by
                #7

                Thank you. I understand that example.

                I don't want to show standard tableview.

                I have created a component which will have labels, checkboxes, button, busyindicator. This is equal to one TableViewElement (employeename, age, manager, grade, workingstatus). These controls mapped to model data.

                I want to show these components on GUI.

                @empname age manger grade busyindicator button checkbox

                Row1 --> Loader(Component with Row1 Details) --> this is customized view
                Row2 --> Loader(Component with Row2 Details) --> this is customized view
                Row1 --> Loader(Component with Row3 Details) --> this is customized view
                Row1 --> Loader(Component with Row4 Details) --> this is customized view

                @

                Can I achieve this with TableView?

                1 Reply Last reply
                0
                • p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  I think yes. Set a custom delegate using "itemDelegate":http://qt-project.org/doc/qt-5/qml-qtquick-controls-tableview.html#itemDelegate-prop

                  157

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    av2306
                    wrote on last edited by
                    #9

                    Thank you so much. Let me try.

                    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