Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72503

Signal cellEntered and itemEntered emit on mousewheel in QTableWidget when mouse tracking is off

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.2
    • None
    • Windows

    Description

      I'm using PyQt 5.11.3, which supports Qt 5.11.2. The problem is similar to the one reported in QTBUG-47063

      import sys
      
      from PyQt5.QtCore import *
      from PyQt5.QtGui import *
      from PyQt5.QtWidgets import *
      
      def cell_entered(row, col):
          print(f'Cell ({row}, {col}) entered!')
      
      def item_entered(item):
          print(f'Item "{item}" entered!')
      
      app = QApplication(sys.argv)
      
      window = QMainWindow()
      
      table = QTableWidget()
      table.setRowCount(100)
      table.setColumnCount(5)
      
      # table.setMouseTracking(True)
      # When mouse tracking is turned off, signal cellEntered and itemEntered still emit on mouse wheel (when the cursor is in cells)
      
      for i in range(100):
          for j in range(5):
              table.setItem(i, j, QTableWidgetItem(f'{i}, {j}'))
      
      table.cellEntered.connect(cell_entered)
      table.itemEntered.connect(item_entered)
      
      window.setCentralWidget(table)
      
      window.show()
      sys.exit(app.exec_())

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            blkserene blkserene
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes