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

QDockWidget loses cursor set with setCursor when floated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • 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)

    Description

      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();
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-34352
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes