本文整理汇总了C++中shell::Pointer::GetShells方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetShells方法的具体用法?C++ Pointer::GetShells怎么用?C++ Pointer::GetShells使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shell::Pointer
的用法示例。
在下文中一共展示了Pointer::GetShells方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModalChild
Shell::Pointer Window::GetModalChild(const QList<Shell::Pointer>& toSearch)
{
int modal = Constants::APPLICATION_MODAL | Constants::SYSTEM_MODAL | Constants::PRIMARY_MODAL;
int size = toSearch.size();
for (int i = size - 1; i < size; i--)
{
Shell::Pointer shell = toSearch[i];
// Check if this shell has a modal child
QList<Shell::Pointer> children = shell->GetShells();
Shell::Pointer modalChild = GetModalChild(children);
if (modalChild != 0)
{
return modalChild;
}
// If not, check if this shell is modal itself
if (shell->IsVisible() && (shell->GetStyle() & modal) != 0)
{
return shell;
}
}
return Shell::Pointer(nullptr);
}
示例2:
Shell::Pointer Window::DefaultModalParent::GetShell() const
{
Shell::Pointer parent = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetActiveShell();
// Make sure we don't pick a parent that has a modal child (this can lock the app)
if (parent == 0)
{
// If this is a top-level window, then there must not be any open modal windows.
parent = Window::GetModalChild(Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetShells());
}
else
{
// If we picked a parent with a modal child, use the modal child instead
Shell::Pointer modalChild = Window::GetModalChild(parent->GetShells());
if (modalChild != 0)
{
parent = modalChild;
}
}
return parent;
}