本文整理汇总了C++中QMainWindowLayout::restore方法的典型用法代码示例。如果您正苦于以下问题:C++ QMainWindowLayout::restore方法的具体用法?C++ QMainWindowLayout::restore怎么用?C++ QMainWindowLayout::restore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMainWindowLayout
的用法示例。
在下文中一共展示了QMainWindowLayout::restore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: endDrag
void QToolBarPrivate::endDrag()
{
Q_Q(QToolBar);
Q_ASSERT(state != 0);
q->releaseMouse();
if (state->dragging) {
QMainWindowLayout *layout =
qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout());
Q_ASSERT(layout != 0);
if (!layout->plug(state->widgetItem)) {
if (q->isFloatable()) {
layout->restore();
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
setWindowState(true); // gets rid of the X11BypassWindowManager window flag
// and activates the resizer
#endif
q->activateWindow();
} else {
layout->revert(state->widgetItem);
}
}
}
delete state;
state = 0;
}
示例2: startDrag
void QDockWidgetPrivate::startDrag()
{
Q_Q(QDockWidget);
if (state == 0 || state->dragging)
return;
QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
Q_ASSERT(layout != 0);
state->widgetItem = layout->unplug(q);
if (state->widgetItem == 0) {
/* I have a QMainWindow parent, but I was never inserted with
QMainWindow::addDockWidget, so the QMainWindowLayout has no
widget item for me. :( I have to create it myself, and then
delete it if I don't get dropped into a dock area. */
state->widgetItem = new QDockWidgetItem(q);
state->ownWidgetItem = true;
}
if (state->ctrlDrag)
layout->restore();
state->dragging = true;
}
示例3: endDrag
void QDockWidgetPrivate::endDrag(bool abort)
{
Q_Q(QDockWidget);
Q_ASSERT(state != 0);
q->releaseMouse();
if (state->dragging) {
QMainWindowLayout *mwLayout =
qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout());
Q_ASSERT(mwLayout != 0);
if (abort || !mwLayout->plug(state->widgetItem)) {
if (hasFeature(this, QDockWidget::DockWidgetFloatable)) {
if (state->ownWidgetItem)
delete state->widgetItem;
mwLayout->restore();
#ifdef Q_WS_X11
// get rid of the X11BypassWindowManager window flag and activate the resizer
Qt::WindowFlags flags = q->windowFlags();
flags &= ~Qt::X11BypassWindowManagerHint;
q->setWindowFlags(flags);
resizer->setActive(QWidgetResizeHandler::Resize, true);
q->show();
#else
QDockWidgetLayout *myLayout
= qobject_cast<QDockWidgetLayout*>(layout);
resizer->setActive(QWidgetResizeHandler::Resize,
myLayout->widgetForRole(QDockWidgetLayout::TitleBar) != 0);
#endif
undockedGeometry = q->geometry();
q->activateWindow();
} else {
mwLayout->revert(state->widgetItem);
}
}
}
delete state;
state = 0;
}