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

QTreeWidget item selection and mouse pointer option "Snap To"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.6.1
    • 4.4.3
    • Core: Event loop
    • None
    • c275ba17d263f9108ee26e32a0f89b0c57e526e0

    Description

      The mouse pointer option "Snap To" in Windows (Automatically move pointer to the
      default button in a dialog box) is turned on.

      A QTreeWidget with some items is shown. If you double click on an item
      (i.e. the top one) and a dialog box is shown, the mouse pointer
      automatically moves to the default button. So far it's all ok. But the
      item selection also changes from the double clicked item to the item,
      which is right under the default button of the dialog box. This is wrong.
      The double clicked item should remain the selected item.

      Example Code:

      #include <QtCore>
      #include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      QTreeWidget tw;
      for (int n = 0; n < 100; n++)

      { tw.addTopLevelItem(new QTreeWidgetItem((QTreeWidgetItem *) 0, QStringList(QString("Item %1").arg(n)))); }

      tw.showMaximized();

      QMessageBox mb;
      QObject::connect(&tw, SIGNAL(doubleClicked(const QModelIndex &)), &mb,
      SLOT(exec()));

      return a.exec();
      }

      The same code is working with Qt version 4.3.4.

      Attachments

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

        Activity

          People

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            xcm Martin Petersson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes