4

I have the following widget structure. CDockWidgetInfoBar is just a QDockWidget derived class

Widget structure

When I move over the QDockWidget (CDockWidgetInfoBar), I see this splitter cursor. Resize cursor

Where is it coming from? Can I disable it? Is it part of QDockWidgetLayout? However, QDockWidgetLayout is Qt private and shall not be used.

Any ideas?

Horst Walter
  • 13,663
  • 32
  • 126
  • 228

1 Answers1

1

It seems to be impossible or extremely painful for system.

I tried to do this as I did this here: How can I prevent transform cursor to SplitHCursor when it's under border between QHeaderView sections

But the main problem, that resize cursor appears before QEvent::Enter event occurs. (if you run next code, you will see resize cursor first, but you will not see "added" word). As I know, there is no any event which can catch cursor when it moves near edge of widget. So it is very difficult to catch this event. There is another way. In mouseMoveEvent every time check is cursor near the dock widget. But I think that it is extremely inefficient.

I wrote this code:

if (obj == ui->dockWidget && event->type() == QEvent::Enter)
{
    qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
    qDebug() << "added";
}
if (obj == ui->dockWidget && event->type() == QEvent::Leave)
{
    qApp->restoreOverrideCursor();
}

But it really works after user trying to float dock.

I know that it is not full answer, but maybe it helps or prove that it is very difficult. Anyways, if someone will find efficient solution of this problem, it will be extremely great.

Community
  • 1
  • 1
Jablonski
  • 18,083
  • 2
  • 46
  • 47