From: vsr Date: Mon, 14 May 2007 16:18:32 +0000 (+0000) Subject: Porting to Qt4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a710868fa93efa3dd028a86b2247377aa7696f44;p=modules%2Fgui.git Porting to Qt4 --- diff --git a/src/STD/Makefile.am b/src/STD/Makefile.am index 9b5295002..dbb5d2ccb 100755 --- a/src/STD/Makefile.am +++ b/src/STD/Makefile.am @@ -25,55 +25,68 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am lib_LTLIBRARIES = libstd.la -salomeinclude_HEADERS= \ - STD_Application.h \ - STD.h \ - STD_MDIDesktop.h \ - STD_SDIDesktop.h \ - STD_TabDesktop.h \ - STD_CloseDlg.h \ +#VSR: already migrated to Qt4 files +salomeinclude_HEADERS= \ + STD.h \ + STD_Application.h \ + STD_CloseDlg.h \ + STD_MDIDesktop.h \ + STD_SDIDesktop.h \ + STD_TabDesktop.h + +#VSR: not yet migrated to Qt4 files +# \ STD_LoadStudiesDlg.h -dist_libstd_la_SOURCES=\ - STD_Application.cxx \ - STD_MDIDesktop.cxx \ - STD_SDIDesktop.cxx \ - STD_TabDesktop.cxx \ - STD_CloseDlg.cxx \ +#VSR: already migrated to Qt4 files +dist_libstd_la_SOURCES= \ + STD_Application.cxx \ + STD_CloseDlg.cxx \ + STD_MDIDesktop.cxx \ + STD_SDIDesktop.cxx \ + STD_TabDesktop.cxx + +#VSR: not yet migrated to Qt4 files +# \ STD_LoadStudiesDlg.cxx -MOC_FILES= \ - STD_Application_moc.cxx \ - STD_MDIDesktop_moc.cxx \ - STD_SDIDesktop_moc.cxx \ - STD_TabDesktop_moc.cxx \ - STD_CloseDlg_moc.cxx \ +#VSR: already migrated to Qt4 files +MOC_FILES= \ + STD_Application_moc.cxx \ + STD_CloseDlg_moc.cxx \ + STD_MDIDesktop_moc.cxx \ + STD_SDIDesktop_moc.cxx \ + STD_TabDesktop_moc.cxx + +#VSR: not yet migrated to Qt4 files +# \ STD_LoadStudiesDlg_moc.cxx + nodist_libstd_la_SOURCES= $(MOC_FILES) -dist_salomeres_DATA=\ - resources/config \ - resources/cut.png \ - resources/copy.png \ - resources/close.png \ - resources/cursor_rotate.png \ - resources/cursor_zoom.png \ - resources/help.png \ - resources/new.png \ - resources/open.png \ - resources/print.png \ - resources/paste.png \ - resources/redo.png \ - resources/reset.png \ - resources/save.png \ - resources/undo_arrow.png \ - resources/undo.png \ +dist_salomeres_DATA= \ + resources/config \ + resources/cut.png \ + resources/copy.png \ + resources/close.png \ + resources/cursor_rotate.png \ + resources/cursor_zoom.png \ + resources/help.png \ + resources/new.png \ + resources/open.png \ + resources/print.png \ + resources/paste.png \ + resources/redo.png \ + resources/reset.png \ + resources/save.png \ + resources/undo_arrow.png \ + resources/undo.png \ resources/std.ini -nodist_salomeres_DATA=\ - STD_images.qm \ +nodist_salomeres_DATA= \ + STD_images.qm \ STD_msg_en.qm libstd_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx libstd_la_LDFLAGS=$(QT_MT_LIBS) -libstd_la_LIBADD=../SUIT/libsuit.la +libstd_la_LIBADD=../Qtx/libqtx.la ../SUIT/libsuit.la diff --git a/src/STD/STD.h b/src/STD/STD.h index caeee3b3f..404cf9adf 100755 --- a/src/STD/STD.h +++ b/src/STD/STD.h @@ -20,13 +20,13 @@ #define STD_H #if defined STD_EXPORTS -#if defined WNT +#if defined WIN32 #define STD_EXPORT __declspec( dllexport ) #else #define STD_EXPORT #endif #else -#if defined WNT +#if defined WIN32 #define STD_EXPORT __declspec( dllimport ) #else #define STD_EXPORT @@ -39,7 +39,7 @@ #define true 1 #endif -#if defined WNT +#if defined WIN32 #pragma warning ( disable: 4251 ) #endif diff --git a/src/STD/STD.pro b/src/STD/STD.pro new file mode 100644 index 000000000..d8a1e8a48 --- /dev/null +++ b/src/STD/STD.pro @@ -0,0 +1,42 @@ +TEMPLATE = lib +TARGET = std +DESTDIR = ../../lib +MOC_DIR = ../../moc +OBJECTS_DIR = ../../obj/$$TARGET + +INCLUDEPATH += ../../include ../Qtx ../SUIT +LIBS += -L../../lib -lqtx -lsuit + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += STD_EXPORTS + +HEADERS = STD.h +HEADERS += STD_Application.h +HEADERS += STD_CloseDlg.h +HEADERS += STD_MDIDesktop.h +HEADERS += STD_SDIDesktop.h +HEADERS += STD_TabDesktop.h +#SOURCES += STD_LoadStudiesDlg.h + +SOURCES = STD_Application.cxx +SOURCES += STD_CloseDlg.cxx +SOURCES += STD_MDIDesktop.cxx +SOURCES += STD_SDIDesktop.cxx +SOURCES += STD_TabDesktop.cxx +#SOURCES += STD_LoadStudiesDlg.cxx + +TRANSLATIONS = resources/STD_images.ts \ + resources/STD_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/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 90690cad7..0c345fd33 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -25,22 +25,22 @@ #include #include #include -#include -#include +#include +//#include +#include +//#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -53,12 +53,11 @@ extern "C" STD_EXPORT SUIT_Application* createApplication() /*!Constructor.*/ STD_Application::STD_Application() : SUIT_Application(), -myEditEnabled( true ), -myActiveViewMgr( 0 ) + myActiveViewMgr( 0 ), + myExitConfirm( true ), + myEditEnabled( true ) { - STD_MDIDesktop* desk = new STD_MDIDesktop(); - - setDesktop( desk ); + setDesktop( new STD_MDIDesktop() ); } /*!Destructor.*/ @@ -67,6 +66,18 @@ STD_Application::~STD_Application() clearViewManagers(); } +/*! \retval requirement of exit confirmation*/ +bool STD_Application::exitConfirmation() const +{ + return myExitConfirm; +} + +/*! Set the requirement of exit confirmation*/ +void STD_Application::setExitConfirmation( const bool on ) +{ + myExitConfirm = on; +} + /*! \retval QString "StdApplication"*/ QString STD_Application::applicationName() const { @@ -96,15 +107,20 @@ void STD_Application::closeApplication() savePreferences(); SUIT_Study* study = activeStudy(); - if ( study ){ + if ( study ) + { + beforeCloseDoc( study ); + study->closeDocument(); setActiveStudy( 0 ); delete study; + + afterCloseDoc(); } setDesktop( 0 ); - + SUIT_Application::closeApplication(); } @@ -139,57 +155,62 @@ void STD_Application::createActions() createAction( FileNewId, tr( "TOT_DESK_FILE_NEW" ), resMgr->loadPixmap( "STD", tr( "ICON_FILE_NEW" ) ), tr( "MEN_DESK_FILE_NEW" ), tr( "PRP_DESK_FILE_NEW" ), - CTRL+Key_N, desk, false, this, SLOT( onNewDoc() ) ); + Qt::CTRL+Qt::Key_N, desk, false, this, SLOT( onNewDoc() ) ); createAction( FileOpenId, tr( "TOT_DESK_FILE_OPEN" ), resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ), tr( "MEN_DESK_FILE_OPEN" ), tr( "PRP_DESK_FILE_OPEN" ), - CTRL+Key_O, desk, false, this, SLOT( onOpenDoc() ) ); + Qt::CTRL+Qt::Key_O, desk, false, this, SLOT( onOpenDoc() ) ); createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ), resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ), tr( "MEN_DESK_FILE_CLOSE" ), tr( "PRP_DESK_FILE_CLOSE" ), - CTRL+Key_W, desk, false, this, SLOT( onCloseDoc() ) ); + Qt::CTRL+Qt::Key_W, desk, false, this, SLOT( onCloseDoc() ) ); - createAction( FileExitId, tr( "TOT_DESK_FILE_EXIT" ), QIconSet(), + createAction( FileExitId, tr( "TOT_DESK_FILE_EXIT" ), QIcon(), tr( "MEN_DESK_FILE_EXIT" ), tr( "PRP_DESK_FILE_EXIT" ), - CTRL+Key_Q, desk, false, this, SLOT( onExit() ) ); + Qt::CTRL+Qt::Key_Q, desk, false, this, SLOT( onExit() ) ); createAction( FileSaveId, tr( "TOT_DESK_FILE_SAVE" ), resMgr->loadPixmap( "STD", tr( "ICON_FILE_SAVE" ) ), tr( "MEN_DESK_FILE_SAVE" ), tr( "PRP_DESK_FILE_SAVE" ), - CTRL+Key_S, desk, false, this, SLOT( onSaveDoc() ) ); + Qt::CTRL+Qt::Key_S, desk, false, this, SLOT( onSaveDoc() ) ); - createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIconSet(), + createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIcon(), tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ), - CTRL+Key_A, desk, false, this, SLOT( onSaveAsDoc() ) ); + Qt::CTRL+Qt::Key_A, desk, false, this, SLOT( onSaveAsDoc() ) ); createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ), resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ), tr( "MEN_DESK_EDIT_COPY" ), tr( "PRP_DESK_EDIT_COPY" ), - CTRL+Key_C, desk, false, this, SLOT( onCopy() ) ); + Qt::CTRL+Qt::Key_C, desk, false, this, SLOT( onCopy() ) ); createAction( EditPasteId, tr( "TOT_DESK_EDIT_PASTE" ), resMgr->loadPixmap( "STD", tr( "ICON_EDIT_PASTE" ) ), tr( "MEN_DESK_EDIT_PASTE" ), tr( "PRP_DESK_EDIT_PASTE" ), - CTRL+Key_V, desk, false, this, SLOT( onPaste() ) ); + Qt::CTRL+Qt::Key_V, desk, false, this, SLOT( onPaste() ) ); QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ), - QIconSet(), tr( "MEN_DESK_VIEW_STATUSBAR" ), - tr( "PRP_DESK_VIEW_STATUSBAR" ), SHIFT+Key_S, desk, true ); - a->setOn( desk->statusBar()->isVisibleTo( desk ) ); + QIcon(), tr( "MEN_DESK_VIEW_STATUSBAR" ), + tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::SHIFT+Qt::Key_S, desk, true ); + a->setChecked( desk->statusBar()->isVisibleTo( desk ) ); connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) ); - createAction( NewWindowId, tr( "TOT_DESK_NEWWINDOW" ), QIconSet(), + createAction( NewWindowId, tr( "TOT_DESK_NEWWINDOW" ), QIcon(), tr( "MEN_DESK_NEWWINDOW" ), tr( "PRP_DESK_NEWWINDOW" ), 0, desk ); - createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIconSet(), + createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIcon(), tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ), - SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) ); + Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) ); + - QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk ); - registerAction( ViewWindowsId, da ); - da->setAutoPlace( false ); + QtxDockAction* dwa = new QtxDockAction( tr( "TOT_DOCKWINDOWS" ), tr( "MEN_DOCKWINDOWS" ), desk ); + dwa->setDockType( QtxDockAction::DockWidget ); + registerAction( ViewWindowsId, dwa ); + + QtxDockAction* tba = new QtxDockAction( tr( "TOT_TOOLBARS" ), tr( "MEN_TOOLBARS" ), desk ); + tba->setDockType( QtxDockAction::ToolBar ); + registerAction( ViewToolBarsId, tba ); // Create menus @@ -215,6 +236,7 @@ void STD_Application::createActions() createMenu( EditPasteId, editMenu ); createMenu( separator(), editMenu ); + createMenu( ViewToolBarsId, viewMenu, 0 ); createMenu( ViewWindowsId, viewMenu, 0 ); createMenu( separator(), viewMenu, -1, 10 ); createMenu( ViewStatusBarId, viewMenu, 10 ); @@ -241,27 +263,44 @@ void STD_Application::createActions() /*!Opens new application*/ void STD_Application::onNewDoc() { - QApplication::setOverrideCursor( Qt::waitCursor ); + onNewDoc( QString() ); +} +/*!Opens new application*/ +bool STD_Application::onNewDoc( const QString& name ) +{ + QApplication::setOverrideCursor( Qt::WaitCursor ); + + bool res = true; if ( !activeStudy() ) { createEmptyStudy(); - activeStudy()->createDocument(); - studyCreated( activeStudy() ); + res = activeStudy()->createDocument( name ); + if ( res ) + studyCreated( activeStudy() ); + else + { + delete activeStudy(); + setActiveStudy( 0 ); + } } else { SUIT_Application* aApp = startApplication( 0, 0 ); if ( aApp->inherits( "STD_Application" ) ) - ((STD_Application*)aApp)->onNewDoc(); + res = ((STD_Application*)aApp)->onNewDoc( name ); else { aApp->createEmptyStudy(); - aApp->activeStudy()->createDocument(); + res = aApp->activeStudy()->createDocument( name ); } + if ( !res ) + aApp->closeApplication(); } QApplication::restoreOverrideCursor(); + + return res; } /*!Put file name from file dialog to onOpenDoc(const QString&) function*/ @@ -278,7 +317,7 @@ void STD_Application::onOpenDoc() /*! \retval true, if document was opened successful, else false.*/ bool STD_Application::onOpenDoc( const QString& aName ) { - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor( Qt::WaitCursor ); bool res = true; if ( !activeStudy() ) @@ -290,12 +329,12 @@ bool STD_Application::onOpenDoc( const QString& aName ) { // if study exists - open in new desktop. Check: is the same file is opened? SUIT_Session* aSession = SUIT_Session::session(); - QPtrList aAppList = aSession->applications(); + QList aAppList = aSession->applications(); bool isAlreadyOpen = false; SUIT_Application* aApp = 0; - for ( QPtrListIterator it( aAppList ); it.current() && !isAlreadyOpen; ++it ) + for ( QList::iterator it = aAppList.begin(); it != aAppList.end() && !isAlreadyOpen; ++it ) { - aApp = it.current(); + aApp = *it; if ( aApp->activeStudy()->studyName() == aName ) isAlreadyOpen = true; } @@ -308,7 +347,7 @@ bool STD_Application::onOpenDoc( const QString& aName ) aApp->closeApplication(); } else - aApp->desktop()->setActiveWindow(); + aApp->desktop()->activateWindow(); } QApplication::restoreOverrideCursor(); @@ -329,12 +368,12 @@ bool STD_Application::onLoadDoc( const QString& aName ) { // if study exists - load in new desktop. Check: is the same file is loaded? SUIT_Session* aSession = SUIT_Session::session(); - QPtrList aAppList = aSession->applications(); + QList aAppList = aSession->applications(); bool isAlreadyOpen = false; SUIT_Application* aApp = 0; - for ( QPtrListIterator it( aAppList ); it.current() && !isAlreadyOpen; ++it ) + for ( QList::iterator it = aAppList.begin(); it != aAppList.end() && !isAlreadyOpen; ++it ) { - aApp = it.current(); + aApp = *it; if ( aApp->activeStudy()->studyName() == aName ) isAlreadyOpen = true; } @@ -345,7 +384,7 @@ bool STD_Application::onLoadDoc( const QString& aName ) res = aApp->useStudy( aName ); } else - aApp->desktop()->setActiveWindow(); + aApp->desktop()->activateWindow(); } return res; } @@ -379,8 +418,8 @@ void STD_Application::onCloseDoc( bool ask ) delete study; int aNbStudies = 0; - QPtrList apps = SUIT_Session::session()->applications(); - for ( unsigned i = 0; i < apps.count(); i++ ) + QList apps = SUIT_Session::session()->applications(); + for ( int i = 0; i < apps.count(); i++ ) aNbStudies += apps.at( i )->getNbStudies(); // STV: aNbStudies - number of currently existing studies (exclude currently closed) @@ -413,7 +452,7 @@ bool STD_Application::isPossibleToClose() activeStudy()->abortAllOperations(); if ( activeStudy()->isModified() ) { - QString sName = activeStudy()->studyName().stripWhiteSpace(); + QString sName = activeStudy()->studyName().trimmed(); QString msg = sName.isEmpty() ? tr( "INF_DOC_MODIFIED" ) : tr ( "INF_DOCUMENT_MODIFIED" ).arg( sName ); //SRN: BugID: IPAL9021: Begin @@ -452,7 +491,7 @@ void STD_Application::onSaveDoc() { putInfo( tr( "INF_DOC_SAVING" ) + activeStudy()->studyName() ); - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor( Qt::WaitCursor ); isOk = activeStudy()->saveDocument(); @@ -491,7 +530,7 @@ bool STD_Application::onSaveAsDoc() if ( aName.isNull() ) return false; - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor( Qt::WaitCursor ); putInfo( tr( "INF_DOC_SAVING" ) + aName ); isOk = study->saveDocumentAs( aName ); @@ -514,8 +553,10 @@ bool STD_Application::onSaveAsDoc() /*!Closing session.*/ void STD_Application::onExit() { - int aAnswer = SUIT_MessageBox::info2( desktop(), tr( "INF_DESK_EXIT" ), tr( "QUE_DESK_EXIT" ), - tr( "BUT_OK" ), tr( "BUT_CANCEL" ), 1, 2, 2 ); + int aAnswer = 1; + if ( exitConfirmation() ) + aAnswer = SUIT_MessageBox::info2( desktop(), tr( "INF_DESK_EXIT" ), tr( "QUE_DESK_EXIT" ), + tr( "BUT_OK" ), tr( "BUT_CANCEL" ), 1, 2, 2 ); if ( aAnswer == 1 ) SUIT_Session::session()->closeSession(); } @@ -566,12 +607,12 @@ void STD_Application::updateDesktopTitle() if ( activeStudy() ) { - QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false ); + QString sName = SUIT_Tools::file( activeStudy()->studyName().trimmed(), false ); if ( !sName.isEmpty() ) aTitle += QString( " - [%1]" ).arg( sName ); } - desktop()->setCaption( aTitle ); + desktop()->setWindowTitle( aTitle ); } /*!Update commands status.*/ @@ -596,10 +637,10 @@ void STD_Application::updateCommandsStatus() SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const { SUIT_ViewManager* vm = 0; - for ( QPtrListIterator it( myViewMgrs ); it.current() && !vm; ++it ) + for ( QList::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end() && !vm; ++it ) { - if ( it.current()->getType() == vmType ) - vm = it.current(); + if ( (*it)->getType() == vmType ) + vm = *it; } return vm; } @@ -609,16 +650,18 @@ SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const */ void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst ) const { - for ( QPtrListIterator it( myViewMgrs ); it.current(); ++it ) - if ( it.current()->getType() == vmType ) - lst.append( it.current() ); + for ( QList::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end(); ++it ) + { + if ( (*it)->getType() == vmType ) + lst.append( *it ); + } } /*!\param lst - output list of all view managers.*/ void STD_Application::viewManagers( ViewManagerList& lst ) const { - for ( QPtrListIterator it( myViewMgrs ); it.current(); ++it ) - lst.append( it.current() ); + for ( QList::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end(); ++it ) + lst.append( *it ); } /*!\retval ViewManagerList - const list of all view managers.*/ @@ -669,7 +712,7 @@ void STD_Application::removeViewManager( SUIT_ViewManager* vm ) vm->disconnectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) ); disconnect( vm, SIGNAL( activated( SUIT_ViewManager* ) ), this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) ); - myViewMgrs.removeRef( vm ); + myViewMgrs.removeAll( vm ); if ( myActiveViewMgr == vm ) myActiveViewMgr = 0; @@ -681,8 +724,9 @@ void STD_Application::clearViewManagers() ViewManagerList lst; viewManagers( lst ); - for ( QPtrListIterator it( lst ); it.current(); ++it ) { - QGuardedPtr vm = it.current(); + for ( QList::iterator it = lst.begin(); it != lst.end(); ++it ) + { + QPointer vm = *it; removeViewManager( vm ); delete vm; } @@ -691,7 +735,7 @@ void STD_Application::clearViewManagers() /*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/ bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const { - return myViewMgrs.contains( vm ) > 0; + return myViewMgrs.contains( vm ); } /*!Private slot, sets active manager to \vm, if \vm in view managers list.*/ @@ -721,10 +765,6 @@ void STD_Application::onHelpAbout() void STD_Application::createEmptyStudy() { SUIT_Application::createEmptyStudy(); - - SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), desktop(), new SUIT_ViewModel() ); - - addViewManager( vm ); } /*!Sets active manager to \vm, if \vm in view managers list.*/ @@ -740,25 +780,23 @@ void STD_Application::setActiveViewManager( SUIT_ViewManager* vm ) /*!Public slot. */ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e ) { - QtxPopupMenu* popup = new QtxPopupMenu(); + QMenu* popup = new QMenu(); // fill popup by own items QString title; contextMenuPopup( client->popupClientType(), popup, title ); - popup->setTitleText( title ); + popup->setTitle( title ); - popup->insertSeparator(); + popup->addSeparator(); // add items from popup client client->contextMenuPopup( popup ); SUIT_Tools::simplifySeparators( popup ); - if ( popup->count() ) + if ( !popup->actions().isEmpty() ) popup->exec( e->globalPos() ); delete popup; } -#include - /*!\retval QString - return file name from dialog.*/ QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ) @@ -766,9 +804,7 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q if ( !parent ) parent = desktop(); if ( open ) - { - return QFileDialog::getOpenFileName( initial, filters, parent, 0, caption ); - } + return QFileDialog::getOpenFileName( parent, caption, initial, filters ); else { QString aName; @@ -779,26 +815,26 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q while ( !isOk ) { // It is preferrable to use OS-specific file dialog box here !!! - aName = QFileDialog::getSaveFileName( anOldPath, filters, parent, 0, caption, &aUsedFilter ); + aName = QFileDialog::getSaveFileName( parent, caption, anOldPath, filters, &aUsedFilter ); if ( aName.isNull() ) isOk = true; else { - int aEnd = aUsedFilter.findRev( ')' ); - int aStart = aUsedFilter.findRev( '(', aEnd ); + int aEnd = aUsedFilter.lastIndexOf( ')' ); + int aStart = aUsedFilter.lastIndexOf( '(', aEnd ); QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 ); int idx = 0; QStringList extList; QRegExp rx( "[\b\\*]*\\.([\\w]+)" ); - while ( ( idx = rx.search( wcStr, idx ) ) != -1 ) + while ( ( idx = rx.indexIn( wcStr, idx ) ) != -1 ) { extList.append( rx.cap( 1 ) ); idx += rx.matchedLength(); } - if ( !extList.isEmpty() && !extList.contains( QFileInfo( aName ).extension() ) ) + if ( !extList.isEmpty() && !extList.contains( SUIT_Tools::extension( aName ) ) ) aName += QString( ".%1" ).arg( extList.first() ); if ( QFileInfo( aName ).exists() ) @@ -829,7 +865,8 @@ QString STD_Application::getDirectory( const QString& initial, const QString& ca { if ( !parent ) parent = desktop(); - return QFileDialog::getExistingDirectory( initial, parent, 0, caption, true ); + + return QFileDialog::getExistingDirectory( parent, caption, initial ); } /*! diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 4e766ca98..cd5f43b42 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -23,20 +23,22 @@ #include -#include -#include +#include -#include -#include +class QMenu; +class QCloseEvent; +class QContextMenuEvent; class QToolBar; class QtxAction; -class QPopupMenu; class SUIT_Operation; class SUIT_ViewWindow; class SUIT_ToolWindow; +class SUIT_Desktop; +class SUIT_ViewManager; +class SUIT_PopupClient; -typedef QPtrList ViewManagerList; +typedef QList ViewManagerList; #if defined WIN32 #pragma warning( disable: 4251 ) @@ -46,6 +48,11 @@ class STD_EXPORT STD_Application : public SUIT_Application { Q_OBJECT +public: + enum { FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId, + ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId, + EditCutId, EditCopyId, EditPasteId, HelpAboutId, UserID }; + public: STD_Application(); virtual ~STD_Application(); @@ -82,7 +89,10 @@ public: virtual void closeApplication(); - virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& ) {} + virtual void contextMenuPopup( const QString&, QMenu*, QString& ) {} + + bool exitConfirmation() const; + void setExitConfirmation( const bool ); signals: /*!emit that view manager added*/ @@ -94,6 +104,8 @@ signals: public slots: virtual void onNewDoc(); + virtual bool onNewDoc( const QString& ); + virtual void onCloseDoc( bool ask = true ); virtual void onSaveDoc(); virtual bool onSaveAsDoc(); @@ -125,14 +137,6 @@ protected: MenuHelpId = 7 }; - enum { FileNewId, FileOpenId, FileCloseId, - FileSaveId, FileSaveAsId, FileExitId, - ViewStatusBarId, ViewWindowsId, NewWindowId, - EditCutId, EditCopyId, EditPasteId, - HelpAboutId, - UserID - }; - protected: virtual void createActions(); virtual void updateDesktopTitle(); @@ -157,6 +161,7 @@ private: SUIT_ViewManager* myActiveViewMgr; private: + bool myExitConfirm; bool myEditEnabled; bool myClosePermanently; }; diff --git a/src/STD/STD_CloseDlg.cxx b/src/STD/STD_CloseDlg.cxx index ff09c551a..c2f470668 100644 --- a/src/STD/STD_CloseDlg.cxx +++ b/src/STD/STD_CloseDlg.cxx @@ -18,15 +18,12 @@ // #include "STD_CloseDlg.h" -#include -#include -#include -#include -#include - -#ifndef WNT -using namespace std; -#endif +#include +#include +#include +#include +#include +#include /*! * \brief creates a Close dialog box @@ -35,23 +32,24 @@ using namespace std; * \param f style flags */ -STD_CloseDlg::STD_CloseDlg( QWidget* parent, bool modal, WFlags f ) -: QDialog( parent, "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +STD_CloseDlg::STD_CloseDlg( QWidget* parent, bool modal ) +: QDialog( parent ) { + setModal( modal ); setSizeGripEnabled( true ); - setCaption( tr( "CLOSE_DLG_CAPTION" ) ); + setWindowTitle( tr( "CLOSE_DLG_CAPTION" ) ); QVBoxLayout* m_vbL = new QVBoxLayout( this ); m_vbL->setMargin( 11 ); m_vbL->setSpacing( 6 ); - QLabel* m_lIcon = new QLabel( this, "m_lDescr" ); + QLabel* m_lIcon = new QLabel( this ); QPixmap pm = QMessageBox::standardIcon( QMessageBox::Warning ); m_lIcon->setPixmap( pm ); m_lIcon->setScaledContents( false ); m_lIcon->setAlignment( Qt::AlignCenter ); - QLabel* m_lDescr = new QLabel (this, "m_lDescr"); + QLabel* m_lDescr = new QLabel( this ); m_lDescr->setText ( tr ("CLOSE_DLG_DESCRIPTION") ); m_lDescr->setAlignment( Qt::AlignCenter ); m_lDescr->setMinimumHeight( m_lDescr->sizeHint().height()*5 ); @@ -72,8 +70,8 @@ STD_CloseDlg::STD_CloseDlg( QWidget* parent, bool modal, WFlags f ) m_hl2->addWidget( m_pb1, 0, 0 ); m_hl2->addWidget( m_pb2, 0, 1 ); m_hl2->addWidget( m_pb3, 0, 2 ); - m_hl2->addColSpacing( 3, 10 ); - m_hl2->setColStretch( 3, 5 ); + m_hl2->setColumnMinimumWidth( 3, 10 ); + m_hl2->setColumnStretch( 3, 5 ); m_hl2->addWidget( m_pb4, 0, 4 ); m_vbL->addLayout( m_hl1 ); diff --git a/src/STD/STD_CloseDlg.h b/src/STD/STD_CloseDlg.h index 6975e88f4..ba66026ea 100644 --- a/src/STD/STD_CloseDlg.h +++ b/src/STD/STD_CloseDlg.h @@ -16,10 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef STD_CloseDlg_H -#define STD_CloseDlg_H +#ifndef STD_CLOSEDLG_H +#define STD_CLOSEDLG_H -#include +#include + +class QPushButton; /*! \class QDialog * \brief For more information see QT documentation. @@ -32,8 +34,8 @@ class STD_CloseDlg: public QDialog Q_OBJECT public: - STD_CloseDlg ( QWidget * parent = 0, bool modal = FALSE, WFlags f = 0 ) ; - ~STD_CloseDlg ( ) { }; + STD_CloseDlg( QWidget* = 0, bool = false ); + virtual ~STD_CloseDlg() {}; private slots: void onButtonClicked(); diff --git a/src/STD/STD_MDIDesktop.cxx b/src/STD/STD_MDIDesktop.cxx index 9a446ab64..f48313a82 100755 --- a/src/STD/STD_MDIDesktop.cxx +++ b/src/STD/STD_MDIDesktop.cxx @@ -22,29 +22,30 @@ #include #include -#include -#include -#include +//#include +//#include -#include -#include -#include -#include +#include +#include +#include #include /*!Constructor.*/ STD_MDIDesktop::STD_MDIDesktop() : SUIT_Desktop(), -myWorkspace( 0 ), -myWorkspaceAction( 0 ) +myWorkspace( 0 )//, +//myWorkspaceAction( 0 ) { - QVBox* base = new QVBox( this ); + QFrame* base = new QFrame( this ); + QVBoxLayout* main = new QVBoxLayout( base ); + main->setMargin( 0 ); base->setFrameStyle( QFrame::Panel | QFrame::Sunken ); setCentralWidget( base ); myWorkspace = new QWorkspace( base ); + main->addWidget( myWorkspace ); connect( myWorkspace, SIGNAL( windowActivated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) ); @@ -70,59 +71,63 @@ SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const } /*!\retval QPtrList - return const active window list.*/ -QPtrList STD_MDIDesktop::windows() const +QList STD_MDIDesktop::windows() const { - QPtrList winList; + QList winList; QWidgetList children = myWorkspace->windowList(); - for ( QWidgetListIt it( children ); it.current(); ++it ) + for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it ) { - if ( it.current()->inherits( "SUIT_ViewWindow" ) ) - winList.append( (SUIT_ViewWindow*)it.current() ); + SUIT_ViewWindow* vw = ::qobject_cast( *it ); + if ( vw ) + winList.append( vw ); } return winList; } -/*!\retval QWidget - pointer to work space.*/ -QWidget* STD_MDIDesktop::parentArea() const +/*! add the new widget into desktop.*/ +void STD_MDIDesktop::addWindow( QWidget* w ) { - return workspace(); + if ( !w || !workspace() ) + return; + + workspace()->addWindow( w ); } /*!Call method perform for operation \a type.*/ -void STD_MDIDesktop::windowOperation( const int type ) +void STD_MDIDesktop::windowOperation( const int /*type*/ ) { - myWorkspaceAction->perform( operationFlag( type ) ); + //myWorkspaceAction->perform( operationFlag( type ) ); } /*!Sets window operations by \a first ... parameters.*/ void STD_MDIDesktop::setWindowOperations( const int first, ... ) { va_list ints; - va_start( ints, first ); + va_start( ints, first ); - QValueList typeList; - - int cur = first; - while ( cur ) - { - typeList.append( cur ); - cur = va_arg( ints, int ); + QList typeList; + + int cur = first; + while ( cur ) + { + typeList.append( cur ); + cur = va_arg( ints, int ); } - setWindowOperations( typeList ); + setWindowOperations( typeList ); } /*!Sets window operations by variable \a opList - operation list.*/ -void STD_MDIDesktop::setWindowOperations( const QValueList& opList ) +void STD_MDIDesktop::setWindowOperations( const QList& opList ) { int flags = 0; - for ( QValueList::const_iterator it = opList.begin(); it != opList.end(); ++it ) + for ( QList::const_iterator it = opList.begin(); it != opList.end(); ++it ) flags = flags | operationFlag( *it ); - myWorkspaceAction->setItems( flags ); +// myWorkspaceAction->setItems( flags ); } /*!\retval QWorkspace pointer - work space.*/ @@ -141,6 +146,7 @@ void STD_MDIDesktop::onWindowActivated( QWidget* w ) /*!Create actions: cascade, Tile, Tile Horizontal, Tile Vertical*/ void STD_MDIDesktop::createActions() { +/* if ( myWorkspaceAction ) return; @@ -186,12 +192,14 @@ void STD_MDIDesktop::createActions() int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100, MenuWindowId ); mMgr->insert( myWorkspaceAction, winMenuId, -1 ); mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 ); +*/ } /*!Convert STD_MDIDesktop enumerations to QtxWorkspaceAction.*/ -int STD_MDIDesktop::operationFlag( const int type ) const +int STD_MDIDesktop::operationFlag( const int /*type*/ ) const { int res = 0; +/* switch ( type ) { case Cascade: @@ -207,5 +215,6 @@ int STD_MDIDesktop::operationFlag( const int type ) const res = QtxWorkspaceAction::VTile; break; } +*/ return res; } diff --git a/src/STD/STD_MDIDesktop.h b/src/STD/STD_MDIDesktop.h index f4136444d..7a90174b4 100755 --- a/src/STD/STD_MDIDesktop.h +++ b/src/STD/STD_MDIDesktop.h @@ -23,12 +23,10 @@ #include -class QtxAction; -class QPopupMenu; class QWorkspace; -class QtxWorkspaceAction; +//class QtxWorkspaceAction; -#if defined WNT +#if defined WIN32 #pragma warning( disable: 4251 ) #endif @@ -36,6 +34,8 @@ class STD_EXPORT STD_MDIDesktop: public SUIT_Desktop { Q_OBJECT + class Workspace; + public: enum { MenuWindowId = 6 }; enum { Cascade, Tile, HTile, VTile }; @@ -45,12 +45,12 @@ public: virtual ~STD_MDIDesktop(); virtual SUIT_ViewWindow* activeWindow() const; - virtual QPtrList windows() const; + virtual QList windows() const; void windowOperation( const int ); void setWindowOperations( const int, ... ); - void setWindowOperations( const QValueList& ); + void setWindowOperations( const QList& ); QWorkspace* workspace() const; @@ -59,17 +59,17 @@ private slots: protected: void createActions(); - virtual QWidget* parentArea() const; + virtual void addWindow( QWidget* ); private: int operationFlag( const int ) const; private: QWorkspace* myWorkspace; - QtxWorkspaceAction* myWorkspaceAction; +// QtxWorkspaceAction* myWorkspaceAction; }; -#if defined WNT +#if defined WIN32 #pragma warning( default: 4251 ) #endif diff --git a/src/STD/STD_SDIDesktop.cxx b/src/STD/STD_SDIDesktop.cxx index 9bcc92a56..1c9a08fd6 100755 --- a/src/STD/STD_SDIDesktop.cxx +++ b/src/STD/STD_SDIDesktop.cxx @@ -20,16 +20,18 @@ #include -#include -#include -#include +#include +#include /*!Constructor. Create instance of QVBox*/ STD_SDIDesktop::STD_SDIDesktop() : SUIT_Desktop() { - myMainWidget = new QVBox( this ); + myMainWidget = new QFrame( this ); myMainWidget->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + + QVBoxLayout* main = new QVBoxLayout( myMainWidget ); + main->setMargin( 0 ); setCentralWidget( myMainWidget ); } @@ -42,40 +44,42 @@ STD_SDIDesktop::~STD_SDIDesktop() /*!\retval SUIT_ViewWindow - return const active window.*/ SUIT_ViewWindow* STD_SDIDesktop::activeWindow() const { - const QObjectList* children = myMainWidget->children(); - if ( !children ) - return 0; - - QPtrList winList; - for ( QObjectListIt it( *children ); it.current(); ++it ) + const QObjectList& lst = myMainWidget->children(); + QList winList; + for ( QObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it ) { - if ( it.current()->inherits( "SUIT_ViewWindow" ) ) - winList.append( (SUIT_ViewWindow*)it.current() ); + SUIT_ViewWindow* vw = ::qobject_cast( *it ); + if ( vw ) + winList.append( vw ); } SUIT_ViewWindow* win = 0; - for ( QPtrListIterator itr( winList ); itr.current() && !win; ++itr ) + for ( QList::iterator itr = winList.begin(); itr != winList.end() && !win; ++itr ) { - if ( itr.current()->isActiveWindow() ) - win = itr.current(); + if ( (*itr)->isActiveWindow() ) + win = *itr; } if ( !win && !winList.isEmpty() ) - win = winList.getFirst(); + win = winList.first(); return win; } /*!\retval QPtrList - return const active window list.*/ -QPtrList STD_SDIDesktop::windows() const +QList STD_SDIDesktop::windows() const { - QPtrList winList; - winList.append( activeWindow() ); + QList winList; + winList.append( activeWindow() ); return winList; } -/*!\retval QWidget - pointer to main window.*/ -QWidget* STD_SDIDesktop::parentArea() const +/*! add new widget into desktop.*/ +void STD_SDIDesktop::addWindow( QWidget* w ) { - return myMainWidget; + if ( !w || !centralWidget() || !centralWidget()->layout() ) + return; + + w->setParent( centralWidget() ); + centralWidget()->layout()->addWidget( w ); } diff --git a/src/STD/STD_SDIDesktop.h b/src/STD/STD_SDIDesktop.h index 78b1bb78d..c963a28b0 100755 --- a/src/STD/STD_SDIDesktop.h +++ b/src/STD/STD_SDIDesktop.h @@ -23,7 +23,7 @@ #include -class QVBox; +class QFrame; class STD_EXPORT STD_SDIDesktop: public SUIT_Desktop { @@ -34,13 +34,13 @@ public: virtual ~STD_SDIDesktop(); virtual SUIT_ViewWindow* activeWindow() const; - virtual QPtrList windows() const; + virtual QList windows() const; protected: - virtual QWidget* parentArea() const; + virtual void addWindow( QWidget* ); private: - QVBox* myMainWidget; + QFrame* myMainWidget; }; #endif diff --git a/src/STD/STD_TabDesktop.cxx b/src/STD/STD_TabDesktop.cxx index 645188035..8af74e725 100644 --- a/src/STD/STD_TabDesktop.cxx +++ b/src/STD/STD_TabDesktop.cxx @@ -22,38 +22,39 @@ #include #include -#include #include -#include -#include +//#include +//#include -#include -#include -#include -#include +#include +#include #include /*!Constructor.Create new instances of QVBox and QtxWorkstack.*/ STD_TabDesktop::STD_TabDesktop() : SUIT_Desktop(), -myWorkstack( 0 ), -myWorkstackAction( 0 ) +myWorkstack( 0 )//, +//myWorkstackAction( 0 ) { - QVBox* base = new QVBox( this ); + QFrame* base = new QFrame( this ); base->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + QVBoxLayout* main = new QVBoxLayout( base ); + main->setMargin( 0 ); + setCentralWidget( base ); myWorkstack = new QtxWorkstack( base ); + main->addWidget( myWorkstack ); // setting Expanding size policy for central workstack. If there are several widgets // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules). // But the workstack must occupy as much space as possible -- set Expanding for it. myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); - myWorkstack->setAccel(QtxWorkstack::SplitVertical, SHIFT + Key_V); - myWorkstack->setAccel(QtxWorkstack::SplitHorizontal, SHIFT + Key_H); - myWorkstack->setAccel(QtxWorkstack::Close, SHIFT + Key_C); + myWorkstack->setAccel( QtxWorkstack::SplitVertical, Qt::SHIFT + Qt::Key_V ); + myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H ); + myWorkstack->setAccel( QtxWorkstack::Close, Qt::SHIFT + Qt::Key_C ); connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) ); @@ -79,30 +80,33 @@ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const } /*!\retval QPtrList - return const active window list.*/ -QPtrList STD_TabDesktop::windows() const +QList STD_TabDesktop::windows() const { - QPtrList winList; + QList winList; QWidgetList children = myWorkstack->windowList(); - for ( QWidgetListIt it( children ); it.current(); ++it ) + for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it ) { - if ( it.current()->inherits( "SUIT_ViewWindow" ) ) - winList.append( (SUIT_ViewWindow*)it.current() ); + if ( (*it)->inherits( "SUIT_ViewWindow" ) ) + winList.append( (SUIT_ViewWindow*)*it ); } return winList; } -/*!\retval QWidget pointer - QT work stack.*/ -QWidget* STD_TabDesktop::parentArea() const +/*! insert new widget into desktop.*/ +void STD_TabDesktop::addWindow( QWidget* w ) { - return workstack(); + if ( !w || !workstack() ) + return; + + workstack()->addWindow( w ); } /*!Call method perform for operation \a type.*/ -void STD_TabDesktop::windowOperation( const int type ) +void STD_TabDesktop::windowOperation( const int /*type*/ ) { - myWorkstackAction->perform( operationFlag( type ) ); +// myWorkstackAction->perform( operationFlag( type ) ); } /*!Sets window operations by \a first ... parameters.*/ @@ -111,7 +115,7 @@ void STD_TabDesktop::setWindowOperations( const int first, ... ) va_list ints; va_start( ints, first ); - QValueList typeList; + QList typeList; int cur = first; while ( cur ) @@ -124,14 +128,14 @@ void STD_TabDesktop::setWindowOperations( const int first, ... ) } /*!Sets window operations by variable \a opList - operation list.*/ -void STD_TabDesktop::setWindowOperations( const QValueList& opList ) +void STD_TabDesktop::setWindowOperations( const QList& opList ) { int flags = 0; - for ( QValueList::const_iterator it = opList.begin(); it != opList.end(); ++it ) + for ( QList::const_iterator it = opList.begin(); it != opList.end(); ++it ) flags = flags | operationFlag( *it ); - myWorkstackAction->setItems( flags ); +// myWorkstackAction->setItems( flags ); } /*!\retval QtxWorkstack pointer - QT work stack.*/ @@ -150,6 +154,7 @@ void STD_TabDesktop::onWindowActivated( QWidget* w ) /*!Create actions for window.*/ void STD_TabDesktop::createActions() { +/* if ( myWorkstackAction ) return; @@ -180,12 +185,14 @@ void STD_TabDesktop::createActions() int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100, MenuWindowId ); mMgr->insert( myWorkstackAction, winMenuId, -1 ); mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 ); +*/ } /*!Convert STD_TabDesktop enumerations to QtxWorkstackAction*/ -int STD_TabDesktop::operationFlag( const int type ) const +int STD_TabDesktop::operationFlag( const int /*type*/ ) const { int res = 0; +/* switch ( type ) { case VSplit: @@ -195,5 +202,6 @@ int STD_TabDesktop::operationFlag( const int type ) const res = QtxWorkstackAction::HSplit; break; } +*/ return res; } diff --git a/src/STD/STD_TabDesktop.h b/src/STD/STD_TabDesktop.h index aa63db065..9e3f1d2a4 100644 --- a/src/STD/STD_TabDesktop.h +++ b/src/STD/STD_TabDesktop.h @@ -23,13 +23,10 @@ #include -class QtxAction; -class QPopupMenu; -class QWorkspace; class QtxWorkstack; -class QtxWorkstackAction; +//class QtxWorkstackAction; -#if defined WNT +#if defined WIN32 #pragma warning( disable: 4251 ) #endif @@ -46,12 +43,12 @@ public: virtual ~STD_TabDesktop(); virtual SUIT_ViewWindow* activeWindow() const; - virtual QPtrList windows() const; + virtual QList windows() const; void windowOperation( const int ); void setWindowOperations( const int, ... ); - void setWindowOperations( const QValueList& ); + void setWindowOperations( const QList& ); QtxWorkstack* workstack() const; @@ -60,17 +57,17 @@ private slots: protected: void createActions(); - virtual QWidget* parentArea() const; + virtual void addWindow( QWidget* ); private: int operationFlag( const int ) const; private: QtxWorkstack* myWorkstack; - QtxWorkstackAction* myWorkstackAction; +// QtxWorkstackAction* myWorkstackAction; }; -#if defined WNT +#if defined WIN32 #pragma warning( default: 4251 ) #endif