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. GridView in widget application

GridView in widget application

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • C Offline
    C Offline
    column
    wrote on last edited by
    #1

    Hello,

    I'm creating Qt Widget Application. I must use something like GridView. But I don't see any GridView in palette. Where it is? Would you point on some example on that?

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

      Hi
      You mean a like
      http://doc.qt.io/qt-5/qtableview.html#details
      I dont know what GridView offers so hard to suggest :)

      1 Reply Last reply
      1
      • C Offline
        C Offline
        column
        wrote on last edited by
        #3

        I have array of structure I need to display:

        struct FlightData {
        string name;
        int value_show;
        int value_enter;
        } ;

        FlightData fd [2] ={{"Speed",10,0},{"Altitude",55,0}};

        I need to show first two columns -name and value_show in table :
        alt text

        User must read data and enter values in editable column Enter.
        alt text

        By pressing button I need to read all data back to array of structure.

        Which control is better to use in my case? Would you help me with my task?

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

          Hi
          You could use a tablewidget
          https://wiki.qt.io/How_to_Use_QTableWidget
          http://doc.qt.io/qt-5/qtablewidget.html#signals
          You will hook up cellChanged to own slot and write data back to your
          FlightData list.

          However, if you will have many FlightData ( more than a few hundred)
          a TableView + model might better.
          http://doc.qt.io/qt-5/model-view-programming.html
          This has better performance for large lists and also
          allows other views to show part of the data.
          Editing is automatic.

          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