From: nds Date: Thu, 9 Aug 2007 12:45:00 +0000 (+0000) Subject: It's correction to create some items with equal titles in different groups. X-Git-Tag: qt4_porting_delivery_220807~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=72c18779b2321b2ca74a35ab9f25f4bf0d1f9ec7;p=modules%2Fgui.git It's correction to create some items with equal titles in different groups. --- diff --git a/src/SUIT/SUIT_PreferenceMgr.cxx b/src/SUIT/SUIT_PreferenceMgr.cxx index ada123161..0424de3ca 100644 --- a/src/SUIT/SUIT_PreferenceMgr.cxx +++ b/src/SUIT/SUIT_PreferenceMgr.cxx @@ -69,22 +69,22 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId, const SUIT_PreferenceMgr::PrefItemType type, const QString& sect, const QString& param ) { - QtxPreferenceItem* item = findItem( title, true ); + QtxPreferenceItem* parent = pId == -1 ? this : findItem( pId, true ); + + if ( !parent ) + return -1; + + QtxPreferenceItem* item = parent->findItem( title, true ); + if ( item ) return item->id(); - QtxPreferenceItem* parent = 0; if ( pId == -1 ) { if ( !myRoot ) myRoot = new QtxPagePrefListItem( QString( "root" ), this ); parent = myRoot; } - else - parent = findItem( pId, true ); - - if ( !parent ) - return -1; switch( type ) { @@ -132,6 +132,12 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId, case GroupBox: item = new QtxPagePrefGroupItem( title, parent, sect, param ); break; + case Tab: + item = new QtxPagePrefTabsItem( title, parent, sect, param ); + break; + case Frame: + item = new QtxPagePrefFrameItem( title, parent, sect, param ); + break; case Font: item = new QtxPagePrefFontItem( title, parent, sect, param ); break; diff --git a/src/SUIT/SUIT_PreferenceMgr.h b/src/SUIT/SUIT_PreferenceMgr.h index 787604000..2c85f6018 100644 --- a/src/SUIT/SUIT_PreferenceMgr.h +++ b/src/SUIT/SUIT_PreferenceMgr.h @@ -36,7 +36,7 @@ class SUIT_EXPORT SUIT_PreferenceMgr : public QtxPagePrefMgr public: typedef enum { Auto, Space, Bool, Color, String, Selector, DblSpin, IntSpin, Double, Integer, - GroupBox, Font, DirList, File } PrefItemType; + GroupBox, Tab, Frame, Font, DirList, File } PrefItemType; public: SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );