Using stylesheets to change position of QDockWidget buttons
-
I am creating a GUI using Qt. I use stylesheets to change the positions of close-button and float-button to the left side of the titlebars of DockWidgets in Mac OS X. My code looks like this:
@
QString macOSXButtonStyle = "";
#ifdef MACOSX
macOSXButtonStyle = "QDockWidget::close-button, QDockWidget::float-button { subcontrol-position: left; } QDockWidget::close-button { left: 4px; } QDockWidget::float-button { left: 20px; }";
#endifactiveDockWidget->setStyleSheet(macOSXButtonStyle);
@Repositioning does work. But the buttons appear smaller than before.
!http://www.informatik.uni-bremen.de/~cargath/buttons_before.png(before)!
!http://www.informatik.uni-bremen.de/~cargath/buttons_after.png(after)!I tried resizing them with different combinations of icon-size, size, width and height, but nothing seems to work. Any idea what's causing the problem / how i could fix it?
-
I think you may try it by using Layouts....
-
If those are the in widget button, layouts will not help Prajnaranjan.
Did you look at this "examples":http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-qdockwidget ?
By the way, which Qt version do you use?