Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Problem with selection highlight in master-details tableViews
Forum Updated to NodeBB v4.3 + New Features

Problem with selection highlight in master-details tableViews

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 228 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.
  • F Offline
    F Offline
    faldo1
    wrote on last edited by
    #1

    Hello all,

    I'm new to QT5 on Python.

    Please have a look to following picture.

    I have two tableViews as master (left)-details (right)

    I manage the details refresh in the selectionModel().selectionChanged signal of the master

    The master and detail TV selection mode is "SingleSelection" and both selectionBahaviors are "SelectRows"

    But when I click on a cell in the master or the detail, the behavior on page is strange. Only the selected cell on the newly selected row becomes blue. The previously selected cells remain blue. I have tto click outside of the TableView and come back to it to have the whole newly selected row blue and the previously selected row unselected.

    You can also see some of the column titles turning bold.

    Any idea of what is happening ?

    Not: the TableView was correctly refreshed after the printScreen. Again, when coming back to the page after the focus was lost.

    Here is the signal connect

    self.managedFeaturesTableview.selectionModel().selectionChanged.connect(self.selectedFeatureChanged)
    

    And here is the signal management code for master TableView

        def selectedFeatureChanged(self, aoSelectedRow, aoDeselectedRow):
    
            if aoSelectedRow.indexes() is None:
                return False
    
            lnSelectedRowIndex  = aoSelectedRow.indexes()[0].row()
            loRowData           = self.managedFeaturesTableview.model().getRowData(lnSelectedRowIndex)
    
            self.updateDetails(loRowData)
    
            self.managedFeaturesTableview.repaint()
            self.managedFeaturesTableview.resizeRowsToContents()
    

    qt5MasterDetailTVrefresh.png

    eyllanescE 1 Reply Last reply
    0
    • F faldo1

      Hello all,

      I'm new to QT5 on Python.

      Please have a look to following picture.

      I have two tableViews as master (left)-details (right)

      I manage the details refresh in the selectionModel().selectionChanged signal of the master

      The master and detail TV selection mode is "SingleSelection" and both selectionBahaviors are "SelectRows"

      But when I click on a cell in the master or the detail, the behavior on page is strange. Only the selected cell on the newly selected row becomes blue. The previously selected cells remain blue. I have tto click outside of the TableView and come back to it to have the whole newly selected row blue and the previously selected row unselected.

      You can also see some of the column titles turning bold.

      Any idea of what is happening ?

      Not: the TableView was correctly refreshed after the printScreen. Again, when coming back to the page after the focus was lost.

      Here is the signal connect

      self.managedFeaturesTableview.selectionModel().selectionChanged.connect(self.selectedFeatureChanged)
      

      And here is the signal management code for master TableView

          def selectedFeatureChanged(self, aoSelectedRow, aoDeselectedRow):
      
              if aoSelectedRow.indexes() is None:
                  return False
      
              lnSelectedRowIndex  = aoSelectedRow.indexes()[0].row()
              loRowData           = self.managedFeaturesTableview.model().getRowData(lnSelectedRowIndex)
      
              self.updateDetails(loRowData)
      
              self.managedFeaturesTableview.repaint()
              self.managedFeaturesTableview.resizeRowsToContents()
      

      qt5MasterDetailTVrefresh.png

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @faldo1 please provide a minimal and reproducible example.

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      1

      • Login

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