Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. In Qtableview Column data Synchronize
Qt 6.12 LTS is out! See what's new in the release blog

In Qtableview Column data Synchronize

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 536 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.
  • N Offline
    N Offline
    n-2204
    wrote on last edited by n-2204
    #1

    I have two Qtableviews ( Qstandarditemmodel) so is there a way i can make two column as synchronize .
    Use case1: in table1 when user enter values in column 1 and 2 (x,y values ) then based on these in table2 column 3 (calculate theta ) calculation should happen.
    Second if user enter data in table2 column3 (enteres theta ) then based on this in table1 column 1 and 2 (cal x, y) data should update
    if i use datachange signal then it will be very slow i guess! or as data will be change in both the tables
    I have tables with 7 rows & 10 columns .
    How can i do this ??

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

      Hi,

      If properly used, there should be no issue with dataChanged.

      Why do you need two different models for that ?

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

      1 Reply Last reply
      1
      • N Offline
        N Offline
        n-2204
        wrote on last edited by
        #3

        ok. so if using datachange i can only mention signal for one table , i need to update for both the table datachange, user can enter data in any table
        my mistake,actually i have 2 tables with diff columns

        JonBJ 1 Reply Last reply
        0
        • N n-2204

          ok. so if using datachange i can only mention signal for one table , i need to update for both the table datachange, user can enter data in any table
          my mistake,actually i have 2 tables with diff columns

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @n-2204
          If you have multiple tables you will need each one to have its own dataChanged slot connected. If you need one table's data to alter another table's data it will need to know the instance of the other table to call setData() on.

          1 Reply Last reply
          3
          • N Offline
            N Offline
            n-2204
            wrote on last edited by
            #5

            thankyou for answers. understood i will use datachanged slot

            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
            • Unsolved