From: vsr Date: Thu, 5 Jul 2007 08:26:40 +0000 (+0000) Subject: Porting to Qt 4 X-Git-Tag: qt4_porting_delivery_220807~120 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=930114c5eb26114f7911ed2245ddaddb89e4e8ed;p=modules%2Fgui.git Porting to Qt 4 --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 9d69ba44d..f388f2ef6 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -199,7 +199,7 @@ LightApp_Preferences* LightApp_Application::_prefs_ = 0; /*!Constructor.*/ LightApp_Application::LightApp_Application() : CAM_Application( false ), -myPrefs( 0 ) + myPrefs( 0 ) { STD_TabDesktop* desk = new STD_TabDesktop(); @@ -209,7 +209,7 @@ myPrefs( 0 ) QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ); desktop()->setWindowIcon( aLogo ); - desktop()->setDockableMenuBar( true ); + desktop()->setDockableMenuBar( false ); desktop()->setDockableStatusBar( false ); // base logo (salome itself) @@ -618,11 +618,9 @@ void LightApp_Application::createActions() createMenu( PreferencesId, fileMenu, 50, -1 ); createMenu( separator(), fileMenu, -1, 50, -1 ); - /* createMenu( separator(), fileMenu, -1, 100, -1 ); createMenu( MRUId, fileMenu, 100, -1 ); createMenu( separator(), fileMenu, -1, 100, -1 ); - */ } /*!On module activation action.*/ @@ -653,7 +651,8 @@ void LightApp_Application::onModuleActivation( const QString& modName ) case 0: default: putInfo( tr("INF_CANCELLED") ); - myModuleAction->setActiveModule( QString() ); + if ( myModuleAction ) + myModuleAction->setActiveModule( QString() ); cancelled = true; } } @@ -1125,7 +1124,7 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) ); myWindows.insert( flag, newWC ); if ( winMap.contains( flag ) ) { - desktop()->removeDockWidget( myWindows[flag] ); + //desktop()->removeDockWidget( myWindows[flag] ); desktop()->addDockWidget( (DockWidgetArea)winMap[flag], myWindows[flag] ); } @@ -1768,11 +1767,6 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const QStringList modNameList; app->modules( modNameList, false ); - for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it ) - { - int id = _prefs_->addPreference( *it ); - _prefs_->setItemProperty( id, "info", tr( "PREFERENCES_NOT_LOADED" ).arg( *it ) ); - } ModuleList modList; app->modules( modList ); @@ -1793,6 +1787,8 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const mod->createPreferences(); } } + int id = _prefs_->addPreference( "Root" ); + _prefs_->setItemProperty( id, "info", tr( "PREFERENCES_NOT_LOADED" ) ); } connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ), @@ -2145,8 +2141,9 @@ void LightApp_Application::updateModuleActions() QString modName; if ( activeModule() ) modName = activeModule()->moduleName(); - - myModuleAction->setActiveModule( modName ); + + if ( myModuleAction ) + myModuleAction->setActiveModule( modName ); } /*! @@ -2197,7 +2194,7 @@ void LightApp_Application::updateWindows() if ( dock != NoDockWidgetArea && dock != (DockWidgetArea)it.value() ) { - desktop()->removeDockWidget( myWindows[it.key()] ); + //desktop()->removeDockWidget( myWindows[it.key()] ); desktop()->addDockWidget( (DockWidgetArea)it.value(), myWindows[it.key()] ); } } @@ -2213,7 +2210,8 @@ void LightApp_Application::updateWindows() !myWindowsVisible[ itr.key() ] ) continue; - setWindowShown( itr.key(), !itr.value()->isEmpty() && winMap.contains( itr.key() ) ); + if ( itr.value() ) + setWindowShown( itr.key(), !itr.value()->isEmpty() && winMap.contains( itr.key() ) ); } } @@ -2240,7 +2238,7 @@ void LightApp_Application::loadWindowsGeometry() QString modName; if ( activeModule() ) - modName = activeModule()->objectName(); + modName = activeModule()->name(); desktop()->restoreState( resourceMgr()->stringValue( "windows_geometry", modName ).toLatin1() ); } @@ -2256,7 +2254,7 @@ void LightApp_Application::saveWindowsGeometry() QString modName; if ( activeModule() ) - modName = activeModule()->objectName(); + modName = activeModule()->name(); resourceMgr()->setValue( "windows_geometry", modName, desktop()->saveState() ); } diff --git a/src/LightApp/LightApp_Dialog.cxx b/src/LightApp/LightApp_Dialog.cxx index f05267c34..7d62a461a 100644 --- a/src/LightApp/LightApp_Dialog.cxx +++ b/src/LightApp/LightApp_Dialog.cxx @@ -780,7 +780,7 @@ QString& LightApp_Dialog::typeName( const int type ) \return const reference to type name \param type - integer id of type */ -const QString& LightApp_Dialog::typeName( const int type ) const +const QString LightApp_Dialog::typeName( const int type ) const { return myTypeNames[ type ]; } diff --git a/src/LightApp/LightApp_Dialog.h b/src/LightApp/LightApp_Dialog.h index f4a3a81d8..2a0eb5fc9 100644 --- a/src/LightApp/LightApp_Dialog.h +++ b/src/LightApp/LightApp_Dialog.h @@ -224,7 +224,7 @@ protected: //!Change and get type name for indicating in selection widget QString& typeName( const int ); - const QString& typeName( const int ) const; + const QString typeName( const int ) const; //! Create string contains selection list by list of names, list of types and current name indication state virtual QString selectionDescription( const QStringList&, const TypesList&, const NameIndication ) const; diff --git a/src/LightApp/LightApp_Preferences.cxx b/src/LightApp/LightApp_Preferences.cxx index beaa1afe4..8be2b36ab 100644 --- a/src/LightApp/LightApp_Preferences.cxx +++ b/src/LightApp/LightApp_Preferences.cxx @@ -25,7 +25,7 @@ Constructor.Initialize by resource manager and parent QWidget. */ LightApp_Preferences::LightApp_Preferences( QtxResourceMgr* resMgr, QWidget* parent ) -: QtxListResourceEdit( resMgr, parent ) +: SUIT_PreferenceMgr( resMgr, parent ) { } @@ -42,7 +42,7 @@ LightApp_Preferences::~LightApp_Preferences() int LightApp_Preferences::addPreference( const QString& label, const int pId, const int type, const QString& section, const QString& param ) { - return addItem( label, pId, type, section, param ); + return addItem( label, pId, (SUIT_PreferenceMgr::PrefItemType)type, section, param ); } /*! @@ -51,7 +51,7 @@ int LightApp_Preferences::addPreference( const QString& label, const int pId, co int LightApp_Preferences::addPreference( const QString& mod, const QString& label, const int pId, const int type, const QString& section, const QString& param ) { - int id = addItem( label, pId, type, section, param ); + int id = addItem( label, pId, (SUIT_PreferenceMgr::PrefItemType)type, section, param ); if ( id != -1 && !mod.isEmpty() ) myPrefMod.insert( id, mod ); return id; @@ -80,9 +80,10 @@ void LightApp_Preferences::onApply() } /*!Emit preference changed.*/ -void LightApp_Preferences::changedResources( const QMap& map ) +void LightApp_Preferences::changedResources( const ResourceMap& map ) { - for ( QMap::ConstIterator it = map.begin(); it != map.end(); ++it ) + for ( ResourceMap::ConstIterator it = map.begin(); + it != map.end(); ++it ) { QString sec, param; it.key()->resource( sec, param ); diff --git a/src/LightApp/LightApp_Preferences.h b/src/LightApp/LightApp_Preferences.h index 6a1b3dc1c..624f6e2be 100644 --- a/src/LightApp/LightApp_Preferences.h +++ b/src/LightApp/LightApp_Preferences.h @@ -23,7 +23,7 @@ #define LIGHTAPP_PREFERENCES_H #include -#include +#include #include @@ -34,7 +34,7 @@ class QtxResourceMgr; Custom preference container. Assign each preference category with module. Emits signal on preference changing */ -class LIGHTAPP_EXPORT LightApp_Preferences : public QtxListResourceEdit +class LIGHTAPP_EXPORT LightApp_Preferences : public SUIT_PreferenceMgr { Q_OBJECT @@ -49,13 +49,15 @@ public: bool hasModule( const QString& ) const; +protected: + void changedResources( const ResourceMap& ); + signals: void preferenceChanged( QString&, QString&, QString& ); private slots: void onHelp(); void onApply(); - virtual void changedResources( const QMap& ); private: QString module( const int ) const; diff --git a/src/LightApp/LightApp_PreferencesDlg.cxx b/src/LightApp/LightApp_PreferencesDlg.cxx index efb03ca15..aecff557e 100644 --- a/src/LightApp/LightApp_PreferencesDlg.cxx +++ b/src/LightApp/LightApp_PreferencesDlg.cxx @@ -42,19 +42,14 @@ myPrefs( prefs ), mySaved ( false ) QVBoxLayout* main = new QVBoxLayout( mainFrame() ); main->setMargin( 5 ); main->setSpacing( 5 ); + main->addWidget( myPrefs ); - QWidget* vbox = new QWidget( mainFrame() ); - main->addWidget( vbox ); - - QVBoxLayout *base = new QVBoxLayout( vbox ); - - myPrefs->setParent( vbox ); - myPrefs->move( QPoint( 0, 0 ) ); - myPrefs->show(); + // myPrefs->setParent( vbox ); + // myPrefs->move( QPoint( 0, 0 ) ); + // myPrefs->show(); setFocusProxy( myPrefs ); - - base->addWidget( myPrefs ); + myPrefs->setFrameStyle( QFrame::Box | QFrame::Sunken ); setButtonPosition( Right, Close ); @@ -79,8 +74,8 @@ LightApp_PreferencesDlg::~LightApp_PreferencesDlg() if ( !myPrefs ) return; + mainFrame()->layout()->removeWidget( myPrefs ); myPrefs->setParent( 0 ); - myPrefs->move( QPoint( 0, 0 ) ); myPrefs->hide(); myPrefs = 0; } diff --git a/src/LightApp/LightApp_WidgetContainer.cxx b/src/LightApp/LightApp_WidgetContainer.cxx index e6ac9401f..c7ac53a2e 100644 --- a/src/LightApp/LightApp_WidgetContainer.cxx +++ b/src/LightApp/LightApp_WidgetContainer.cxx @@ -152,3 +152,17 @@ QWidget* LightApp_WidgetContainer::active() const { return myStack->currentWidget(); } + +/*! + \brief Customize show/hide operations. + + Emits visibilityChanged(bool) signal when the widget is + being shown/hidden. + + \param visible new visibility state +*/ +void LightApp_WidgetContainer::setVisible ( bool visible ) +{ + QDockWidget::setVisible( visible ); + emit( visibilityChanged( visible ) ); +} diff --git a/src/LightApp/LightApp_WidgetContainer.h b/src/LightApp/LightApp_WidgetContainer.h index 8fc496f7e..23aa342a0 100644 --- a/src/LightApp/LightApp_WidgetContainer.h +++ b/src/LightApp/LightApp_WidgetContainer.h @@ -52,6 +52,12 @@ public: QWidget* active() const; QWidget* widget( const int ) const; +public slots: + virtual void setVisible ( bool ); + +signals: + void visibilityChanged ( bool ); + private: int myType; QStackedWidget* myStack; diff --git a/src/LightApp/Makefile.am b/src/LightApp/Makefile.am index 4776d0dc9..12e38da06 100755 --- a/src/LightApp/Makefile.am +++ b/src/LightApp/Makefile.am @@ -42,7 +42,6 @@ salomeinclude_HEADERS= \ LightApp_ModuleAction.h \ LightApp_ModuleDlg.h \ LightApp_NameDlg.h \ - LightApp_OBFilter.h \ LightApp_OBSelector.h \ LightApp_Operation.h \ LightApp_Selection.h \ @@ -56,6 +55,8 @@ salomeinclude_HEADERS= \ LightApp_UpdateFlags.h \ LightApp_WidgetContainer.h +# LightApp_OBFilter.h + if ENABLE_VTKVIEWER if ENABLE_SALOMEOBJECT salomeinclude_HEADERS+= LightApp_VTKSelector.h @@ -84,7 +85,6 @@ dist_libLightApp_la_SOURCES= \ LightApp_ModuleAction.cxx \ LightApp_ModuleDlg.cxx \ LightApp_NameDlg.cxx \ - LightApp_OBFilter.cxx \ LightApp_OBSelector.cxx \ LightApp_Operation.cxx \ LightApp_Selection.cxx \ @@ -96,6 +96,8 @@ dist_libLightApp_la_SOURCES= \ LightApp_PreferencesDlg.cxx \ LightApp_WidgetContainer.cxx +# LightApp_OBFilter.cxx + if ENABLE_VTKVIEWER if ENABLE_SALOMEOBJECT dist_libLightApp_la_SOURCES+= LightApp_VTKSelector.cxx diff --git a/src/LightApp/resources/LightApp_msg_en.ts b/src/LightApp/resources/LightApp_msg_en.ts index 3223c0022..15a17e3e9 100644 --- a/src/LightApp/resources/LightApp_msg_en.ts +++ b/src/LightApp/resources/LightApp_msg_en.ts @@ -107,7 +107,7 @@ CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS PREFERENCES_NOT_LOADED - Preferences for module "<b>%1</b>" will be available when the module will be loaded + Preferences for module "<b>%N</b>" will be available when the module will be loaded PREF_LINEAR diff --git a/src/Qtx/Makefile.am b/src/Qtx/Makefile.am index 5addbdd15..d6b553513 100755 --- a/src/Qtx/Makefile.am +++ b/src/Qtx/Makefile.am @@ -33,6 +33,7 @@ salomeinclude_HEADERS= \ QtxActionMgr.h \ QtxActionSet.h \ QtxActionToolMgr.h \ + QtxColorButton.h \ QtxColorScale.h \ QtxComboBox.h \ QtxDialog.h \ @@ -40,6 +41,7 @@ salomeinclude_HEADERS= \ QtxDockWidget.h \ QtxDoubleSpinBox.h \ QtxEvalExpr.h \ + QtxFontEdit.h \ QtxGridBox.h \ QtxGroupBox.h \ QtxIntSpinBox.h \ @@ -48,8 +50,12 @@ salomeinclude_HEADERS= \ QtxMainWindow.h \ QtxMap.h \ QtxMRUAction.h \ + QtxPagePrefMgr.h \ QtxPathDialog.h \ + QtxPathEdit.h \ + QtxPathListEdit.h \ QtxPopupMgr.h \ + QtxPreferenceMgr.h \ QtxResourceMgr.h \ QtxSplash.h \ QtxToolBar.h \ @@ -62,12 +68,9 @@ salomeinclude_HEADERS= \ #VSR: not yet migrated to Qt4 files # \ - QtxDirListEditor.h \ QtxListBox.h \ - QtxListResourceEdit.h \ QtxListView.h \ QtxPopupMenu.h \ - QtxResourceEdit.h \ QtxTable.h # Libraries targets @@ -82,6 +85,7 @@ dist_libqtx_la_SOURCES= \ QtxActionMgr.cxx \ QtxActionSet.cxx \ QtxActionToolMgr.cxx \ + QtxColorButton.cxx \ QtxColorScale.cxx \ QtxComboBox.cxx \ QtxDialog.cxx \ @@ -89,6 +93,7 @@ dist_libqtx_la_SOURCES= \ QtxDockWidget.cxx \ QtxDoubleSpinBox.cxx \ QtxEvalExpr.cxx \ + QtxFontEdit.cxx \ QtxGridBox.cxx \ QtxGroupBox.cxx \ QtxIntSpinBox.cxx \ @@ -96,8 +101,12 @@ dist_libqtx_la_SOURCES= \ QtxLogoMgr.cxx \ QtxMainWindow.cxx \ QtxMRUAction.cxx \ + QtxPagePrefMgr.cxx \ QtxPathDialog.cxx \ + QtxPathEdit.cxx \ + QtxPathListEdit.cxx \ QtxPopupMgr.cxx \ + QtxPreferenceMgr.cxx \ QtxResourceMgr.cxx \ QtxSplash.cxx \ QtxToolBar.cxx \ @@ -110,12 +119,9 @@ dist_libqtx_la_SOURCES= \ #VSR: not yet migrated to Qt4 files # \ - QtxDirListEditor.cxx \ QtxListBox.cxx \ - QtxListResourceEdit.cxx \ QtxListView.cxx \ QtxPopupMenu.cxx \ - QtxResourceEdit.cxx \ QtxTable.cxx #VSR: already migrated to Qt4 files @@ -125,12 +131,14 @@ MOC_FILES= \ QtxActionMgr_moc.cxx \ QtxActionSet_moc.cxx \ QtxActionToolMgr_moc.cxx \ + QtxColorButton_moc.cxx \ QtxColorScale_moc.cxx \ QtxComboBox_moc.cxx \ QtxDialog_moc.cxx \ QtxDockAction_moc.cxx \ QtxDockWidget_moc.cxx \ QtxDoubleSpinBox_moc.cxx \ + QtxFontEdit_moc.cxx \ QtxGridBox_moc.cxx \ QtxGroupBox_moc.cxx \ QtxIntSpinBox_moc.cxx \ @@ -138,7 +146,10 @@ MOC_FILES= \ QtxLogoMgr_moc.cxx \ QtxMainWindow_moc.cxx \ QtxMRUAction_moc.cxx \ + QtxPagePrefMgr_moc.cxx \ QtxPathDialog_moc.cxx \ + QtxPathEdit_moc.cxx \ + QtxPathListEdit_moc.cxx \ QtxPopupMgr_moc.cxx \ QtxSplash_moc.cxx \ QtxToolBar_moc.cxx \ @@ -151,9 +162,7 @@ MOC_FILES= \ #VSR: not yet migrated to Qt4 files # \ - QtxDirListEditor_moc.cxx \ QtxListBox_moc.cxx \ - QtxListResourceEdit_moc.cxx \ QtxListView_moc.cxx \ QtxPopupMenu_moc.cxx \ QtxTable_moc.cxx diff --git a/src/Qtx/QtxActionMenuMgr.cxx b/src/Qtx/QtxActionMenuMgr.cxx index dea19a613..07bbc1100 100644 --- a/src/Qtx/QtxActionMenuMgr.cxx +++ b/src/Qtx/QtxActionMenuMgr.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionMenuMgr.cxx -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #include "QtxActionMenuMgr.h" diff --git a/src/Qtx/QtxActionMenuMgr.h b/src/Qtx/QtxActionMenuMgr.h index 5bc0c800a..96d15b51b 100644 --- a/src/Qtx/QtxActionMenuMgr.h +++ b/src/Qtx/QtxActionMenuMgr.h @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionMenuMgr.h -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #ifndef QTXACTIONMENUMGR_H #define QTXACTIONMENUMGR_H diff --git a/src/Qtx/QtxActionMgr.cxx b/src/Qtx/QtxActionMgr.cxx index 2ae9ebf02..bd0236422 100644 --- a/src/Qtx/QtxActionMgr.cxx +++ b/src/Qtx/QtxActionMgr.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionMgr.cxx -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #include "Qtx.h" #include "QtxActionMgr.h" diff --git a/src/Qtx/QtxActionMgr.h b/src/Qtx/QtxActionMgr.h index 0c710386d..2cd2cc9fa 100644 --- a/src/Qtx/QtxActionMgr.h +++ b/src/Qtx/QtxActionMgr.h @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionMgr.h -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #ifndef QTXACTIONMGR_H #define QTXACTIONMGR_H diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index e0b7fbd29..73ac80a5f 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionToolMgr.cxx -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #include "QtxActionToolMgr.h" diff --git a/src/Qtx/QtxActionToolMgr.h b/src/Qtx/QtxActionToolMgr.h index 56adc04d2..be8bda268 100644 --- a/src/Qtx/QtxActionToolMgr.h +++ b/src/Qtx/QtxActionToolMgr.h @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxActionToolMgr.h -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV #ifndef QTXACTIONTOOLMGR_H #define QTXACTIONTOOLMGR_H diff --git a/src/Qtx/QtxColorButton.cxx b/src/Qtx/QtxColorButton.cxx index 24c4c5b5d..31bf651f1 100644 --- a/src/Qtx/QtxColorButton.cxx +++ b/src/Qtx/QtxColorButton.cxx @@ -30,6 +30,21 @@ #include #include +/*! + \class QtxColorButton + \brief The QtxColorButton class implements a widget for color + preference items editing. + + The color preference item is represented as the colored button, + clicking on which invokes the standard "Select color" dialog box. + + Initial color value can be set with setColor() method. Currently + chosen color can be retrieved with color() method. +*/ + +/*! + \brief +*/ QtxColorButton::QtxColorButton( QWidget* parent ) : QToolButton( parent ) { @@ -74,15 +89,24 @@ QtxColorButton::QtxColorButton( QWidget* parent ) connect( this, SIGNAL( clicked( bool ) ), this, SLOT( onClicked( bool ) ) ); } +/*! + \brief +*/ QtxColorButton::~QtxColorButton() { } +/*! + \brief +*/ QColor QtxColorButton::color() const { return myColors.contains( this ) ? myColors[this] : QColor(); } +/*! + \brief +*/ void QtxColorButton::setColor( const QColor& c ) { myColors.insert( this, c ); @@ -90,11 +114,17 @@ void QtxColorButton::setColor( const QColor& c ) updateState(); } +/*! + \brief +*/ void QtxColorButton::onClicked( bool ) { emit clicked( color() ); } +/*! + \brief +*/ void QtxColorButton::onToggled( bool on ) { const QToolButton* tb = ::qobject_cast( sender() ); @@ -118,6 +148,9 @@ void QtxColorButton::onToggled( bool on ) emit changed( color() ); } +/*! + \brief +*/ void QtxColorButton::onDialogClicked( bool ) { QColor c = QColorDialog::getColor( color(), this ); @@ -132,6 +165,9 @@ void QtxColorButton::onDialogClicked( bool ) emit changed( color() ); } +/*! + \brief +*/ void QtxColorButton::paintEvent( QPaintEvent* e ) { QToolButton::paintEvent( e ); @@ -157,6 +193,9 @@ void QtxColorButton::paintEvent( QPaintEvent* e ) p.end(); } +/*! + \brief +*/ void QtxColorButton::updateState() { QColor c = color().toRgb(); @@ -175,6 +214,9 @@ void QtxColorButton::updateState() } } +/*! + \brief +*/ void QtxColorButton::updateButton( QToolButton* btn ) { btn->setIcon( buttonIcon( myColors[btn] ) ); @@ -198,6 +240,9 @@ QPixmap QtxColorButton::buttonIcon( const QColor& c ) const return pix; } +/*! + \brief +*/ void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const int m ) const { if ( !pd ) @@ -210,6 +255,9 @@ void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const int m ) p.end(); } +/*! + \brief +*/ QList QtxColorButton::colorsList() const { QList lst; diff --git a/src/Qtx/QtxDialog.h b/src/Qtx/QtxDialog.h index c77d0fa08..86006f547 100755 --- a/src/Qtx/QtxDialog.h +++ b/src/Qtx/QtxDialog.h @@ -16,7 +16,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: QtxDialog.hxx +// File: QtxDialog.h // Author: Sergey TELKOV #ifndef QTXDIALOG_H diff --git a/src/Qtx/QtxDockAction.h b/src/Qtx/QtxDockAction.h index f6ee3313f..293e3351d 100755 --- a/src/Qtx/QtxDockAction.h +++ b/src/Qtx/QtxDockAction.h @@ -19,8 +19,8 @@ // File: QtxDockAction.h // Author: Sergey TELKOV -#ifndef QTX_DOCKACTION_H -#define QTX_DOCKACTION_H +#ifndef QTXDOCKACTION_H +#define QTXDOCKACTION_H #include "QtxAction.h" @@ -81,4 +81,4 @@ private: #pragma warning( default:4251 ) #endif -#endif // QTX_DOCKACTION_H +#endif // QTXDOCKACTION_H diff --git a/src/Qtx/QtxDockWidget.h b/src/Qtx/QtxDockWidget.h index ed7cb25e9..f94756ebf 100644 --- a/src/Qtx/QtxDockWidget.h +++ b/src/Qtx/QtxDockWidget.h @@ -19,6 +19,9 @@ // File: QtxDockWidget.h // Author: Sergey TELKOV +#ifndef QTXDOCKWIDGET_H +#define QTXDOCKWIDGET_H + #include "Qtx.h" #include @@ -56,3 +59,5 @@ private: Watcher* myWatcher; //!< watcher object Qt::Orientation myOrientation; //!< dockable window orientation }; + +#endif // QTXDOCKWIDGET_H diff --git a/src/Qtx/QtxEvalExpr.cxx b/src/Qtx/QtxEvalExpr.cxx index d16abdc62..f74e17f8a 100644 --- a/src/Qtx/QtxEvalExpr.cxx +++ b/src/Qtx/QtxEvalExpr.cxx @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxEvalExpr.cxx +// Author: Alexander SOLOVYOV, Sergey TELKOV #include "QtxEvalExpr.h" diff --git a/src/Qtx/QtxEvalExpr.h b/src/Qtx/QtxEvalExpr.h index 70f1ce6c3..34acd4747 100644 --- a/src/Qtx/QtxEvalExpr.h +++ b/src/Qtx/QtxEvalExpr.h @@ -17,10 +17,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxEvalExpr.h -// Author: Alexander SOLOVYOV +// Author: Alexander SOLOVYOV, Sergey TELKOV -#ifndef QTX_EVALEXPR_H -#define QTX_EVALEXPR_H +#ifndef QTXEVALEXPR_H +#define QTXEVALEXPR_H #include "Qtx.h" @@ -321,4 +321,4 @@ public: virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const; }; -#endif +#endif // QTXEVALEXPR_H diff --git a/src/Qtx/QtxFontEdit.h b/src/Qtx/QtxFontEdit.h index b851ce9f1..7db64f34f 100644 --- a/src/Qtx/QtxFontEdit.h +++ b/src/Qtx/QtxFontEdit.h @@ -19,8 +19,8 @@ // File: QtxFontEdit.h // Author: Sergey TELKOV -#ifndef QtxFontEdit_H -#define QtxFontEdit_H +#ifndef QTXFONTEDIT_H +#define QTXFONTEDIT_H #include "Qtx.h" @@ -80,4 +80,4 @@ private: QToolButton *myB, *myI, *myU; }; -#endif +#endif // QTXFONTEDIT_H diff --git a/src/Qtx/QtxListAction.h b/src/Qtx/QtxListAction.h index 1ec4c31e3..182698551 100755 --- a/src/Qtx/QtxListAction.h +++ b/src/Qtx/QtxListAction.h @@ -16,8 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: QtxListAction.hxx -// Author: Sergey TELKOV (Based on code by Eugene AKSENOV) +// File: QtxListAction.h +// Author: Sergey TELKOV #ifndef QTXLISTACTION_H #define QTXLISTACTION_H diff --git a/src/Qtx/QtxListView.cxx b/src/Qtx/QtxListView.cxx index 92af7e34c..9abe06497 100755 --- a/src/Qtx/QtxListView.cxx +++ b/src/Qtx/QtxListView.cxx @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxListView.cxx +// Author: Sergey TELKOV #include "QtxListView.h" diff --git a/src/Qtx/QtxListView.h b/src/Qtx/QtxListView.h index 76aa63a05..f79411249 100755 --- a/src/Qtx/QtxListView.h +++ b/src/Qtx/QtxListView.h @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxListView.h +// Author: Sergey TELKOV #ifndef QTXLISTVIEW_H #define QTXLISTVIEW_H diff --git a/src/Qtx/QtxLogoMgr.cxx b/src/Qtx/QtxLogoMgr.cxx index b5bd38895..e04d32fdf 100644 --- a/src/Qtx/QtxLogoMgr.cxx +++ b/src/Qtx/QtxLogoMgr.cxx @@ -16,6 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxLogoMgr.cxx +// Author: Sergey TELKOV + #include "QtxLogoMgr.h" #include diff --git a/src/Qtx/QtxLogoMgr.h b/src/Qtx/QtxLogoMgr.h index 6e8d521cd..73b49ee5a 100644 --- a/src/Qtx/QtxLogoMgr.h +++ b/src/Qtx/QtxLogoMgr.h @@ -16,8 +16,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef QTX_LOGOMGR_H -#define QTX_LOGOMGR_H +// File: QtxLogoMgr.h +// Author: Sergey TELKOV + +#ifndef QTXLOGOMGR_H +#define QTXLOGOMGR_H #include "Qtx.h" @@ -74,4 +77,4 @@ private: #pragma warning( default : 4251 ) #endif -#endif +#endif // QTXLOGOMGR_H diff --git a/src/Qtx/QtxMap.h b/src/Qtx/QtxMap.h index 2030b9e98..403fc3284 100644 --- a/src/Qtx/QtxMap.h +++ b/src/Qtx/QtxMap.h @@ -19,8 +19,8 @@ // File: QtxMap.h // Author: Vadim SANDLER -#ifndef QTX_MAP_H -#define QTX_MAP_H +#ifndef QTXMAP_H +#define QTXMAP_H template class IMap; template class IMapIterator; @@ -207,4 +207,4 @@ private: friend class IMap; }; -#endif // QTX_MAP_H +#endif // QTXMAP_H diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index 897ef71f1..7ce6dfcff 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -1127,7 +1127,7 @@ int QtxPagePrefEditItem::inputType() const return myType; } -void QtxPagePrefEditItem::setInputType( const type ) +void QtxPagePrefEditItem::setInputType( const int type ) { if ( myType == type ) return; @@ -1190,7 +1190,8 @@ void QtxPagePrefEditItem::updateEditor() if ( !myEditor->text().isEmpty() && val ) { int pos = 0; - if ( val->validate( myEditor->text(), pos ) == QValidator::Invalid ) + QString str = myEditor->text(); + if ( val->validate( str, pos ) == QValidator::Invalid ) myEditor->clear(); } @@ -1232,7 +1233,7 @@ int QtxPagePrefSelectItem::inputType() const return myType; } -void QtxPagePrefSelectItem::setInputType( const type ) +void QtxPagePrefSelectItem::setInputType( const int type ) { if ( myType == type ) return; @@ -1398,7 +1399,8 @@ void QtxPagePrefSelectItem::updateSelector() if ( mySelector->isEditable() && !mySelector->currentText().isEmpty() && val ) { int pos = 0; - if ( val->validate( mySelector->currentText(), pos ) == QValidator::Invalid ) + QString str = mySelector->currentText(); + if ( val->validate( str, pos ) == QValidator::Invalid ) mySelector->clearEditText(); } @@ -1436,7 +1438,7 @@ int QtxPagePrefSpinItem::inputType() const return myType; } -void QtxPagePrefSpinItem::setInputType( const type ) +void QtxPagePrefSpinItem::setInputType( const int type ) { if ( myType == type ) return; diff --git a/src/Qtx/QtxPagePrefMgr.h b/src/Qtx/QtxPagePrefMgr.h index aa8c0f95b..b83998070 100644 --- a/src/Qtx/QtxPagePrefMgr.h +++ b/src/Qtx/QtxPagePrefMgr.h @@ -374,7 +374,7 @@ public: virtual ~QtxPagePrefEditItem(); int inputType() const; - void setInputType( const type ); + void setInputType( const int ); virtual void store(); virtual void retrieve(); @@ -409,7 +409,7 @@ public: virtual ~QtxPagePrefSelectItem(); int inputType() const; - void setInputType( const type ); + void setInputType( const int ); QStringList strings() const; QList numbers() const; @@ -467,7 +467,7 @@ public: void setSpecialValueText( const QString& ); int inputType() const; - void setInputType( const type ); + void setInputType( const int ); virtual void store(); virtual void retrieve(); diff --git a/src/Qtx/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx index 5766eff74..64b356073 100644 --- a/src/Qtx/QtxPathListEdit.cxx +++ b/src/Qtx/QtxPathListEdit.cxx @@ -16,6 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxPathListEdit.cxx +// Author: Sergey TELKOV + #include "QtxPathListEdit.h" #include "QtxPathEdit.h" diff --git a/src/Qtx/QtxPathListEdit.h b/src/Qtx/QtxPathListEdit.h index 2cb7f81af..10d4dbe33 100644 --- a/src/Qtx/QtxPathListEdit.h +++ b/src/Qtx/QtxPathListEdit.h @@ -16,8 +16,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef QTX_PATHLISTEDIT_H -#define QTX_PATHLISTEDIT_H +// File: QtxPathListEdit.h +// Author: Sergey TELKOV + +#ifndef QTXPATHLISTEDIT_H +#define QTXPATHLISTEDIT_H #include "Qtx.h" @@ -87,4 +90,4 @@ private: friend class QtxPathListEdit::Delegate; }; -#endif +#endif // QTXPATHLISTEDIT_H diff --git a/src/Qtx/QtxPopupMenu.cxx b/src/Qtx/QtxPopupMenu.cxx index 8a1a4e458..b4141deee 100644 --- a/src/Qtx/QtxPopupMenu.cxx +++ b/src/Qtx/QtxPopupMenu.cxx @@ -16,6 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxPopupMenu.cxx +// Author: Sergey TELKOV + #include "QtxPopupMenu.h" #include diff --git a/src/Qtx/QtxPopupMenu.h b/src/Qtx/QtxPopupMenu.h index 01dd27041..235989a73 100644 --- a/src/Qtx/QtxPopupMenu.h +++ b/src/Qtx/QtxPopupMenu.h @@ -16,6 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxPopupMenu.h +// Author: Sergey TELKOV + #ifndef QTXPOPUPMENU_H #define QTXPOPUPMENU_H @@ -71,4 +74,4 @@ private: int myPolicy; }; -#endif +#endif // QTXPOPUPMENU_H diff --git a/src/Qtx/QtxPopupMgr.cxx b/src/Qtx/QtxPopupMgr.cxx index d2f9be088..3efd99ae1 100644 --- a/src/Qtx/QtxPopupMgr.cxx +++ b/src/Qtx/QtxPopupMgr.cxx @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxPopupMgr.cxx +// Author: Alexander SOLOVYOV, Sergey TELKOV #include "QtxPopupMgr.h" #include "QtxAction.h" diff --git a/src/Qtx/QtxPopupMgr.h b/src/Qtx/QtxPopupMgr.h index 388410842..2dbea1280 100644 --- a/src/Qtx/QtxPopupMgr.h +++ b/src/Qtx/QtxPopupMgr.h @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxPopupMgr.h +// Author: Alexander SOLOVYOV, Sergey TELKOV #ifndef QTXPOPUPMGR_H #define QTXPOPUPMGR_H @@ -121,4 +123,4 @@ private: OptionsMap myOptions; }; -#endif +#endif // QTXPOPUPMGR_H diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index 70a27527a..2741e8352 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -16,6 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: QtxResourceMgr.cxx +// Author: Alexander SOLOVYOV, Sergey TELKOV + #include "QtxResourceMgr.h" #include diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index 6508fc95a..b70caa2c5 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -17,10 +17,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: QtxResourceMgr.h -// Author: Alexander SOLOVYEV, Sergey TELKOV +// Author: Alexander SOLOVYOV, Sergey TELKOV -#ifndef QTX_RESOURCEMGR_H -#define QTX_RESOURCEMGR_H +#ifndef QTXRESOURCEMGR_H +#define QTXRESOURCEMGR_H #include "Qtx.h" @@ -201,4 +201,4 @@ private: QMap myOpt; //!< options map }; -#endif // QTX_RESOURCEMGR_H +#endif // QTXRESOURCEMGR_H diff --git a/src/Qtx/QtxTable.h b/src/Qtx/QtxTable.h index b7175d08e..7af602210 100644 --- a/src/Qtx/QtxTable.h +++ b/src/Qtx/QtxTable.h @@ -19,8 +19,8 @@ // File: QtxTable.h // Author: Sergey TELKOV -#ifndef QTX_TABLE_H -#define QTX_TABLE_H +#ifndef QTXTABLE_H +#define QTXTABLE_H #include "Qtx.h" @@ -85,4 +85,4 @@ private: #endif -#endif +#endif // QTXTABLE_H diff --git a/src/Qtx/QtxToolBar.cxx b/src/Qtx/QtxToolBar.cxx index af3b3c3c8..edbf469e0 100644 --- a/src/Qtx/QtxToolBar.cxx +++ b/src/Qtx/QtxToolBar.cxx @@ -259,6 +259,7 @@ QtxToolBar::QtxToolBar( const bool watch, const QString& label, QWidget* parent { if ( watch ) myWatcher = new Watcher( this ); + setObjectName( label ); } /*! @@ -271,6 +272,7 @@ QtxToolBar::QtxToolBar( const QString& label, QWidget* parent ) myWatcher( 0 ), myStretch( false ) { + setObjectName( label ); } /*! diff --git a/src/Qtx/QtxToolBar.h b/src/Qtx/QtxToolBar.h index 7d0918fcf..8e520d715 100644 --- a/src/Qtx/QtxToolBar.h +++ b/src/Qtx/QtxToolBar.h @@ -19,6 +19,9 @@ // File: QtxToolBar.h // Author: Sergey TELKOV +#ifndef QTXTOOLBAR_H +#define QTXTOOLBAR_H + #include "Qtx.h" #include @@ -48,3 +51,5 @@ private: Watcher* myWatcher; //!< watcher object bool myStretch; //!< stretching toolbar flag (not used) }; + +#endif // QTXTOOLBAR_H diff --git a/src/Qtx/QtxValidator.h b/src/Qtx/QtxValidator.h index ca5b6121f..b6a6103a0 100644 --- a/src/Qtx/QtxValidator.h +++ b/src/Qtx/QtxValidator.h @@ -19,8 +19,8 @@ // File: QtxValidator.h // Author: Alexandre SOLOVYOV -#ifndef QTX_VALIDATOR_H -#define QTX_VALIDATOR_H +#ifndef QTXVALIDATOR_H +#define QTXVALIDATOR_H #include "Qtx.h" @@ -50,4 +50,4 @@ public: virtual void fixup( QString& ) const; }; -#endif +#endif // QTXVALIDATOR_H diff --git a/src/SUIT/Makefile.am b/src/SUIT/Makefile.am index 32ab09def..55898ef11 100755 --- a/src/SUIT/Makefile.am +++ b/src/SUIT/Makefile.am @@ -42,6 +42,7 @@ salomeinclude_HEADERS= \ SUIT_Operation.h \ SUIT_OverrideCursor.h \ SUIT_PopupClient.h \ + SUIT_PreferenceMgr.h \ SUIT_ResourceMgr.h \ SUIT_SelectionFilter.h \ SUIT_SelectionMgr.h \ @@ -72,6 +73,7 @@ dist_libsuit_la_SOURCES= \ SUIT_Operation.cxx \ SUIT_OverrideCursor.cxx \ SUIT_PopupClient.cxx \ + SUIT_PreferenceMgr.cxx \ SUIT_ResourceMgr.cxx \ SUIT_SelectionFilter.cxx \ SUIT_SelectionMgr.cxx \ @@ -93,6 +95,7 @@ MOC_FILES= \ SUIT_FileDlg_moc.cxx \ SUIT_Operation_moc.cxx \ SUIT_PopupClient_moc.cxx \ + SUIT_PreferenceMgr_moc.cxx \ SUIT_SelectionMgr_moc.cxx \ SUIT_Selector_moc.cxx \ SUIT_Session_moc.cxx \ diff --git a/src/SUIT/SUIT_PreferenceMgr.cxx b/src/SUIT/SUIT_PreferenceMgr.cxx index 1db3fc6a8..04dbffda2 100644 --- a/src/SUIT/SUIT_PreferenceMgr.cxx +++ b/src/SUIT/SUIT_PreferenceMgr.cxx @@ -62,7 +62,7 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId, parent = findItem( pId ); if ( !parent ) - parent = new QtxPagePrefListItem( QString(), this ); + parent = new QtxPagePrefListItem( QString( "Root" ), this ); switch( type ) {