How to disable dockwidget closable
-
I have dockwidget.
I want to disable closable feature but i cannot.``` dockwidget[1] = new QDockWidget(); dockwidget[1]->setWidget(chartView2); ui->gridLayout2->addWidget(dockwidget[1]);@firsnur96
https://doc.qt.io/qt-5/qdockwidget.html#features-prop
https://doc.qt.io/qt-5/qdockwidget.html#DockWidgetFeature-enum
QDockWidget::DockWidgetClosable -
@firsnur96
https://doc.qt.io/qt-5/qdockwidget.html#features-prop
https://doc.qt.io/qt-5/qdockwidget.html#DockWidgetFeature-enum
QDockWidget::DockWidgetClosable@jsulm said in How to disable dockwidget closable:
QDockWidget::DockWidgetClosable
It provides us to close or not the dockwidget.
I completely disable it.
Nobody can close the dockwidget.~QDockWidget::DockWidgetClosableNot works
-
@jsulm said in How to disable dockwidget closable:
QDockWidget::DockWidgetClosable
It provides us to close or not the dockwidget.
I completely disable it.
Nobody can close the dockwidget.~QDockWidget::DockWidgetClosableNot works
@firsnur96 said in How to disable dockwidget closable:
Not works
Please show how exactly you used QDockWidget::DockWidgetClosable
Also, "Nobody can close the dockwidget." and "Not works" can be true at the same time?
Please be more precise/clear. -
@firsnur96 said in How to disable dockwidget closable:
Not works
Please show how exactly you used QDockWidget::DockWidgetClosable
Also, "Nobody can close the dockwidget." and "Not works" can be true at the same time?
Please be more precise/clear. -
@jsulm I want nobody to close the dockwidget.
QDockWidget::DockWidgetClosableDoesn't that mean it can be close?
I want to do the opposite@firsnur96 said in How to disable dockwidget closable:
Doesn't that mean it can be close?
Come on, you have to UNSET it.
widget->setFeatures(widget->features() & ~QDockWidget::DockWidgetClosable); -
@firsnur96 said in How to disable dockwidget closable:
Doesn't that mean it can be close?
Come on, you have to UNSET it.
widget->setFeatures(widget->features() & ~QDockWidget::DockWidgetClosable);