Pass the DropArea to setDropIndicatorAllowedFunc() too
So the lambda can have more advanced usage and inspect the target layout before allowing or disallowing the drop. For our use case, we want to limit max 3 dock widgets side by side, for example.
This commit is contained in:
@@ -267,7 +267,8 @@ int main(int argc, char **argv)
|
||||
// Dock widget 8 will only be allowed to dock to the outer areasa
|
||||
auto func = [](KDDockWidgets::DropLocation location,
|
||||
const KDDockWidgets::DockWidgetBase::List &source,
|
||||
const KDDockWidgets::DockWidgetBase::List &target) {
|
||||
const KDDockWidgets::DockWidgetBase::List &target,
|
||||
KDDockWidgets::DropArea *) {
|
||||
Q_UNUSED(target); // When dragging into a tab, 'target' would have the list of already tabbed dock widgets
|
||||
|
||||
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [] (KDDockWidgets::DockWidgetBase *dw) {
|
||||
|
||||
Reference in New Issue
Block a user