Skip to content

Commit 3428a4b

Browse files
authored
Added CDockManager::floatingWidgetCreated event (#121)
This allows to subscribe to events of the newly created window. A common use case is to show a message box if a dock container with many modified documents in it is closed. This allows for the user to decide whether he wants to save / discard all the changes or cancel the closing of the window.
1 parent 2b9377b commit 3428a4b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/DockManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ CDockManager::~CDockManager()
440440
void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
441441
{
442442
d->FloatingWidgets.append(FloatingWidget);
443+
emit floatingWidgetCreated(FloatingWidget);
443444
ADS_PRINT("d->FloatingWidgets.count() " << d->FloatingWidgets.count());
444445
}
445446

src/DockManager.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,17 @@ public slots:
450450

451451
/**
452452
* This signal is emitted if the dock manager finished opening a
453-
* perspective
453+
* perspective.
454454
*/
455455
void perspectiveOpened(const QString& PerspectiveName);
456456

457+
/**
458+
* This signal is emitted, if a new floating widget has been created.
459+
* An application can use this signal to e.g. subscribe to events of
460+
* the newly created window.
461+
*/
462+
void floatingWidgetCreated(CFloatingDockContainer* FloatingWidget);
463+
457464
/**
458465
* This signal is emitted, if a new DockArea has been created.
459466
* An application can use this signal to set custom icons or custom

0 commit comments

Comments
 (0)