const int need_pos, const int splitter_pos );
private:
- QWidget* myWin; //!< active widget
- QtxWorkstackArea* myArea; //!< active workarea
- QtxWorkstackSplitter* mySplit; //!< tol-level splitter
- QWidget* myWorkWin; //!< widget where popup menu is invoked (used internally)
- QtxWorkstackArea* myWorkArea; //!< workarea where popup menu is invoked (used internally)
+ QPointer<QWidget> myWin; //!< active widget
+ QPointer<QtxWorkstackArea> myArea; //!< active workarea
+ QtxWorkstackSplitter* mySplit; //!< tol-level splitter
+ QPointer<QWidget> myWorkWin; //!< widget where popup menu is invoked (used internally)
+ QPointer<QtxWorkstackArea> myWorkArea; //!< workarea where popup menu is invoked (used internally)
QMap<int, QAction*> myActionsMap; //!< actions map
myWorkstack( ws ),
myWindowsFlag( true )
{
- insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
- tr( "Split vertically" ), 0, this ), SplitVertical );
- insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
- tr( "Split horizontally" ), 0, this ), SplitHorizontal );
+ if ( myWorkstack )
+ insertAction( myWorkstack->action( QtxWorkstack::SplitVertical ), SplitVertical );
+ else
+ insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
+ tr( "Split vertically" ), 0, this ), SplitVertical );
+
+ if ( myWorkstack )
+ insertAction( myWorkstack->action( QtxWorkstack::SplitHorizontal ), SplitHorizontal );
+ else
+ insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
+ tr( "Split horizontally" ), 0, this ), SplitHorizontal );
connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
/*!
\brief Set actions to be visible in the menu.
-
- Actions, which IDs are set in \a flags parameter, will be shown in the
+
+ Actions, which IDs are set in \a flags parameter, will be shown in the
menu bar. Other actions will not be shown.
\param flags ORed together actions flags
*/
void QtxWorkstackAction::perform( const int type )
{
+ /*
switch ( type )
{
case SplitVertical:
splitHorizontal();
break;
}
+ */
}
/*!
/*!
\brief Called when menu item is activated by the user.
-
+
Perform the corresponding action.
\param id menu item identifier