mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-16 05:35:43 +08:00
0e8e563654
* Add dockdepth1 example * Fix compilation (include assert.h) * Replace dockdepth1 by dockindock
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#include "perspectiveactions.h"
|
|
#include "dockindock.h"
|
|
#include "perspectives.h"
|
|
|
|
#include <QMenu>
|
|
|
|
using namespace QtAdsUtl;
|
|
|
|
//////////////////////////////
|
|
// LoadPerspectiveAction
|
|
//////////////////////////////
|
|
LoadPerspectiveAction::LoadPerspectiveAction( QMenu* parent, const QString& name, QtAdsUtl::DockInDockWidget& dockManager ) :
|
|
QAction( name, parent ),
|
|
name( name ),
|
|
dockManager( dockManager )
|
|
{
|
|
connect( this, SIGNAL(triggered()), this, SLOT(load()) );
|
|
}
|
|
|
|
void LoadPerspectiveAction::load()
|
|
{
|
|
dockManager.getPerspectivesManager()->openPerspective( name, dockManager );
|
|
}
|
|
|
|
//////////////////////////////
|
|
// RemovePerspectiveAction
|
|
//////////////////////////////
|
|
RemovePerspectiveAction::RemovePerspectiveAction( QMenu* parent, const QString& name, QtAdsUtl::DockInDockWidget& dockManager ) :
|
|
QAction( name, parent ),
|
|
name( name ),
|
|
dockManager( dockManager )
|
|
{
|
|
connect( this, SIGNAL(triggered()), this, SLOT(remove()) );
|
|
}
|
|
|
|
void RemovePerspectiveAction::remove()
|
|
{
|
|
dockManager.getPerspectivesManager()->removePerspective( name );
|
|
}
|