From: vsr Date: Mon, 21 May 2007 13:40:11 +0000 (+0000) Subject: Porting to Qt 4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b23b155a70f576b0db80c4c752bbec0ca94dba39;p=modules%2Fgui.git Porting to Qt 4 --- diff --git a/src/CAF/CAF.h b/src/CAF/CAF.h index 0a0131936..ed6a8ea24 100755 --- a/src/CAF/CAF.h +++ b/src/CAF/CAF.h @@ -19,18 +19,14 @@ #ifndef CAF_H #define CAF_H -#if defined CAF_EXPORTS #if defined WIN32 -#define CAF_EXPORT __declspec( dllexport ) +# if defined CAF_EXPORTS +# define CAF_EXPORT __declspec( dllexport ) +# else +# define CAF_EXPORT __declspec( dllimport ) +# endif #else -#define CAF_EXPORT -#endif -#else -#if defined WIN32 -#define CAF_EXPORT __declspec( dllimport ) -#else -#define CAF_EXPORT -#endif +# define CAF_EXPORT #endif #if defined SOLARIS diff --git a/src/CAF/CAF.pro b/src/CAF/CAF.pro new file mode 100644 index 000000000..0c7313d32 --- /dev/null +++ b/src/CAF/CAF.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +TARGET = caf +DESTDIR = ../../lib +MOC_DIR = ../../moc +OBJECTS_DIR = ../../obj/$$TARGET + +INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD +LIBS += -L../../lib -lqtx -lsuit -lstd + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += CAF_EXPORTS + +HEADERS = CAF.h +HEADERS += CAF_Application.h +HEADERS += CAF_Operation.h +HEADERS += CAF_Study.h +HEADERS += CAF_Tools.h + +SOURCES = CAF_Application.cxx +SOURCES += CAF_Operation.cxx +SOURCES += CAF_Study.cxx +SOURCES += CAF_Tools.cxx + +TRANSLATIONS = resources/CAF_images.ts \ + resources/CAF_msg_en.ts + +ICONS = resources/*.png + +includes.files = $$HEADERS +includes.path = ../../include + +resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini +resources.path = ../../resources + +INSTALLS += includes resources diff --git a/src/CAF/CAF_Application.cxx b/src/CAF/CAF_Application.cxx index 78bc1d566..5a921a7d3 100755 --- a/src/CAF/CAF_Application.cxx +++ b/src/CAF/CAF_Application.cxx @@ -22,31 +22,41 @@ #include "CAF_Study.h" #include -#include -#include -#include +//#include +//#include +//#include #include #include -#include +#include +//#include -#include -#include -#include -#include -#include +#include +#include #include - #include +/*! + \brief Create new instance of CAF_Application. + \return new instance of CAF_Application class +*/ extern "C" CAF_EXPORT SUIT_Application* createApplication() { return new CAF_Application(); } /*! - Default constructor + \class CAF_Application + \brief OCC OCAF-based application. + + Defines application configuration and behaviour for application using + standard OCC OCAF data model. Allows using OCC OCAF serives + (for example, undo/redo mechanizm). +*/ + +/*! + \brief Default constructor. */ CAF_Application::CAF_Application() : STD_Application() @@ -54,23 +64,24 @@ CAF_Application::CAF_Application() } /*! - Constructor with OCAF application - \param app - OCAF application + \brief Constructor. + \param app OCAF application */ CAF_Application::CAF_Application( const Handle( TDocStd_Application )& app ) : STD_Application(), -myStdApp( app ) + myStdApp( app ) { } /*! - Destructor + \brief Destructor. */ CAF_Application::~CAF_Application() { } /*! + \brief Get application name. \return application name */ QString CAF_Application::applicationName() const @@ -79,7 +90,8 @@ QString CAF_Application::applicationName() const } /*! - \return OCAF application + \brief Get OCAF application. + \return handle to OCAF application object */ Handle( TDocStd_Application ) CAF_Application::stdApp() const { @@ -87,7 +99,11 @@ Handle( TDocStd_Application ) CAF_Application::stdApp() const } /*! - \return file filters for open/save document + \brief Get file extension filter. + + The file extension filter is used in Open/Save dialog boxes. + + \return file filters for open/save document dialog box */ QString CAF_Application::getFileFilter() const { @@ -104,13 +120,13 @@ QString CAF_Application::getFileFilter() const { QString extension; QString extResStr = CAF_Tools::toQString( formats.Value( i ) ) + QString( ".FileExtension" ); - if ( resMgr->Find( (char*)extResStr.latin1() ) ) - extension = QString( resMgr->Value( (char*)extResStr.latin1() ) ); + if ( resMgr->Find( extResStr.toLatin1().data() ) ) + extension = QString( resMgr->Value( extResStr.toLatin1().data() ) ); QString descr; QString descrResStr = CAF_Tools::toQString( formats.Value( i ) ) + QString( ".Description" ); - if ( resMgr->Find( (char*)descrResStr.latin1() ) ) - descr = QString( resMgr->Value( (char*)descrResStr.latin1() ) ); + if ( resMgr->Find( (char*)descrResStr.toLatin1().data() ) ) + descr = QString( resMgr->Value( (char*)descrResStr.toLatin1().data() ) ); if ( !descr.isEmpty() && !extension.isEmpty() ) { @@ -126,7 +142,7 @@ QString CAF_Application::getFileFilter() const QStringList filters; for ( QMap::ConstIterator it = wildCards.begin(); it != wildCards.end(); ++it ) - filters.append( QString( "%1 (%2)" ).arg( it.key() ).arg( it.data().join( "; " ) ) ); + filters.append( QString( "%1 (%2)" ).arg( it.key() ).arg( it.value().join( "; " ) ) ); if ( wildCards.count() > 1 ) filters.prepend( QString( "%1 (%2)" ).arg( tr( "INF_ALL_DOCUMENTS_FILTER" ) ).arg( allWC.join( "; " ) ) ); @@ -138,7 +154,7 @@ QString CAF_Application::getFileFilter() const } /*! - Creates actions of application + \brief Create menu and toolbars actions. */ void CAF_Application::createActions() { @@ -146,40 +162,48 @@ void CAF_Application::createActions() SUIT_Desktop* desk = desktop(); SUIT_ResourceMgr* resMgr = resourceMgr(); - + /* QtxListAction* editUndo = new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ), resMgr->loadPixmap( "CAF", tr( "ICON_APP_EDIT_UNDO" ) ), tr( "MEN_APP_EDIT_UNDO" ), CTRL+Key_Z, desk ); registerAction( EditUndoId, editUndo ); - + */ + /* QtxListAction* editRedo = new QtxListAction( tr( "TOT_APP_EDIT_REDO" ), resMgr->loadPixmap( "CAF", tr( "ICON_APP_EDIT_REDO" ) ), tr( "MEN_APP_EDIT_REDO" ), CTRL+Key_Y, desk ); registerAction( EditRedoId, editRedo ); - + */ + /* editUndo->setComment( tr( "INF_APP_UNDOACTIONS" ) ); editRedo->setComment( tr( "INF_APP_REDOACTIONS" ) ); connect( editUndo, SIGNAL( activated( int ) ), this, SLOT( onUndo( int ) ) ); connect( editRedo, SIGNAL( activated( int ) ), this, SLOT( onRedo( int ) ) ); - + */ int editMenu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1, 10 ); + /* createMenu( EditUndoId, editMenu, 0 ); createMenu( EditRedoId, editMenu, 0 ); + */ createMenu( separator(), editMenu, -1, 0 ); int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ) ); createTool( separator(), stdTBar ); + /* createTool( EditUndoId, stdTBar ); createTool( EditRedoId, stdTBar ); + */ createTool( separator(), stdTBar ); } /*! - Undo operation on the given document. [ virtual protected ] + \brief Undo latest command operation for specified document. + \param doc OCAF document + \return \c true on success */ bool CAF_Application::undo( CAF_Study* doc ) { @@ -193,7 +217,9 @@ bool CAF_Application::undo( CAF_Study* doc ) } /*! - Redo operation on the given document. [ virtual protected ] + \brief Redo latest command operation undo for specified document. + \param doc OCAF document + \return \c true on success */ bool CAF_Application::redo(CAF_Study* doc) { @@ -207,57 +233,67 @@ bool CAF_Application::redo(CAF_Study* doc) } /*! - Undo operation on the active document. [ virtual protected slot ] + \brief Called when user activates "Undo" menu action. + + Undo operation on the active document. + + \param numActions undo depth (number of commands) + \return \c true on success */ bool CAF_Application::onUndo( int numActions ) { bool ok = true; while ( numActions > 0 ) { - CAF_Study* cafStudy = dynamic_cast( activeStudy() ); - if ( cafStudy ) + CAF_Study* cafStudy = dynamic_cast( activeStudy() ); + if ( cafStudy ) { - if ( !undo( cafStudy ) ) - { - ok = false; - break; - } - numActions--; - } + if ( !undo( cafStudy ) ) + { + ok = false; + break; + } + numActions--; + } } updateCommandsStatus(); /* enable/disable undo/redo */ return ok; } /*! - Redo operation on the active document. [ virtual protected slot ] + \brief Called when user activates "Redo" menu action. + + Redo latest undo commands on the active document. + + \param numActions redo depth (number of commands) + \return \c true on success */ bool CAF_Application::onRedo( int numActions ) { bool ok = true; while ( numActions > 0 ) { - CAF_Study* cafStudy = dynamic_cast( activeStudy() ); - if ( cafStudy ) + CAF_Study* cafStudy = dynamic_cast( activeStudy() ); + if ( cafStudy ) { - if ( !redo( cafStudy ) ) - { - ok = false; - break; - } - numActions--; - } + if ( !redo( cafStudy ) ) + { + ok = false; + break; + } + numActions--; + } } updateCommandsStatus(); /* enable/disable undo/redo */ return ok; } /*! - Enables / disables the actions according to the application state. [ virtual protected ] + \brief Update actions state (Undo/Redo). */ void CAF_Application::updateCommandsStatus() { - STD_Application::updateCommandsStatus(); + STD_Application::updateCommandsStatus(); CAF_Study* cafStudy = 0; if ( activeStudy() && activeStudy()->inherits( "CAF_Study" ) ) @@ -278,7 +314,7 @@ void CAF_Application::updateCommandsStatus() } /*! - SLOT: called by clicking on Help->About in main menu + \brie Called when user activatees Help->About main menu command. */ void CAF_Application::onHelpAbout() { @@ -286,7 +322,8 @@ void CAF_Application::onHelpAbout() } /*! - Creates new study + \brief Create new empty study. + \return new study */ SUIT_Study* CAF_Application::createNewStudy() { @@ -294,7 +331,8 @@ SUIT_Study* CAF_Application::createNewStudy() } /*! - Sets OCAF application + \brief Set OCAF application. + \param app new OCAF application */ void CAF_Application::setStdApp( const Handle(TDocStd_Application)& app ) { diff --git a/src/CAF/CAF_Application.h b/src/CAF/CAF_Application.h index 81a16413d..176293995 100755 --- a/src/CAF/CAF_Application.h +++ b/src/CAF/CAF_Application.h @@ -23,24 +23,14 @@ #include "STD_Application.h" -#include -#include - #include -class QtxAction; class CAF_Study; #if defined WIN32 #pragma warning ( disable: 4251 ) #endif -/*! - \class CAF_Application - Defines application configuration and behaviour for application with - link to standard OCC OCAF data model. Allows to use OCC OCAF serives - (for example, undo/redo) -*/ class CAF_EXPORT CAF_Application : public STD_Application { Q_OBJECT @@ -72,8 +62,8 @@ protected: virtual SUIT_Study* createNewStudy(); - bool undo( CAF_Study* doc ); - bool redo( CAF_Study* doc ); + bool undo( CAF_Study* doc ); + bool redo( CAF_Study* doc ); virtual void setStdApp( const Handle(TDocStd_Application)& ); diff --git a/src/CAF/CAF_Operation.cxx b/src/CAF/CAF_Operation.cxx index 67fd2785f..0b9e3c752 100755 --- a/src/CAF/CAF_Operation.cxx +++ b/src/CAF/CAF_Operation.cxx @@ -24,27 +24,36 @@ #include /*! - Default constructor + \class CAF_Operation + \brief Base operation class for all operations used in CAF package. + + Operation interacts with OCC OCAF std document. +*/ + +/*! + \brief Constructor. + \param theApp application */ CAF_Operation::CAF_Operation(SUIT_Application* theApp) -:SUIT_Operation(theApp) +: SUIT_Operation(theApp) { } /*! - Destructor + \brief Destructor. */ CAF_Operation::~CAF_Operation() { } /*! - \return OCAF document + \brief Get OCAF document. + \return handle to the OCAF document object */ Handle(TDocStd_Document) CAF_Operation::stdDoc() const { Handle(TDocStd_Document) doc; - CAF_Study* s = ::qt_cast( study() ); + CAF_Study* s = qobject_cast( study() ); if ( s ) doc = s->stdDoc(); return doc; diff --git a/src/CAF/CAF_Operation.h b/src/CAF/CAF_Operation.h index d6ae43694..15bd54070 100755 --- a/src/CAF/CAF_Operation.h +++ b/src/CAF/CAF_Operation.h @@ -23,27 +23,18 @@ #include "SUIT_Operation.h" -#include -#include - #include class CAF_Study; -//! OCC OCAF Std document class Handle(TDocStd_Document); -/*! - \class CAF_Operation - Base operation for all operations used in CAF package - Operation has link to OCC OCAF std document -*/ class CAF_EXPORT CAF_Operation : public SUIT_Operation { - Q_OBJECT + Q_OBJECT public: - CAF_Operation( SUIT_Application* ); - virtual ~CAF_Operation(); + CAF_Operation( SUIT_Application* ); + virtual ~CAF_Operation(); protected: Handle(TDocStd_Document) stdDoc() const; diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index 79d0da098..706597b48 100755 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -19,49 +19,61 @@ #include "CAF_Study.h" #include "CAF_Tools.h" -#include "CAF_Operation.h" #include "CAF_Application.h" #include #include #include -#include +#include #include #include +#include #include #include /*! - Constructor + \class CAF_Study + \brief Represents study for using in CAF module. + + A study contains reference to OCAF std document and allows using OCAF services. + Provides necessary functionality for OCC transactions management. +*/ + +/*! + \brief Constructor. + \param theApp application */ CAF_Study::CAF_Study(SUIT_Application* theApp) : SUIT_Study( theApp ), -myModifiedCnt( 0 ) + myModifiedCnt( 0 ) { } /*! - Constructor + \brief Constructor. + \param theApp application + \param aStdDoc OCAF document */ CAF_Study::CAF_Study(SUIT_Application* theApp, Handle (TDocStd_Document)& aStdDoc) : SUIT_Study( theApp ), -myStdDoc( aStdDoc ), -myModifiedCnt( 0 ) + myStdDoc( aStdDoc ), + myModifiedCnt( 0 ) { } /*! - Destructor + \brief Destructor. */ CAF_Study::~CAF_Study() { } /*! - \return OCAF document + \brief Get OCAF document. + \return handle to the OCAF document object */ Handle(TDocStd_Document) CAF_Study::stdDoc() const { @@ -69,8 +81,8 @@ Handle(TDocStd_Document) CAF_Study::stdDoc() const } /*! - Sets new OCAF document - \param aStdDoc - new OCAF document + \brief Set OCAF document. + \param aStdDoc new OCAF document */ void CAF_Study::setStdDoc( Handle(TDocStd_Document)& aStdDoc ) { @@ -78,14 +90,16 @@ void CAF_Study::setStdDoc( Handle(TDocStd_Document)& aStdDoc ) } /*! - Custom document initialization + \brief Customize document initialization. + \param doc study name + \return \c true on success and \c false on error */ -void CAF_Study::createDocument() +bool CAF_Study::createDocument( const QString& doc ) { - SUIT_Study::createDocument(); + bool res = SUIT_Study::createDocument( doc ); CAF_Application* app = cafApplication(); - if ( app && !app->stdApp().IsNull() ) + if ( res && app && !app->stdApp().IsNull() ) { try { #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 @@ -97,25 +111,29 @@ void CAF_Study::createDocument() app->stdApp()->NewDocument( formats.First(), myStdDoc ); } catch ( Standard_Failure ) { + res = false; } } + return res; } /*! - Close document + \brief Close document. + \param permanently if \c true, a document is closed permanently */ -void CAF_Study::closeDocument( bool permanent ) +void CAF_Study::closeDocument( bool permanently ) { Handle(TDocStd_Application) app = stdApp(); if ( !app.IsNull() && !stdDoc().IsNull() ) app->Close( stdDoc() ); - SUIT_Study::closeDocument( permanent ); + SUIT_Study::closeDocument( permanently ); } /*! - Open document - \param fname - name of file + \brief Open document. + \param fname study file name + \return \c true on success and \c false if document cannot be opened */ bool CAF_Study::openDocument( const QString& fname ) { @@ -138,8 +156,8 @@ bool CAF_Study::openDocument( const QString& fname ) } /*! - Save document with other name - \param fname - name of file + \brief Save document with other name. + \param fname study file name */ bool CAF_Study::saveDocumentAs( const QString& fname ) { @@ -186,7 +204,8 @@ bool CAF_Study::saveDocumentAs( const QString& fname ) } /*! - Open OCAF transaction + \brief Open OCAF transaction. + \return \c true if transaction is opened successfully */ bool CAF_Study::openTransaction() { @@ -211,7 +230,8 @@ bool CAF_Study::openTransaction() } /*! - Abort OCAF transaction + \brief Abort OCAF transaction. + \return \c true if transaction is aborted successfully */ bool CAF_Study::abortTransaction() { @@ -233,7 +253,8 @@ bool CAF_Study::abortTransaction() } /*! - Commit OCAF transaction + \brief Commit OCAF transaction + \return \c true if transaction is committed successfully */ bool CAF_Study::commitTransaction( const QString& name ) { @@ -261,7 +282,8 @@ bool CAF_Study::commitTransaction( const QString& name ) } /*! - \return true, if there is opened OCAF transaction + \brief Check if there is any transaction opened. + \return \c true if there is opened OCAF transaction */ bool CAF_Study::hasTransaction() const { @@ -272,7 +294,8 @@ bool CAF_Study::hasTransaction() const } /*! - \return whether the document was saved in file. [ public ] + \brief Check if the study is saved. + \return \c true if the document has been saved to file */ bool CAF_Study::isSaved() const { @@ -283,7 +306,8 @@ bool CAF_Study::isSaved() const } /*! - \return whether the document is modified. [ public ] + \brief Check if the study is modified. + \return \c true if the document has been modified */ bool CAF_Study::isModified() const { @@ -295,24 +319,30 @@ bool CAF_Study::isModified() const } /*! - Increments modification count. If 'undoable' is 'true', this modification - can be rolled back by 'undoModified' otherwise the document will be marked - as 'modiifed' until saved. [ protected ] + \brief Increment modifications count. + + If \a undoable is \c true, this modification can be rolled back by + undoModified(), otherwise the document will be marked as \c modified + until it is saved. + + \param undoable if \c true the operation is undoable + \sa undoModified(), clearModified() */ void CAF_Study::doModified( bool undoable ) { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return; - myModifiedCnt++; + myModifiedCnt++; - /* Assumed that number of available undos / redos is NOT changed dynamically */ - if ( !undoable ) + /* Assumed that number of available undos / redos is NOT changed dynamically */ + if ( !undoable ) myModifiedCnt += myStdDoc->GetAvailableUndos(); } /*! - Decrements modification count. [ protected ] + \brief Decrement modifications count. + \sa doModified(), clearModified() */ void CAF_Study::undoModified() { @@ -320,7 +350,8 @@ void CAF_Study::undoModified() } /*! - Clears modification count. [ public ] + \brief Clear modifications count. + \sa doModified(), undoModified() */ void CAF_Study::clearModified() { @@ -328,7 +359,8 @@ void CAF_Study::clearModified() } /*! - Undoes the last command. [ public ] + \brief Undo the last command. + \return \c true on success and \c false on error */ bool CAF_Study::undo() { @@ -351,7 +383,8 @@ bool CAF_Study::undo() } /*! - Redoes the last undo. [ public ] + \brief Redo the last undo. + \return \c true on success and \c false on error */ bool CAF_Study::redo() { @@ -374,7 +407,8 @@ bool CAF_Study::redo() } /*! - \return true if possible to perform 'undo' command. [ public ] + \brief Check if it is possible to undo last command. + \return \c true if undo is avaiable */ bool CAF_Study::canUndo() const { @@ -385,7 +419,8 @@ bool CAF_Study::canUndo() const } /*! - \return true if possible to perform 'redo' command. [ public ] + \brief Check if it is possible to redo last undo. + \return \c true if redo is avaiable */ bool CAF_Study::canRedo() const { @@ -396,7 +431,8 @@ bool CAF_Study::canRedo() const } /*! - \return the list of names of 'undo' actions available. [ public ] + \brief Get names of available undo commands. + \return list of commands names */ QStringList CAF_Study::undoNames() const { @@ -410,7 +446,8 @@ QStringList CAF_Study::undoNames() const } /*! - \return the list of names of 'redo' actions available. [ public ] + \brief Get names of available redo commands. + \return list of commands names */ QStringList CAF_Study::redoNames() const { @@ -424,7 +461,8 @@ QStringList CAF_Study::redoNames() const } /*! - \return the standard OCAF application from owner application. [ protected ] + \brief Get OCAF application. + \return handle to the OCAF application object */ Handle(TDocStd_Application) CAF_Study::stdApp() const { @@ -436,9 +474,10 @@ Handle(TDocStd_Application) CAF_Study::stdApp() const } /*! - \return the application casted to type CAF_Application. [ protected ] + \brief Get application. + \return application object (CAF_Application) */ CAF_Application* CAF_Study::cafApplication() const { - return ::qt_cast( application() ); + return qobject_cast( application() ); } diff --git a/src/CAF/CAF_Study.h b/src/CAF/CAF_Study.h index 7959d819c..ccde84d35 100755 --- a/src/CAF/CAF_Study.h +++ b/src/CAF/CAF_Study.h @@ -23,51 +23,43 @@ #include "SUIT_Study.h" -#include - #include -#include class CAF_Application; +class Handle(TDocStd_Application); #if defined WIN32 #pragma warning ( disable: 4251 ) #endif -/*! - \class CAF_Study - Represents study for using in CAF, contains reference - to OCAF std document and allows to use OCAF services. - Provides necessary functionality for OCC transactions management. -*/ class CAF_EXPORT CAF_Study : public SUIT_Study { Q_OBJECT public: - CAF_Study( SUIT_Application* theApp ); - CAF_Study( SUIT_Application* theApp, Handle(TDocStd_Document)& aStdDoc ); - virtual ~CAF_Study(); + CAF_Study( SUIT_Application* theApp ); + CAF_Study( SUIT_Application* theApp, Handle(TDocStd_Document)& aStdDoc ); + virtual ~CAF_Study(); - virtual void createDocument(); + virtual bool createDocument( const QString& ); virtual void closeDocument( bool = true ); virtual bool openDocument( const QString& ); virtual bool saveDocumentAs( const QString& ); bool isSaved() const; - bool isModified() const; - void doModified( bool = true ); - void undoModified(); - void clearModified(); - + bool isModified() const; + void doModified( bool = true ); + void undoModified(); + void clearModified(); + bool undo(); - bool redo(); - bool canUndo() const; - bool canRedo() const; - QStringList undoNames() const; - QStringList redoNames() const; - + bool redo(); + bool canUndo() const; + bool canRedo() const; + QStringList undoNames() const; + QStringList redoNames() const; + Handle(TDocStd_Document) stdDoc() const; protected: @@ -82,8 +74,8 @@ protected: virtual void setStdDoc( Handle(TDocStd_Document)& ); private: - Handle(TDocStd_Document) myStdDoc; - int myModifiedCnt; + Handle(TDocStd_Document) myStdDoc; + int myModifiedCnt; friend class CAF_Operation; }; diff --git a/src/CAF/CAF_Tools.cxx b/src/CAF/CAF_Tools.cxx index f637a3e87..138fd3791 100755 --- a/src/CAF/CAF_Tools.cxx +++ b/src/CAF/CAF_Tools.cxx @@ -21,11 +21,15 @@ #include "CAF_Tools.h" -#include -#include +/*! + \class CAF_Tools + \brief Prodives a set of helpful static methods. +*/ /*! - Converts TCollection_ExtendedString 'src' to Qt string. [ static ] + \brief Convert TCollection_ExtendedString \a src to QString. + \param src string to be converted + \return resulting QString object */ QString CAF_Tools::toQString ( const TCollection_ExtendedString& src ) { @@ -33,7 +37,9 @@ QString CAF_Tools::toQString ( const TCollection_ExtendedString& src ) } /*! - Converts TCollection_AsciiString'src' to Qt string. [ static ] + \brief Convert TCollection_AsciiString \a src to QString. + \param src string to be converted + \return resulting QString object */ QString CAF_Tools::toQString( const TCollection_AsciiString& src ) { @@ -41,18 +47,22 @@ QString CAF_Tools::toQString( const TCollection_AsciiString& src ) } /*! - Converts Qt string to TCollection_AsciiString. [ static ] + \brief Convert QString \a src to TCollection_AsciiString. + \param src string to be converted + \return resulting TCollection_AsciiString object */ TCollection_AsciiString CAF_Tools::toAsciiString( const QString& src ) { TCollection_AsciiString res; if ( !src.isEmpty() ) - res = TCollection_AsciiString( (char*)src.latin1() ); + res = TCollection_AsciiString( src.toLatin1().data() ); return res; } /*! - Converts Qt string to TCollection_ExtendedString. [ static ] + \brief Convert QString \a src to TCollection_ExtendedString. + \param src string to be converted + \return resulting TCollection_ExtendedString object */ TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src ) { @@ -63,7 +73,9 @@ TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src ) } /*! - Converts Qt color to OCC color + \brief Convert QColor object to Quantity_Color object. + \param c color object in Qt format + \return color object in OCC format */ Quantity_Color CAF_Tools::color( const QColor& c ) { @@ -75,7 +87,9 @@ Quantity_Color CAF_Tools::color( const QColor& c ) } /*! - Converts OCC color to Qt color + \brief Convert Quantity_Color object to QColor object. + \param c color object in OCC format + \return color object in Qt format */ QColor CAF_Tools::color( const Quantity_Color& c ) { diff --git a/src/CAF/CAF_Tools.h b/src/CAF/CAF_Tools.h index c0183586e..4c0188b9a 100755 --- a/src/CAF/CAF_Tools.h +++ b/src/CAF/CAF_Tools.h @@ -26,17 +26,13 @@ #include -#include +#include #include #include #include -/*! - \class CAF_Tools - Prodives set of auxiliary static methods -*/ class CAF_EXPORT CAF_Tools : public SUIT_Tools { public: diff --git a/src/CAF/Makefile.am b/src/CAF/Makefile.am index f60c261af..173a32f7d 100755 --- a/src/CAF/Makefile.am +++ b/src/CAF/Makefile.am @@ -52,8 +52,7 @@ nodist_salomeres_DATA = \ CAF_images.qm \ CAF_msg_en.qm -libcaf_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ \ - -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx +libcaf_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx libcaf_la_LDFLAGS=$(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS) -libcaf_la_LIBADD=../STD/libstd.la ../SUIT/libsuit.la +libcaf_la_LIBADD=../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la diff --git a/src/Makefile.am b/src/Makefile.am index 88d4f1cac..5276ed7e9 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,7 +27,7 @@ # VSR: this is the original packages list #SUBDIRS = Qtx Style DDS QDS SUIT STD CAF SUITApp LogWindow ObjBrowser Prs # VSR: already migrated to Qt4 packages -SUBDIRS = Qtx SUIT SUITApp STD CAM LogWindow Prs +SUBDIRS = Qtx SUIT SUITApp STD CAF CAM LogWindow Prs if ENABLE_SALOMEOBJECT # VSR: this is the original packages list diff --git a/src/src.pro b/src/src.pro index 42a258fc9..709188340 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,6 +5,7 @@ SUBDIRS = Qtx SUBDIRS += SUIT SUBDIRS += SUITApp SUBDIRS += STD +SUBDIRS += CAF SUBDIRS += CAM SUBDIRS += LogWindow SUBDIRS += PyInterp