本文整理汇总了C++中QMainWindowLayout::dockWidgetArea方法的典型用法代码示例。如果您正苦于以下问题:C++ QMainWindowLayout::dockWidgetArea方法的具体用法?C++ QMainWindowLayout::dockWidgetArea怎么用?C++ QMainWindowLayout::dockWidgetArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMainWindowLayout
的用法示例。
在下文中一共展示了QMainWindowLayout::dockWidgetArea方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWindowState
void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect &rect)
{
Q_Q(QDockWidget);
if (!floating && parent) {
QMainWindowLayout *mwlayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
if (mwlayout && mwlayout->dockWidgetArea(q) == Qt::NoDockWidgetArea)
return; // this dockwidget can't be redocked
}
bool wasFloating = q->isFloating();
bool hidden = q->isHidden();
if (q->isVisible())
q->hide();
Qt::WindowFlags flags = floating ? Qt::Tool : Qt::Widget;
QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);
const bool nativeDeco = dwLayout->nativeWindowDeco(floating);
if (nativeDeco) {
flags |= Qt::CustomizeWindowHint | Qt::WindowTitleHint;
if (hasFeature(this, QDockWidget::DockWidgetClosable))
flags |= Qt::WindowCloseButtonHint;
} else {
flags |= Qt::FramelessWindowHint;
}
if (unplug)
flags |= Qt::X11BypassWindowManagerHint;
q->setWindowFlags(flags);
#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
if (floating && nativeDeco && (q->features() & QDockWidget::DockWidgetVerticalTitleBar)) {
ChangeWindowAttributes(HIViewGetWindow(HIViewRef(q->winId())), kWindowSideTitlebarAttribute, 0);
}
#endif
if (!rect.isNull())
q->setGeometry(rect);
updateButtons();
if (!hidden)
q->show();
if (floating != wasFloating) {
emit q->topLevelChanged(floating);
if (!floating && parent) {
QMainWindowLayout *mwlayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
if (mwlayout)
emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
}
}
resizer->setActive(QWidgetResizeHandler::Resize, !unplug && floating && !nativeDeco);
}