1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0023459: Update QT samples

Removing Qt3Support layer of Qt 4
Changed all files for Qt4 and added file VoxelDemo.pro
Removed 'static' before the declaration of handling FSD_File.
This commit is contained in:
vdn
2013-10-03 14:26:39 +04:00
committed by bugmaster
parent 9d1c5188ae
commit 3cb77da46e
10 changed files with 225 additions and 62 deletions

View File

@@ -68,27 +68,27 @@ void ApplicationCommonWindow::createStandardOperations()
fileNewAction->setToolTip( QObject::tr("TBR_NEW") );
fileNewAction->setStatusTip( QObject::tr("TBR_NEW") );
fileNewAction->setShortcut( QObject::tr("CTRL+N") );
connect( fileNewAction, SIGNAL( activated() ) , this, SLOT( onNewDoc() ) );
connect( fileNewAction, SIGNAL( triggered() ) , this, SLOT( onNewDoc() ) );
myStdActions.insert( FileNewId, fileNewAction );
fileCloseAction = new QAction( closeIcon, QObject::tr("MNU_CLOSE"), this );
fileCloseAction->setToolTip( QObject::tr("TBR_CLOSE") );
fileCloseAction->setStatusTip( QObject::tr("TBR_CLOSE") );
fileCloseAction->setShortcut( QObject::tr("CTRL+W") );
connect( fileCloseAction, SIGNAL( activated() ) , this, SLOT( onCloseWindow() ) );
connect( fileCloseAction, SIGNAL( triggered() ) , this, SLOT( onCloseWindow() ) );
myStdActions.insert( FileCloseId, fileCloseAction );
fileQuitAction = new QAction( QObject::tr("MNU_QUIT"), this );
fileQuitAction->setToolTip( QObject::tr("TBR_QUIT") );
fileQuitAction->setStatusTip( QObject::tr("TBR_QUIT") );
fileQuitAction->setShortcut( QObject::tr("CTRL+Q") );
connect( fileQuitAction, SIGNAL( activated() ) , qApp, SLOT( closeAllWindows() ) );
connect( fileQuitAction, SIGNAL( triggered() ) , qApp, SLOT( closeAllWindows() ) );
myStdActions.insert( FileQuitId, fileQuitAction );
viewToolAction = new QAction( QObject::tr("MNU_TOOL_BAR"), this );
viewToolAction->setToolTip( QObject::tr("TBR_TOOL_BAR") );
viewToolAction->setStatusTip( QObject::tr("TBR_TOOL_BAR") );
connect( viewToolAction, SIGNAL( activated() ) , this, SLOT( onViewToolBar() ));
connect( viewToolAction, SIGNAL( triggered() ) , this, SLOT( onViewToolBar() ));
viewToolAction->setCheckable( true );
viewToolAction->setChecked( true );
myStdActions.insert( ViewToolId, viewToolAction );
@@ -96,7 +96,7 @@ void ApplicationCommonWindow::createStandardOperations()
viewStatusAction = new QAction( QObject::tr("MNU_STATUS_BAR"), this );
viewStatusAction->setToolTip( QObject::tr("TBR_STATUS_BAR") );
viewStatusAction->setStatusTip( QObject::tr("TBR_STATUS_BAR") );
connect( viewStatusAction, SIGNAL( activated() ), this, SLOT( onViewStatusBar() ));
connect( viewStatusAction, SIGNAL( triggered() ), this, SLOT( onViewStatusBar() ));
viewStatusAction->setCheckable( true );
viewStatusAction->setChecked( true );
myStdActions.insert( ViewStatusId, viewStatusAction );
@@ -105,7 +105,7 @@ void ApplicationCommonWindow::createStandardOperations()
helpAboutAction->setToolTip( QObject::tr( "TBR_ABOUT" ) );
helpAboutAction->setStatusTip( QObject::tr( "TBR_ABOUT" ) );
helpAboutAction->setShortcut( QObject::tr( "F1" ) );
connect( helpAboutAction, SIGNAL( activated() ) , this, SLOT( onAbout() ) );
connect( helpAboutAction, SIGNAL( triggered() ) , this, SLOT( onAbout() ) );
myStdActions.insert( HelpAboutId, helpAboutAction );
// popuplate a menu with all actions
@@ -151,37 +151,37 @@ void ApplicationCommonWindow::createCasCadeOperations()
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_WIRE") ), QObject::tr("MNU_TOOL_WIRE"), this );
a->setToolTip( QObject::tr("TBR_TOOL_WIRE") );
a->setStatusTip( QObject::tr("TBR_TOOL_WIRE") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolWireframeId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHAD") ), QObject::tr("MNU_TOOL_SHAD"), this );
a->setToolTip( QObject::tr("TBR_TOOL_SHAD") );
a->setStatusTip( QObject::tr("TBR_TOOL_SHAD") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolShadingId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_COLOR") ), QObject::tr("MNU_TOOL_COLOR"), this );
a->setToolTip( QObject::tr("TBR_TOOL_COLOR") );
a->setStatusTip( QObject::tr("TBR_TOOL_COLOR") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolColorId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_MATER") ), QObject::tr("MNU_TOOL_MATER"), this );
a->setToolTip( QObject::tr("TBR_TOOL_MATER") );
a->setStatusTip( QObject::tr("TBR_TOOL_MATER") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolMaterialId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_TRANS") ), QObject::tr("MNU_TOOL_TRANS"), this );
a->setToolTip( QObject::tr("TBR_TOOL_TRANS") );
a->setStatusTip( QObject::tr("TBR_TOOL_TRANS") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolTransparencyId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_DEL") ), QObject::tr("MNU_TOOL_DEL"), this );
a->setToolTip( QObject::tr("TBR_TOOL_DEL") );
a->setStatusTip( QObject::tr("TBR_TOOL_DEL") );
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
myToolActions.insert( ToolDeleteId, a );
QSignalMapper* sm = new QSignalMapper( this );
@@ -191,56 +191,56 @@ void ApplicationCommonWindow::createCasCadeOperations()
a->setToolTip( QObject::tr("TBR_BRASS") );
a->setStatusTip( QObject::tr("TBR_BRASS") );
sm->setMapping( a,(int)Graphic3d_NOM_BRASS );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_BRASS, a );
a = new QAction( QObject::tr("MNU_BRONZE"), this );
a->setToolTip( QObject::tr("TBR_BRONZE") );
a->setStatusTip( QObject::tr("TBR_BRONZE") );
sm->setMapping( a, ( int )Graphic3d_NOM_BRONZE );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_BRONZE, a );
a = new QAction( QObject::tr("MNU_COPPER"), this );
a->setToolTip( QObject::tr("TBR_COPPER") );
a->setStatusTip( QObject::tr("TBR_COPER") );
sm->setMapping( a, ( int )Graphic3d_NOM_COPPER );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_COPPER, a );
a = new QAction( QObject::tr("MNU_GOLD"), this );
a->setToolTip( QObject::tr("TBR_GOLD") );
a->setStatusTip( QObject::tr("TBR_GOLD") );
sm->setMapping( a, ( int )Graphic3d_NOM_GOLD );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_GOLD, a );
a = new QAction( QObject::tr("MNU_PEWTER"), this );
a->setToolTip( QObject::tr("TBR_PEWTER") );
a->setStatusTip( QObject::tr("TBR_PEWTER") );
sm->setMapping( a, ( int )Graphic3d_NOM_PEWTER );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_PEWTER, a );
a = new QAction( QObject::tr("MNU_PLASTER"), this );
a->setToolTip( QObject::tr("TBR_PLASTER") );
a->setStatusTip( QObject::tr("TBR_PLASTER") );
sm->setMapping( a, ( int )Graphic3d_NOM_PLASTER );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_PLASTER, a );
a = new QAction( QObject::tr("MNU_PLASTIC"), this );
a->setToolTip( QObject::tr("TBR_PLASTIC") );
a->setStatusTip( QObject::tr("TBR_PLASTIC") );
sm->setMapping( a, ( int )Graphic3d_NOM_PLASTIC );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_PLASTIC, a );
a = new QAction( QObject::tr("MNU_SILVER"), this );
a->setToolTip( QObject::tr("TBR_SILVER") );
a->setStatusTip( QObject::tr("TBR_SILVER") );
sm->setMapping( a, ( int )Graphic3d_NOM_SILVER );
connect( a, SIGNAL( activated() ), sm, SLOT( map() ) );
connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) );
myMaterialActions.insert( Graphic3d_NOM_SILVER, a );
for ( int i = 0; i < myToolActions.size(); i++ )
@@ -278,19 +278,19 @@ void ApplicationCommonWindow::windowsMenuAboutToShow()
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_NEW3D" ) ), QObject::tr( "MNU_WINDOW_NEW3D" ), this );
a->setToolTip( QObject::tr( "TBR_WINDOW_NEW3D" ) );
a->setStatusTip( QObject::tr( "TBR_WINDOW_NEW3D" ) );
connect( a, SIGNAL( activated() ), this, SLOT( onCreateNewView() ) );
connect( a, SIGNAL( triggered() ), this, SLOT( onCreateNewView() ) );
myWindowPopup->addAction( a );
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_CASCADE" ) ), QObject::tr( "MNU_WINDOW_CASCADE" ), this );
a->setToolTip( QObject::tr( "TBR_WINDOW_CASCADE" ) );
a->setStatusTip( QObject::tr( "TBR_WINDOW_CASCADE" ) );
connect( a, SIGNAL( activated() ), stWs, SLOT( cascade() ) );
connect( a, SIGNAL( triggered() ), stWs, SLOT( cascade() ) );
myWindowPopup->addAction( a );
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_TILE" ) ), QObject::tr( "MNU_WINDOW_TILE" ), this );
a->setToolTip( QObject::tr( "TBR_WINDOW_TILE" ) );
a->setStatusTip( QObject::tr( "TBR_WINDOW_TILE" ) );
connect( a, SIGNAL( activated() ), stWs, SLOT( tile() ) );
connect( a, SIGNAL( triggered() ), stWs, SLOT( tile() ) );
myWindowPopup->addAction( a );
myWindowPopup->addSeparator();

View File

@@ -86,7 +86,7 @@ void DocumentCommon::onCreateNewView()
connect( w, SIGNAL( selectionChanged() ),
this, SIGNAL( selectionChanged() ) );
connect( w, SIGNAL( message( const QString&, int ) ),
myApp->statusBar(), SLOT( message( const QString&, int ) ) );
myApp->statusBar(), SLOT( showMessage( const QString&, int ) ) );
connect( w, SIGNAL( sendCloseView( MDIWindow* ) ),
this, SLOT( onCloseView( MDIWindow* ) ) );

View File

@@ -383,13 +383,13 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITALL") ), QObject::tr("MNU_FITALL"), this );
a->setToolTip( QObject::tr("TBR_FITALL") );
a->setStatusTip( QObject::tr("TBR_FITALL") );
connect( a, SIGNAL( activated() ) , this, SLOT( fitAll() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( fitAll() ) );
myViewActions->insert(ViewFitAllId, a);
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITAREA") ), QObject::tr("MNU_FITAREA"), this );
a->setToolTip( QObject::tr("TBR_FITAREA") );
a->setStatusTip( QObject::tr("TBR_FITAREA") );
connect( a, SIGNAL( activated() ) , this, SLOT( fitArea() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( fitArea() ) );
a->setCheckable( true );
connect( a, SIGNAL( toggled( bool ) ) , this, SLOT( updateToggled( bool ) ) );
@@ -398,7 +398,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ZOOM") ), QObject::tr("MNU_ZOOM"), this );
a->setToolTip( QObject::tr("TBR_ZOOM") );
a->setStatusTip( QObject::tr("TBR_ZOOM") );
connect( a, SIGNAL( activated() ) , this, SLOT( zoom() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( zoom() ) );
a->setCheckable( true );
connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
@@ -407,7 +407,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_PAN") ), QObject::tr("MNU_PAN"), this );
a->setToolTip( QObject::tr("TBR_PAN") );
a->setStatusTip( QObject::tr("TBR_PAN") );
connect( a, SIGNAL( activated() ) , this, SLOT( pan() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( pan() ) );
a->setCheckable( true );
connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
@@ -416,7 +416,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_GLOBALPAN") ), QObject::tr("MNU_GLOBALPAN"), this );
a->setToolTip( QObject::tr("TBR_GLOBALPAN") );
a->setStatusTip( QObject::tr("TBR_GLOBALPAN") );
connect( a, SIGNAL( activated() ) , this, SLOT( globalPan() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( globalPan() ) );
a->setCheckable( true );
connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
@@ -425,49 +425,49 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FRONT") ), QObject::tr("MNU_FRONT"), this );
a->setToolTip( QObject::tr("TBR_FRONT") );
a->setStatusTip( QObject::tr("TBR_FRONT") );
connect( a, SIGNAL( activated() ) , this, SLOT( front() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( front() ) );
myViewActions->insert( ViewFrontId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BACK") ), QObject::tr("MNU_BACK"), this );
a->setToolTip( QObject::tr("TBR_BACK") );
a->setStatusTip( QObject::tr("TBR_BACK") );
connect( a, SIGNAL( activated() ) , this, SLOT( back() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( back() ) );
myViewActions->insert(ViewBackId, a);
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_TOP") ), QObject::tr("MNU_TOP"), this );
a->setToolTip( QObject::tr("TBR_TOP") );
a->setStatusTip( QObject::tr("TBR_TOP") );
connect( a, SIGNAL( activated() ) , this, SLOT( top() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( top() ) );
myViewActions->insert( ViewTopId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BOTTOM") ), QObject::tr("MNU_BOTTOM"), this );
a->setToolTip( QObject::tr("TBR_BOTTOM") );
a->setStatusTip( QObject::tr("TBR_BOTTOM") );
connect( a, SIGNAL( activated() ) , this, SLOT( bottom() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( bottom() ) );
myViewActions->insert( ViewBottomId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_LEFT") ), QObject::tr("MNU_LEFT"), this );
a->setToolTip( QObject::tr("TBR_LEFT") );
a->setStatusTip( QObject::tr("TBR_LEFT") );
connect( a, SIGNAL( activated() ) , this, SLOT( left() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( left() ) );
myViewActions->insert( ViewLeftId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RIGHT") ), QObject::tr("MNU_RIGHT"), this );
a->setToolTip( QObject::tr("TBR_RIGHT") );
a->setStatusTip( QObject::tr("TBR_RIGHT") );
connect( a, SIGNAL( activated() ) , this, SLOT( right() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( right() ) );
myViewActions->insert( ViewRightId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_AXO") ), QObject::tr("MNU_AXO"), this );
a->setToolTip( QObject::tr("TBR_AXO") );
a->setStatusTip( QObject::tr("TBR_AXO") );
connect( a, SIGNAL( activated() ) , this, SLOT( axo() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( axo() ) );
myViewActions->insert( ViewAxoId, a );
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ROTATION") ), QObject::tr("MNU_ROTATION"), this );
a->setToolTip( QObject::tr("TBR_ROTATION") );
a->setStatusTip( QObject::tr("TBR_ROTATION") );
connect( a, SIGNAL( activated() ) , this, SLOT( rotation() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( rotation() ) );
a->setCheckable( true );
connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
myViewActions->insert( ViewRotationId, a );
@@ -475,7 +475,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RESET") ), QObject::tr("MNU_RESET"), this );
a->setToolTip( QObject::tr("TBR_RESET") );
a->setStatusTip( QObject::tr("TBR_RESET") );
connect( a, SIGNAL( activated() ) , this, SLOT( reset() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( reset() ) );
myViewActions->insert( ViewResetId, a );
QActionGroup* ag = new QActionGroup( this );
@@ -483,7 +483,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLROFF") ), QObject::tr("MNU_HLROFF"), this );
a->setToolTip( QObject::tr("TBR_HLROFF") );
a->setStatusTip( QObject::tr("TBR_HLROFF") );
connect( a, SIGNAL( activated() ) , this, SLOT( hlrOff() ) );
connect( a, SIGNAL( triggered() ) , this, SLOT( hlrOff() ) );
a->setCheckable( true );
ag->addAction(a);
myViewActions->insert(ViewHlrOffId, a);
@@ -491,7 +491,7 @@ void View::initViewActions()
a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLRON") ), QObject::tr("MNU_HLRON"), this );
a->setToolTip( QObject::tr("TBR_HLRON") );
a->setStatusTip( QObject::tr("TBR_HLRON") );
connect( a, SIGNAL( activated() ) ,this, SLOT( hlrOn() ) );
connect( a, SIGNAL( triggered() ) ,this, SLOT( hlrOn() ) );
a->setCheckable( true );
ag->addAction(a);
@@ -850,7 +850,7 @@ void View::Popup( const int /*x*/, const int /*y*/ )
QMenu* myBackMenu = new QMenu( 0 );
QAction* a = new QAction( QObject::tr("MNU_CH_BACK"), this );
a->setToolTip( QObject::tr("TBR_CH_BACK") );
connect( a,SIGNAL( activated() ), this, SLOT( onBackground() ) );
connect( a,SIGNAL( triggered() ), this, SLOT( onBackground() ) );
myBackMenu->addAction( a );
addItemInPopup(myBackMenu);
myBackMenu->exec( QCursor::pos() );