0

I have a simple Qt Mainwindow with a QDockWidget in it (Frameless Window). Now when the QDockWidget is undocked it can be resized by clicking the border of it and drag to new size.

The problem is, that the border is only 1 or 2 pixels wide and it is almost impossible to catch it on a big high resolution screen.

Is there any way to set the size of the border that can be grabbed to more than 1 pixel? (I do not want to use a QSizeGrip)

goaran
  • 353
  • 2
  • 11

2 Answers2

1
QDockWidget* dock = new QDockWidget();

dock->setStyleSheet("QDockWidget { margin: 4px; }");

This will set the dock widget margin to 4 pixels, which matches the default width of the resize grip set by QWidgetResizeHandler set unless it's target widget inherits from QFrame (QDockWidget does not).

Ilya
  • 139
  • 1
  • 3
0

Try :

QDockWidget > QWidget {
    border: 12px solid purple;
}
  • That only adds a visible border to the dockWidgetContent however it cannot be used to resize the widget. – goaran Feb 18 '20 at 12:02
  • Edit the styleSheet on your mainwindow. This tells the main window to make the separator 4 pixels instead of 1. –  Feb 18 '20 at 12:23
  • The Separator in the mainwindow is ok, the problem is the border when floating. – goaran Feb 18 '20 at 13:41