Commit b216ade1 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt view mode are exclusives

parent 64aa5fae
...@@ -261,11 +261,13 @@ bool StandardPLPanel::popup( const QModelIndex & index, const QPoint &point, con ...@@ -261,11 +261,13 @@ bool StandardPLPanel::popup( const QModelIndex & index, const QPoint &point, con
QSignalMapper *viewSelectionMapper = new QSignalMapper( this ); QSignalMapper *viewSelectionMapper = new QSignalMapper( this );
CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) ); CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) );
QActionGroup *viewGroup = new QActionGroup( this );
# define MAX_VIEW StandardPLPanel::VIEW_COUNT # define MAX_VIEW StandardPLPanel::VIEW_COUNT
for( int i = 0; i < MAX_VIEW; i++ ) for( int i = 0; i < MAX_VIEW; i++ )
{ {
QAction *action = viewMenu->addAction( viewNames[i] ); QAction *action = viewMenu->addAction( viewNames[i] );
action->setCheckable( true ); action->setCheckable( true );
viewGroup->addAction( action );
viewSelectionMapper->setMapping( action, i ); viewSelectionMapper->setMapping( action, i );
CONNECT( action, triggered(), viewSelectionMapper, map() ); CONNECT( action, triggered(), viewSelectionMapper, map() );
if( currentViewIndex() == i ) if( currentViewIndex() == i )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment