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

QDockWidget loses cursor set with setCursor when floated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 4.8.5, 5.1.1
    • None
    • Windows 7, Mac
    • macOS
    • Delay-create resize handler (fixes Windows): a4c4c12f0a7d00f238ede46f1fa8f89f61dce9a0 (dev, 3.7.2014, 5.4)

      set cursor to QDockWidget with setCursor. Cursor is OK as long as QDockWidget is not dragged. Cursor is lost as soon as drag is started. Changing the cursor back to the wanted cursor in CursorChanged -event did not fix the issue either.

      #include "mainwindow.h"
      #include <QApplication>
      #include <QDockWidget>
      #include <QMainWindow>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
          w.resize(QSize(500,400));
          w.setCursor(Qt::OpenHandCursor);
      
          QDockWidget *dockWidget = new QDockWidget(&w);
          dockWidget->setCursor(QCursor(Qt::CrossCursor));
          dockWidget->setFloating(false);
      
          QWidget *dockWidgetContents = new QWidget();
          dockWidget->setWidget(dockWidgetContents);
          w.addDockWidget(Qt::RightDockWidgetArea, dockWidget);
      
          w.show();
          return a.exec();
      }
      

        1. 0001-WIP-Introduce-cursor-state-handling-to-QWidgetResize.patch
          4 kB
          Friedemann Kleint
        2. qtbug34352.zip
          1 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes