22bool QDockWidgetPropertySheet::isEnabled(
int index)
const
24 const QString &name = propertyName(index);
25 if (name ==
"dockWidgetArea"_L1)
26 return static_cast<
const QDesignerDockWidget *>(object())->docked();
27 if (name ==
"docked"_L1)
28 return static_cast<
const QDesignerDockWidget *>(object())->inMainWindow();
29 return QDesignerPropertySheet::isEnabled(index);
44void QDesignerDockWidget::setDocked(
bool b)
46 if (QMainWindow *mainWindow = findMainWindow()) {
47 QDesignerFormEditorInterface *core = formWindow()->core();
48 QDesignerContainerExtension *c;
49 c = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), mainWindow);
55 formWindow()->selectWidget(
this, formWindow()->cursor()->isWidgetSelected(
this));
56 }
else if (!b && docked()) {
58 for (
int i = 0; i < c->count(); ++i) {
59 if (c->widget(i) ==
this) {
65 setParent(mainWindow->centralWidget());
67 formWindow()->selectWidget(
this, formWindow()->cursor()->isWidgetSelected(
this));
80void QDesignerDockWidget::setDockWidgetArea(Qt::DockWidgetArea dockWidgetArea)
82 if (QMainWindow *mainWindow = qobject_cast<QMainWindow*>(parentWidget())) {
83 if ((dockWidgetArea != Qt::NoDockWidgetArea)
84 && isAreaAllowed(dockWidgetArea)) {
85 mainWindow->addDockWidget(dockWidgetArea,
this);