Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
set a color-border of the QDockWidget
-
how to set a color-border of the QDockWidget without influncing all the other widget on th DockWidget.
and the Dockwidget has no boder by default, eg.there is no line-border between two adjacent DockWidgets.
-
@opengpu See https://doc.qt.io/qt-5/stylesheet-reference.html and https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qdockwidget
-
@jsulm not work for a custom class.
eg. class myDock : public QDockWidget
-
@opengpu It should be fine i fell, as you are inheriting your class from
QDockWidget
andsetStyleSheet
is a public function.customClassObj->setStyleSheet("QDockWidget { " "border: 1px solid lightgray; " "titlebar-close-icon: url(close.png); " "titlebar-normal-icon: url(undock.png); " "}");
All the best.
-
@Pradeep-P-N
customClassObj->setStyleSheet("QDockWidget { border: 1px solid lightgray; }");
i tried this...not work.
and @constructor, setStyleSheet("QDockWidget { border: 1px solid lightgray; }");
also not work.
setStyleSheet("border: 1px solid lightgray;"); this work, but make everything on the DockWidget with the border
-
@Pradeep-P-N said in set a color-border of the QDockWidget:
customClassObj->setStyleSheet("QDockWidget { " "border: 1px solid lightgray; " "titlebar-close-icon: url(close.png); " "titlebar-normal-icon: url(undock.png); " "}");
not work...donot know why...
myDockWidget->setStyleSheet("QDockWidget { "
"border: 5px solid red; "
"}");
-
but this work...
myDockWidget->setStyleSheet("QDockWidget::title {text-align: left; background: red; padding-left: 5px;}");