Add all|anyDockWidgetsHave overloads taking a LayoutSaverOption
This commit is contained in:
@@ -519,3 +519,19 @@ bool FloatingWindow::anyDockWidgetsHas(DockWidgetBase::Option option) const
|
||||
return frame->anyDockWidgetsHas(option);
|
||||
});
|
||||
}
|
||||
|
||||
bool FloatingWindow::allDockWidgetsHave(DockWidgetBase::LayoutSaverOption option) const
|
||||
{
|
||||
const Frame::List frames = this->frames();
|
||||
return std::all_of(frames.begin(), frames.end(), [option] (Frame *frame) {
|
||||
return frame->allDockWidgetsHave(option);
|
||||
});
|
||||
}
|
||||
|
||||
bool FloatingWindow::anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption option) const
|
||||
{
|
||||
const Frame::List frames = this->frames();
|
||||
return std::any_of(frames.begin(), frames.end(), [option] (Frame *frame) {
|
||||
return frame->anyDockWidgetsHas(option);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,6 +137,12 @@ public:
|
||||
///@brief Returns whether at least one dock widget has the specified option set
|
||||
bool anyDockWidgetsHas(DockWidgetBase::Option) const;
|
||||
|
||||
///@brief Returns whether all dock widgets have the specified layout saver option set
|
||||
bool allDockWidgetsHave(DockWidgetBase::LayoutSaverOption) const;
|
||||
|
||||
///@brief Returns whether at least one dock widget has the specified layout saver option set
|
||||
bool anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void activatedChanged();
|
||||
void numFramesChanged();
|
||||
|
||||
@@ -738,3 +738,19 @@ bool Frame::anyDockWidgetsHas(DockWidgetBase::Option option) const
|
||||
return dw->options() & option;
|
||||
});
|
||||
}
|
||||
|
||||
bool Frame::allDockWidgetsHave(DockWidgetBase::LayoutSaverOption option) const
|
||||
{
|
||||
const DockWidgetBase::List docks = dockWidgets();
|
||||
return std::all_of(docks.cbegin(), docks.cend(), [option] (DockWidgetBase *dw) {
|
||||
return dw->layoutSaverOptions() & option;
|
||||
});
|
||||
}
|
||||
|
||||
bool Frame::anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption option) const
|
||||
{
|
||||
const DockWidgetBase::List docks = dockWidgets();
|
||||
return std::any_of(docks.cbegin(), docks.cend(), [option] (DockWidgetBase *dw) {
|
||||
return dw->layoutSaverOptions() & option;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -246,6 +246,12 @@ public:
|
||||
///@brief Returns whether at least one dock widget has the specified option set
|
||||
bool anyDockWidgetsHas(DockWidgetBase::Option) const;
|
||||
|
||||
///@brief Returns whether all dock widgets have the specified layout saver option set
|
||||
bool allDockWidgetsHave(DockWidgetBase::LayoutSaverOption) const;
|
||||
|
||||
///@brief Returns whether at least one dock widget has the specified layout saver option set
|
||||
bool anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void currentDockWidgetChanged(KDDockWidgets::DockWidgetBase *);
|
||||
void numDockWidgetsChanged();
|
||||
|
||||
Reference in New Issue
Block a user