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

TableView and TreeView context menu handling can be improved

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0 Beta
    • 5.3.2, 5.4.1, 5.5.0 Alpha
    • Quick: Controls 1
    • None
    • 235abf6486c221e4dc763b614ac33771abdd8f3f

    Description

      Currently the TableView exposes the following signals:

      • activated(int row)
      • clicked(int row)
      • doubleClicked(int row)
      • pressAndHold(int row)

      The same signals are present in the TreeView with the row
      argument morphed to index (QModeIndex)

      The main issue arise with the clicked signals. This could be interesting for handling for example context menu for a given row or item however there's no information about the fact that a given Row has been clicked with the right or left mouse button.

      The workaround is to reimplement the rowDelegate and add a MouseArea.
      This however causes the rewrite of all the rowDelegate logic.

      Another problem is handling of clicks that doesn' collide with a row of the TreeView/TableView.

      Currently on the TableView we can detect if the a click collide with a row by using the "rowAt(x,y)" function.
      This function returns -1 if the there's no row at the given x,y coordinates.
      However there's not such functionality on the TreeView.
      The use case is resetting the current selection if the user click on the TableView/TreView background.

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            cuke Filippo Cucchetto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes