From: stv Date: Wed, 14 Feb 2007 17:47:41 +0000 (+0000) Subject: no message X-Git-Tag: For_HDF~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6474f2cb55a49309bf8446798ff96bf3752c32c8;p=modules%2Fgui.git no message --- 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_Application.cxx b/src/STD/STD_Application.cxx index 90690cad7..4047e221a 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -30,17 +30,17 @@ #include #include -#include +//#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -56,9 +56,7 @@ STD_Application::STD_Application() myEditEnabled( true ), myActiveViewMgr( 0 ) { - STD_MDIDesktop* desk = new STD_MDIDesktop(); - - setDesktop( desk ); + setDesktop( new STD_MDIDesktop() ); } /*!Destructor.*/ @@ -139,58 +137,59 @@ 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 ); - +*/ // Create menus int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1, MenuFileId, 0 ); @@ -241,7 +240,7 @@ void STD_Application::createActions() /*!Opens new application*/ void STD_Application::onNewDoc() { - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor( Qt::WaitCursor ); if ( !activeStudy() ) { @@ -278,7 +277,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 +289,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 +307,7 @@ bool STD_Application::onOpenDoc( const QString& aName ) aApp->closeApplication(); } else - aApp->desktop()->setActiveWindow(); + aApp->desktop()->activateWindow(); } QApplication::restoreOverrideCursor(); @@ -329,12 +328,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 +344,7 @@ bool STD_Application::onLoadDoc( const QString& aName ) res = aApp->useStudy( aName ); } else - aApp->desktop()->setActiveWindow(); + aApp->desktop()->activateWindow(); } return res; } @@ -379,7 +378,7 @@ void STD_Application::onCloseDoc( bool ask ) delete study; int aNbStudies = 0; - QPtrList apps = SUIT_Session::session()->applications(); + QList apps = SUIT_Session::session()->applications(); for ( unsigned i = 0; i < apps.count(); i++ ) aNbStudies += apps.at( i )->getNbStudies(); @@ -413,7 +412,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 +451,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 +490,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 ); @@ -566,12 +565,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 +595,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 +608,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 +670,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 +682,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 +693,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.*/ @@ -723,7 +725,6 @@ void STD_Application::createEmptyStudy() SUIT_Application::createEmptyStudy(); SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), desktop(), new SUIT_ViewModel() ); - addViewManager( vm ); } @@ -740,25 +741,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 +765,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 +776,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 +826,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..b28adcb1a 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -26,17 +26,17 @@ #include #include -#include -#include +#include +#include +class QMenu; class QToolBar; class QtxAction; -class QPopupMenu; class SUIT_Operation; class SUIT_ViewWindow; class SUIT_ToolWindow; -typedef QPtrList ViewManagerList; +typedef QList ViewManagerList; #if defined WIN32 #pragma warning( disable: 4251 ) @@ -82,7 +82,7 @@ public: virtual void closeApplication(); - virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& ) {} + virtual void contextMenuPopup( const QString&, QMenu*, QString& ) {} signals: /*!emit that view manager added*/ diff --git a/src/STD/STD_CloseDlg.cxx b/src/STD/STD_CloseDlg.cxx index ff09c551a..4291509f2 100644 --- a/src/STD/STD_CloseDlg.cxx +++ b/src/STD/STD_CloseDlg.cxx @@ -18,15 +18,11 @@ // #include "STD_CloseDlg.h" -#include -#include -#include -#include -#include - -#ifndef WNT -using namespace std; -#endif +#include +#include +#include +#include +#include /*! * \brief creates a Close dialog box @@ -35,23 +31,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 +69,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..cd81bcb7c 100644 --- a/src/STD/STD_CloseDlg.h +++ b/src/STD/STD_CloseDlg.h @@ -16,10 +16,10 @@ // // 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 QDialog * \brief For more information see QT documentation. @@ -32,8 +32,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_LoadStudiesDlg.cxx b/src/STD/STD_LoadStudiesDlg.cxx index 5dc4c0d5a..3e494d921 100644 --- a/src/STD/STD_LoadStudiesDlg.cxx +++ b/src/STD/STD_LoadStudiesDlg.cxx @@ -18,10 +18,10 @@ // #include "STD_LoadStudiesDlg.h" -#include -#include -#include -#include +#include +#include +#include +#include #define SPACING_SIZE 6 #define MARGIN_SIZE 11 @@ -35,18 +35,18 @@ * \param f style flags */ -STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal, WFlags fl ) -: QDialog( parent, "STD_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal ) +: QDialog( parent ) { - resize( 321, 181 ); - setCaption( tr("DLG_LOAD_STUDY_CAPTION") ); - setSizeGripEnabled( TRUE ); + setModal( modal ); + setWindowTitle( tr("DLG_LOAD_STUDY_CAPTION") ); + setSizeGripEnabled( true ); QGridLayout* aTopLayout = new QGridLayout(this); aTopLayout->setMargin(MARGIN_SIZE); aTopLayout->setSpacing(SPACING_SIZE); - TextLabel1 = new QLabel( this, "TextLabel1" ); + TextLabel1 = new QLabel( this ); TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) ); TextLabel1->setText( tr( "MEN_STUDIES_CHOICE" ) ); @@ -54,12 +54,12 @@ STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal, WFlags fl aBtnLayout->setSpacing( SPACING_SIZE ); aBtnLayout->setMargin( 0 ); - buttonOk = new QPushButton( this, "buttonOk" ); + buttonOk = new QPushButton( this ); buttonOk->setText( tr( "BUT_OK" ) ); buttonOk->setAutoDefault( true ); buttonOk->setDefault( true ); - buttonCancel = new QPushButton( this, "buttonCancel" ); + buttonCancel = new QPushButton( this ); buttonCancel->setText( tr( "BUT_CANCEL" ) ); buttonCancel->setAutoDefault( true ); @@ -67,11 +67,11 @@ STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal, WFlags fl aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); aBtnLayout->addWidget( buttonCancel ); - ListComponent = new QListBox( this, "ListComponent" ); - ListComponent->setVScrollBarMode(QListBox::AlwaysOn); - ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT); - ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); - ListComponent->setSelectionMode(QListBox::Single); + ListComponent = new QListWidget( this ); + ListComponent->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + ListComponent->setMinimumSize( MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT ); + ListComponent->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + ListComponent->setSelectionMode( QListWidget::SingleSelection ); aTopLayout->addWidget(TextLabel1, 0, 0); aTopLayout->addWidget(ListComponent, 1, 0); diff --git a/src/STD/STD_LoadStudiesDlg.h b/src/STD/STD_LoadStudiesDlg.h index 268b16135..2a94a519a 100644 --- a/src/STD/STD_LoadStudiesDlg.h +++ b/src/STD/STD_LoadStudiesDlg.h @@ -21,16 +21,17 @@ #include -#include -#include +#include + +#include class QLabel; class QListBox; class QPushButton; class QVBoxLayout; class QHBoxLayout; -class QGridLayout; -class QListBoxItem; +class QGridLayout; +class QListWidget; /*!\class STD_LoadStudiesDlg * \brief Describes a dialog box that gives a list of opened studies. @@ -41,7 +42,7 @@ class STD_EXPORT STD_LoadStudiesDlg : public QDialog Q_OBJECT public: - STD_LoadStudiesDlg( QWidget* parent = 0, bool modal = FALSE, WFlags fl = 0 ); + STD_LoadStudiesDlg( QWidget* parent = 0, bool modal = false ); ~STD_LoadStudiesDlg() {} /*!\var TextLabel1 @@ -62,7 +63,7 @@ public: /*!\var ListComponent * \brief stores a dialog list compoent */ - QListBox* ListComponent; + QListWidget* ListComponent; };