本文整理汇总了C++中QMdiSubWindow::parentWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::parentWidget方法的具体用法?C++ QMdiSubWindow::parentWidget怎么用?C++ QMdiSubWindow::parentWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::parentWidget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setActiveFormWindow
void FormWindowManager::setActiveFormWindow(QDesignerFormWindowInterface *w)
{
FormWindow *formWindow = qobject_cast<FormWindow*>(w);
if (formWindow == m_activeFormWindow)
return;
FormWindow *old = m_activeFormWindow;
m_activeFormWindow = formWindow;
QtResourceSet *resourceSet = 0;
if (formWindow)
resourceSet = formWindow->resourceSet();
m_core->resourceModel()->setCurrentResourceSet(resourceSet);
slotUpdateActions();
if (m_activeFormWindow) {
m_activeFormWindow->repaintSelection();
if (old)
old->repaintSelection();
}
emit activeFormWindowChanged(m_activeFormWindow);
if (m_activeFormWindow) {
m_activeFormWindow->emitSelectionChanged();
m_activeFormWindow->commandHistory()->setActive();
// Trigger setActiveSubWindow on mdi area unless we are in toplevel mode
QMdiSubWindow *mdiSubWindow = 0;
if (QWidget *formwindow = m_activeFormWindow->parentWidget()) {
mdiSubWindow = qobject_cast<QMdiSubWindow *>(formwindow->parentWidget());
}
if (mdiSubWindow) {
for (QWidget *parent = mdiSubWindow->parentWidget(); parent; parent = parent->parentWidget()) {
if (QMdiArea *mdiArea = qobject_cast<QMdiArea*>(parent)) {
mdiArea->setActiveSubWindow(mdiSubWindow);
break;
}
}
}
}
}