mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0029021: Coding Rules - eliminate GCC warnings in Qt sample
This commit is contained in:
parent
41f97958c0
commit
aa17dac878
@ -22,15 +22,16 @@ static ApplicationCommonWindow* stApp = 0;
|
||||
static QMdiArea* stWs = 0;
|
||||
|
||||
ApplicationCommonWindow::ApplicationCommonWindow()
|
||||
: QMainWindow( 0 ),
|
||||
myWindowPopup( 0 ),
|
||||
myFilePopup( 0 ),
|
||||
: QMainWindow( 0 ),
|
||||
myNbDocuments( 0 ),
|
||||
myIsDocuments(false),
|
||||
myStdToolBar( 0 ),
|
||||
myCasCadeBar( 0 ),
|
||||
myStdToolBar( 0 )
|
||||
myFilePopup( 0 ),
|
||||
myWindowPopup( 0 ),
|
||||
myFileSeparator(NULL)
|
||||
{
|
||||
myNbDocuments = 0;
|
||||
stApp = this;
|
||||
myIsDocuments = false;
|
||||
|
||||
// create and define the central widget
|
||||
QFrame* vb = new QFrame( this );
|
||||
@ -346,48 +347,51 @@ ApplicationCommonWindow* ApplicationCommonWindow::getApplication()
|
||||
|
||||
void ApplicationCommonWindow::updateFileActions()
|
||||
{
|
||||
if ( myDocuments.isEmpty() )
|
||||
if (!myDocuments.isEmpty())
|
||||
{
|
||||
if ( !myIsDocuments )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !myIsDocuments )
|
||||
{
|
||||
QAction* fileQuitAction = NULL;
|
||||
QAction* windowAction = NULL;
|
||||
QList<QAction *> aListActions = myFilePopup->actions();
|
||||
for ( int i = 0; i < aListActions.size(); i++ )
|
||||
{
|
||||
QAction *fileQuitAction, *windowAction;
|
||||
QList<QAction *> aListActions = myFilePopup->actions();
|
||||
for ( int i = 0; i < aListActions.size(); i++ )
|
||||
if( aListActions.at( i )->text() == QObject::tr("MNU_QUIT") )
|
||||
{
|
||||
if( aListActions.at( i )->text() == QObject::tr("MNU_QUIT") )
|
||||
{
|
||||
fileQuitAction = aListActions.at( i );
|
||||
break;
|
||||
}
|
||||
fileQuitAction = aListActions.at( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !fileQuitAction )
|
||||
return;
|
||||
if( !fileQuitAction )
|
||||
return;
|
||||
|
||||
myIsDocuments = true;
|
||||
myCasCadeBar->show();
|
||||
myIsDocuments = true;
|
||||
myCasCadeBar->show();
|
||||
|
||||
QList<QAction *> aListMenuActions = menuBar()->actions();
|
||||
for ( int i = 0; i < aListMenuActions.size(); i++ )
|
||||
{
|
||||
if( aListMenuActions.at( i )->text() == QObject::tr("MNU_HELP") )
|
||||
{
|
||||
windowAction= aListMenuActions.at( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !windowAction )
|
||||
return;
|
||||
|
||||
menuBar()->insertMenu( windowAction, myWindowPopup );
|
||||
}
|
||||
else
|
||||
QList<QAction *> aListMenuActions = menuBar()->actions();
|
||||
for ( int i = 0; i < aListMenuActions.size(); i++ )
|
||||
{
|
||||
myIsDocuments = false;
|
||||
myCasCadeBar->hide();
|
||||
menuBar()->removeAction( myWindowPopup->menuAction() );
|
||||
if( aListMenuActions.at( i )->text() == QObject::tr("MNU_HELP") )
|
||||
{
|
||||
windowAction= aListMenuActions.at( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !windowAction )
|
||||
return;
|
||||
|
||||
menuBar()->insertMenu( windowAction, myWindowPopup );
|
||||
}
|
||||
else
|
||||
{
|
||||
myIsDocuments = false;
|
||||
myCasCadeBar->hide();
|
||||
menuBar()->removeAction( myWindowPopup->menuAction() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,7 @@ void MDIWindow::onWindowActivated ()
|
||||
void MDIWindow::dump()
|
||||
{
|
||||
QString datadir = (QString(qgetenv ("CSF_OCCTDataPath").constData()) + "/images");
|
||||
static QString filter;
|
||||
filter = "Images Files (*.bmp *.ppm *.png *.jpg *.tiff *.tga *.gif *.exr *.ps *.eps *.tex *.pdf *.svg *.pgf)";
|
||||
QString filter = "Images Files (*.bmp *.ppm *.png *.jpg *.tiff *.tga *.gif *.exr)";
|
||||
QFileDialog fd ( 0 );
|
||||
fd.setModal( true );
|
||||
fd.setNameFilter ( filter );
|
||||
@ -135,7 +134,7 @@ void MDIWindow::dump()
|
||||
if ( !res )
|
||||
{
|
||||
QWidgetList list = qApp->allWidgets();
|
||||
QWidget* mainWidget;
|
||||
QWidget* mainWidget = NULL;
|
||||
for( int i = 0; i < list.size(); ++i )
|
||||
{
|
||||
if( qobject_cast<ApplicationCommonWindow*>( list.at( i ) ) )
|
||||
|
@ -1034,33 +1034,6 @@ void View::onEnvironmentMap()
|
||||
|
||||
bool View::dump(Standard_CString theFile)
|
||||
{
|
||||
myView->Redraw();
|
||||
QString ext = QFileInfo( QString( theFile ) ).completeSuffix();
|
||||
if ( !ext.compare("ps") || !ext.compare("eps") || !ext.compare("tex") || !ext.compare("pdf") || !ext.compare("svg") || !ext.compare("pgf") )
|
||||
{
|
||||
Graphic3d_ExportFormat exFormat;
|
||||
if ( !ext.compare("ps") )
|
||||
exFormat = Graphic3d_EF_PostScript;
|
||||
if ( !ext.compare("eps") )
|
||||
exFormat = Graphic3d_EF_EnhPostScript;
|
||||
if ( !ext.compare("tex") )
|
||||
exFormat = Graphic3d_EF_TEX;
|
||||
if ( !ext.compare("pdf") )
|
||||
exFormat = Graphic3d_EF_PDF;
|
||||
if ( !ext.compare("svg") )
|
||||
exFormat = Graphic3d_EF_SVG;
|
||||
if ( !ext.compare("pgf") )
|
||||
exFormat = Graphic3d_EF_PGF;
|
||||
try
|
||||
{
|
||||
myView->Export( theFile, exFormat );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return myView->Dump(theFile);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ void BaseDriver::Results(TDF_LabelList& res) const
|
||||
}
|
||||
|
||||
// Execution.
|
||||
Standard_Integer BaseDriver::Execute(Handle(TFunction_Logbook)& log) const
|
||||
Standard_Integer BaseDriver::Execute(Handle(TFunction_Logbook)& ) const
|
||||
{
|
||||
#ifdef SLOW
|
||||
// Make a boolean operation to slow down the function
|
||||
|
@ -59,7 +59,7 @@ void SimpleDriver::Results(TDF_LabelList& res) const
|
||||
}
|
||||
|
||||
// Execution.
|
||||
Standard_Integer SimpleDriver::Execute(Handle(TFunction_Logbook)& log) const
|
||||
Standard_Integer SimpleDriver::Execute(Handle(TFunction_Logbook)& ) const
|
||||
{
|
||||
// Check initialization
|
||||
if (Label().IsNull())
|
||||
|
@ -245,30 +245,19 @@ bool Translate::exportModel( const int format, const Handle(AIS_InteractiveConte
|
||||
|
||||
bool Translate::exportModel( const int format, const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes )
|
||||
{
|
||||
bool status;
|
||||
try {
|
||||
switch ( format )
|
||||
{
|
||||
case FormatBREP:
|
||||
status = exportBREP( file, shapes );
|
||||
break;
|
||||
case FormatIGES:
|
||||
status = exportIGES( file, shapes );
|
||||
break;
|
||||
case FormatSTEP:
|
||||
status = exportSTEP( file, shapes );
|
||||
break;
|
||||
case FormatSTL:
|
||||
status = exportSTL( file, shapes );
|
||||
break;
|
||||
case FormatVRML:
|
||||
status = exportVRML( file, shapes );
|
||||
break;
|
||||
case FormatBREP: return exportBREP( file, shapes );
|
||||
case FormatIGES: return exportIGES( file, shapes );
|
||||
case FormatSTEP: return exportSTEP( file, shapes );
|
||||
case FormatSTL: return exportSTL ( file, shapes );
|
||||
case FormatVRML: return exportVRML( file, shapes );
|
||||
}
|
||||
} catch ( Standard_Failure ) {
|
||||
status = false;
|
||||
//
|
||||
}
|
||||
return status;
|
||||
return false;
|
||||
}
|
||||
|
||||
Handle(TopTools_HSequenceOfShape) Translate::getShapes( const Handle(AIS_InteractiveContext)& ic )
|
||||
@ -522,6 +511,9 @@ bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequence
|
||||
case IFSelect_RetVoid:
|
||||
myInfo = QObject::tr( "INF_NOTHING_ERROR" );
|
||||
break;
|
||||
case IFSelect_RetStop:
|
||||
case IFSelect_RetDone:
|
||||
break;
|
||||
}
|
||||
return status == IFSelect_RetDone;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user