Is there an easy way to remove the QDockWidget's resize handle? My dock widget can't be resized (the sizepolicy is fixed), so having the handle there is just redundant.
A:
The handle is drawn as a separator by the QMainWindow instance & I believe the only way to modify it is using a style sheet.
http://doc.trolltech.com/main-snapshot/stylesheet-examples.html#customizing-qmainwindow
Setting the background color to the current palette background seems to work:
QPalette pal = QApplication::palette(&mainWin);
QString wcolor = pal.window().color().name();
QString style= QString( "QMainWindow::separator { background: %1;}").arg(wcolor);
mainWin.setStyleSheet(style);
Cyrus
2009-11-23 23:48:28
I'm not able to check right now, but won't this just make the handle the same color as the background, but not remove it? It will still take up space, and still change the mouse cursor to the resize arrows.
mos
2009-11-25 17:02:20
Cyrus
2009-11-26 00:18:22
A:
This bug is as old as Qt itself, I reported this in this report for this in the Qt bugtracker. Please vote it up if you want it to get fixed faster.
BastiBense
2009-12-20 17:58:32
I'll go ahead and mark this as the accepted answer, since it did send me on the path of writing my own custom layout that handled docking widgets.
mos
2010-03-04 20:00:26