# Qt4
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
-INCLUDE(${QT_USE_FILE})
# PyQt4
FIND_PACKAGE(SalomePyQt4 REQUIRED)
-# Optional prerequisites for GUI
+# Optional packages for GUI and their pre-requisites
+
+# - GL viewer: no prereqs
IF(NOT SALOME_USE_GLVIEWER)
ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
ENDIF()
+
+# - OCC viewer: no prereqs
IF(NOT SALOME_USE_OCCVIEWER)
ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
ENDIF()
+
+# - PV viewer: ParaView
+IF (SALOME_USE_PVVIEWER)
+ FIND_PACKAGE(SalomeParaView)
+ SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER)
+ELSE()
+ ADD_DEFINITIONS("-DDISABLE_PVVIEWER")
+ENDIF()
+
+# - VTK viewer: VTK
IF(SALOME_USE_VTKVIEWER)
# Required components are listed in the FindSalomeVTK.cmake file:
FIND_PACKAGE(SalomeVTK)
ELSE()
ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
ENDIF()
+
+# - Plot2d viewer: Qwt
IF(SALOME_USE_PLOT2DVIEWER)
FIND_PACKAGE(SalomeQwt)
SALOME_LOG_OPTIONAL_PACKAGE(Qwt SALOME_USE_PLOT2DVIEWER)
ELSE()
ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
ENDIF()
-IF (SALOME_USE_PVVIEWER)
- FIND_PACKAGE(SalomeParaView)
- SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER)
-ELSE()
- ADD_DEFINITIONS("-DDISABLE_PVVIEWER")
-ENDIF()
+
+# - Graphics viewer: no prereqs
IF (NOT SALOME_USE_GRAPHICSVIEW)
ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW")
ENDIF()
+
+# - Python editor: no prereqs
IF (NOT SALOME_USE_PYVIEWER)
ADD_DEFINITIONS("-DDISABLE_PYVIEWER")
ENDIF()
+
+# - Python console: no prereqs
IF(SALOME_USE_PYCONSOLE)
# Build with obsolete Python module's methods
ADD_DEFINITIONS(-DCALL_OLD_METHODS)
ELSE()
ADD_DEFINITIONS("-DDISABLE_PYCONSOLE")
ENDIF()
+
+# - Qx viewer: no prereqs
IF(NOT SALOME_USE_QXGRAPHVIEWER)
ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER")
ENDIF()
+
+# - SALOME object: no prereqs
IF(NOT SALOME_USE_SALOMEOBJECT)
ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
ENDIF()
# Create the configuration files:
# - in the build tree:
-# Ensure the variables are always defined for the configure:
+# Ensure the variables are always defined for the configure:
SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}")
SET_AND_CHECK(QWT_ROOT_DIR_EXP "@PACKAGE_QWT_ROOT_DIR@")
ENDIF()
-# For all prerequisites, load the corresponding targets if the package was used
+# For all prerequisites, load the corresponding targets if the package was used
# in CONFIG mode. This ensures dependent projects link correctly
# without having to set LD_LIBRARY_PATH:
-SET(_PREREQ @_PREREQ_LIST@)
-SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
-SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
-LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
-IF(NOT _list_len EQUAL 0)
+SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
+LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
+IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
- MATH(EXPR _range "${_list_len}-1")
- FOREACH(_p RANGE ${_range})
- LIST(GET _PREREQ ${_p} _pkg )
- LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
- LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
- MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
- IF(NOT _pkg_compo)
- FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
- PATHS "${_pkg_dir}"
- NO_DEFAULT_PATH)
- ELSE()
- STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
- MESSAGE(STATUS "===> (components: ${_pkg_compo})")
- FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
- COMPONENTS ${_compo_lst}
- PATHS "${_pkg_dir}"
- NO_DEFAULT_PATH)
+ MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
+ FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
+ LIST(GET _PREREQ_@PROJECT_NAME@ ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@ )
+ LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
+ LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
+ IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
+ MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
+ IF(NOT _pkg_compo_@PROJECT_NAME@)
+ FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+ PATHS "${_pkg_dir_@PROJECT_NAME@}"
+ NO_DEFAULT_PATH)
+ ELSE()
+ STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
+ MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
+ FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+ COMPONENTS ${_compo_lst_@PROJECT_NAME@}
+ PATHS "${_pkg_dir_@PROJECT_NAME@}"
+ NO_DEFAULT_PATH)
+ ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
# Author: Adrien Bruneton
#
-# Graphviz detection for salome
+# ParaView detection for salome
#
# !! Please read the generic detection procedure in SalomeMacros.cmake !!
#
+IF(NOT QT_VERSION)
+ MESSAGE(FATAL_ERROR "Detection of ParaView requires Qt to be detected first!")
+ENDIF()
+
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParaView PARAVIEW_USE_FILE 4)
-#MARK_AS_ADVANCED()
INCLUDE(${PARAVIEW_USE_FILE})
#
# !! Please read the generic detection procedure in SalomeMacros.cmake !!
#
+
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt4 QT_INCLUDES 2)
MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE)
+# This is only needed to correctly detect Qt help generator tool, to workaround an error
+# coming from ParaView detection procedure
+FIND_PROGRAM(QT_HELP_GENERATOR qhelpgenerator
+ PATHS "${QT_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+ DOC "qhelpgenerator used to compile Qt help project files"
+ )
+MARK_AS_ADVANCED(QT_HELP_GENERATOR)
+
IF(QT4_FOUND)
SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)
SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY})
+ SET(QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
+ MESSAGE(STATUS "Qt version is ${QT_VERSION}")
ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(${QT_USE_FILE})
+
INSTALL(CODE "MACRO(QT4_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE)
FILE(MAKE_DIRECTORY \${MYFULLDIR})
MESSAGE(STATUS \"Compiling \${MYTSFILE}\")
bool save = false;
if ( !stdDoc().IsNull() && stdDoc()->IsSaved() )
{
- QString path = QDir::convertSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
- save = path == QDir::convertSeparators( fname );
+ QString path = QDir::toNativeSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
+ save = path == QDir::toNativeSeparators( fname );
}
bool status = false;
# --- options ---
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
# additional preprocessor / compiler flags
ADD_DEFINITIONS(${QT_DEFINITIONS})
}
aBuffer+="closepath\nstroke\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
}
aBuffer+="PU;\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
}
return true;
if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
{
- isFound = FALSE;
+ isFound = false;
count++;
for ( it = myCurSelNumbers.begin(); it != myCurSelNumbers.end(); ++it )
if( i == *it )
{
- isFound = TRUE;
+ isFound = true;
curHNumbers.append( i );
}
count++;
if ( isShift )
{
- bool isFound = FALSE;
+ bool isFound = false;
for( it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it )
if ( *it == i )
{
myUSelNumbers.append( *it );
remIt = it;
- isFound = TRUE;
+ isFound = true;
break;
}
bool GLViewer_MarkerSet::addOrRemoveSelected( int index )
{
if( index < 0 || index > myNumber )
- return FALSE;
+ return false;
int n = mySelNumbers.indexOf( index );
if( n == -1 )
mySelNumbers.removeAt(n);
myUSelNumbers.append( index );
}
- return TRUE;
+ return true;
}
/*!
aBuffer+="closepath\nstroke\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
aBuffer+="PU;\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
AddCoordsToPS( aBuffer, "moveto", aViewerCS, aPSCS, double(xPos), double(yPos) );
aBuffer += "(" + aText + ") show\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
aBuffer = "LB" + aText + "#;";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
y = double( yPos );
aViewerCS->transform( *aEMFCS, x, y );
- const char* str = aText.toAscii();
+ const char* str = aText.toLatin1();
int nHeight = 35*14; // height of font
int nWidth = 35*12; // average character width
int nEscapement = 0; // angle of escapement
int nOrientation = 0; // base-line orientation angle
int fnWeight = FW_NORMAL; // font weight
- DWORD fdwItalic = FALSE; // italic attribute option
- DWORD fdwUnderline = FALSE; // underline attribute option
- DWORD fdwStrikeOut = FALSE; // strikeout attribute option
+ DWORD fdwItalic = false; // italic attribute option
+ DWORD fdwUnderline = false; // underline attribute option
+ DWORD fdwStrikeOut = false; // strikeout attribute option
DWORD fdwCharSet = ANSI_CHARSET; // character set identifier
DWORD fdwOutputPrecision = OUT_DEFAULT_PRECIS; // output precision
DWORD fdwClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
QRegion circle( (int)(theX - theTol), (int)(theY - theTol),
(int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse );
if( isCircle )
- intersection = obj.intersect( circle );
+ intersection = obj.intersected( circle );
else
- intersection = obj.intersect( region );
+ intersection = obj.intersected( region );
if( intersection.isEmpty() )
myIsHigh = false;
QRegion circle( (int)(theX - theTol), (int)(theY - theTol),
(int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse );
if( isCircle )
- intersection = obj.intersect( circle );
+ intersection = obj.intersected( circle );
else
- intersection = obj.intersect( region );
+ intersection = obj.intersected( region );
if( intersection.isEmpty() )
myIsSel = false;
if( myLastPickedChanged || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( anUpdatedObjects, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( anUpdatedObjects, true, true );
return 0;
}
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 && status == SS_Invalid )
status = SS_GlobalChanged;
&& mySelectedObjects.indexOf( myLastPicked ) == -1 )
{
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
if( status == SS_Invalid )
status = SS_GlobalChanged;
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 )
status = SS_GlobalChanged;
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 )
status = SS_GlobalChanged;
{
myLastPicked = *oit;
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
status = SS_GlobalChanged;
return status;
}
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
return status;
}
if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() )
{
mySelCurIndex++;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*!
{
//QRect* rect = object->getRect()->toQRect();
//myGLViewer2d->updateBorders( *rect );
- myGLViewer2d->activateDrawer( object, FALSE );
+ myGLViewer2d->activateDrawer( object, false );
}
}
else
}
if( updateViewer )
- myGLViewer2d->activateDrawers( aList, TRUE );
+ myGLViewer2d->activateDrawers( aList, true );
mySelectedObjects.clear();
}
if( myActiveObjects.contains( object ) && !mySelectedObjects.contains( object ) )
{
- object->setSelected( TRUE );
+ object->setSelected( true );
mySelectedObjects.append( object );
}
if( updateViewer )
- myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( object, true, true );
}
/*!
object->unselect();
if( updateViewer )
- myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( object, true, true );
}
/*!
*\paran byCircle - true if needs round sensitive area around mouse cursor, else rectangle
*function search object rectangle which intersect with sensitive area and call object highlight method
*/
- int MoveTo( int x, int y, bool byCircle = FALSE );
+ int MoveTo( int x, int y, bool byCircle = false );
/*! A function selecting already highlighting object by calling object method select
*\param Append - true if new selection will be append to existing selection, false - another
*\param byCircle - true if needs round selection area in complex object
*/
- int Select( bool Append = FALSE, bool byCircle = FALSE );
+ int Select( bool Append = false, bool byCircle = false );
/*! A function selecting objects on scene by rectangle
*\param theRect - rectangle of selection
*\param Append - true if new selection will be append to existing selection, false - another
*function search object rectangle which intersect with theRect and call object select method
*/
- int SelectByRect( const QRect& theRect, bool Append = FALSE );
+ int SelectByRect( const QRect& theRect, bool Append = false );
//! A function installing highlight color for all presentation (does not work)
void SetHighlightColor( Quantity_NameOfColor aCol );
{
glDeleteLists( myGridList, 1 );
if ( glGetError() != GL_NO_ERROR )
- return FALSE;
+ return false;
}
float xLoc = (int)(myXPan / myXSize) * myXSize;
glEndList();
}
- return TRUE;
+ return true;
}
Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
mypLabel->setObjectName("ObjectTipText");
mypLabel->setMargin( 1 );
- //mypLabel->setAutoMask( FALSE );
+ //mypLabel->setAutoMask( false );
mypLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
mypLabel->setLineWidth( 1 );
mypLabel->setAlignment( Qt::AlignAbsolute | Qt::AlignTop );
aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onDumpView()));
toolMgr()->registerAction( aAction, DumpId );
// FitAll
aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ),
tr( "MNU_FITALL" ), 0, this);
aAction->setStatusTip(tr("DSC_FITALL"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitAll()));
toolMgr()->registerAction( aAction, FitAllId );
// FitRect
aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ),
tr( "MNU_FITRECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITRECT"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitArea()));
toolMgr()->registerAction( aAction, FitRectId );
// FitSelect
aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ),
tr( "MNU_FITSELECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITSELECT"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitSelect()));
toolMgr()->registerAction( aAction, FitSelectId );
// Zoom
aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewZoom()));
toolMgr()->registerAction( aAction, ZoomId );
// Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ),
tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewPan()));
toolMgr()->registerAction( aAction, PanId );
// Global Panning
aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewGlobalPan()));
toolMgr()->registerAction( aAction, GlobalPanId );
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onViewReset()));
toolMgr()->registerAction( aAction, ResetId );
}
myGLWidget = new GLViewer_Widget( this, 0 ) ;
qbl->addWidget( myGLWidget );
myGLWidget->setFocusProxy( this );
- setMouseTracking( TRUE );
+ setMouseTracking( true );
myIsDragProcess = noDrag;
//myCurDragMousePos = QPoint();
GLfloat zoom, xzoom, yzoom;
GLfloat w = x;
GLfloat h = y;
- bool max = FALSE;
+ bool max = false;
xzoom = (GLfloat)x / myWidth;
yzoom = (GLfloat)y / myHeight;
zoom = yzoom;
else
{
- max = TRUE;
+ max = true;
zoom = xzoom > yzoom ? xzoom : yzoom;
}
*/
- activateAllDrawers( TRUE );
+ activateAllDrawers( true );
}
/*!
header += "%%Pages: 1\n";
header += "%%Page: 1\n\n";
- hFile.write( header.toAscii() );
+ hFile.write( header.toLatin1() );
}
else if( aType == HPGL )
{
header += "LT;\n";
header += "VS36;\n";
- hFile.write( header.toAscii() );
+ hFile.write( header.toLatin1() );
}
}
if( aType == POST_SCRIPT )
{
QString ending = "showpage\n\n%%EOF";
- hFile.write( ending.toAscii() );
+ hFile.write( ending.toLatin1() );
}
else if( aType == HPGL )
{
QString ending = "PU;PA0,0;SP;EC;PG1;EC1;OE\n";
- hFile.write( ending.toAscii() );
+ hFile.write( ending.toLatin1() );
}
}
if ( !getActiveView() )
return false;
- QFile hFile( FileName.toAscii() );
+ QFile hFile( FileName.toLatin1() );
#ifdef WIN32
HDC hMetaFileDC;
HDC screen_dc = GetDC( 0 ); //The screen device context
HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen
- hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toAscii(), &r, "" );
+ hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toLatin1(), &r, "" );
SetMapMode( hMetaFileDC, MM_HIMETRIC );
SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL );
HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH );
arg( AW-mmLeft-mmRight ).arg( AH-mmBottom-mmTop );
//It is set clipping path
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
aCurVP->getGLWidget()->translateBackgroundToPS( hFile, &aViewerCS, &aPaperCS );
}
aBuffer += "> false 3 colorimage\n\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
}
}
//=======================================================================
GraphicsView_Object::~GraphicsView_Object()
{
- QListIterator<QGraphicsItem*> aChildIter( children() );
+ QListIterator<QGraphicsItem*> aChildIter( childItems() );
while( aChildIter.hasNext() )
{
if( QGraphicsItem* aChild = aChildIter.next() )
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
+
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
+
# --- options ---
# additional include directories
#include "qtlocalpeer.h"
#include <QCoreApplication>
#include <QTime>
+#include <QDataStream>
#if defined(Q_OS_WIN)
#include <QLibrary>
Qt::HANDLE mutex;
if (doCreate) {
- QT_WA( { mutex = CreateMutexW(NULL, FALSE, (LPCWSTR)mname.utf16()); },
- { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } );
+ QT_WA( { mutex = CreateMutexW(NULL, false, (LPCWSTR)mname.utf16()); },
+ { mutex = CreateMutexA(NULL, false, mname.toLocal8Bit().constData()); } );
if (!mutex) {
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
return 0;
}
}
else {
- QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (LPCWSTR)mname.utf16()); },
- { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } );
+ QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, false, (LPCWSTR)mname.utf16()); },
+ { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, false, mname.toLocal8Bit().constData()); } );
if (!mutex) {
if (GetLastError() != ERROR_FILE_NOT_FOUND)
qErrnoWarning("QtLockedFile::lock(): OpenMutex failed");
}
if (rmutexes.size()) {
DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(),
- TRUE, block ? INFINITE : 0);
+ true, block ? INFINITE : 0);
if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) {
if (res != WAIT_TIMEOUT)
qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed");
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
# additional include directories
INCLUDE_DIRECTORIES(
${QT_INCLUDES}
}
if(dwMap) {
- QList<QDockWidget*> dwList = qFindChildren<QDockWidget*>( desktop() );
+ QList<QDockWidget*> dwList = desktop()->findChildren<QDockWidget*>();
for ( QList<QDockWidget*>::iterator dit = dwList.begin(); dit != dwList.end(); ++dit )
{
QDockWidget* dw = *dit;
QMap<QString, bool> tbMap, dwMap;
dockWindowsState( visArr, tbMap, dwMap );
- QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+ QList<QToolBar*> tbList = desktop()->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator it = tbList.begin(); it != tbList.end(); ++it )
{
QToolBar* tb = *it;
tbMap.insert( tb->objectName(), tb->toggleViewAction()->isChecked() );
}
- QList<QDockWidget*> dwList = qFindChildren<QDockWidget*>( desktop() );
+ QList<QDockWidget*> dwList = desktop()->findChildren<QDockWidget*>();
for ( QList<QDockWidget*>::iterator it = dwList.begin(); it != dwList.end(); ++it )
{
QDockWidget* wid = *it;
QList<QToolBar*> LightApp_Application::findToolBars( const QStringList& names )
{
QList<QToolBar*> aResult;
- QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+ QList<QToolBar*> tbList = desktop()->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) {
QToolBar* tb = *tit;
QObject* po = Qtx::findParent( tb, "QMainWindow" );
if( myObjects.contains( id ) && isObjectShown( id )!=shown )
{
Object& obj = myObjects[ id ];
- obj.myEdit->setShown( shown );
- obj.myBtn->setShown( shown );
- obj.myLabel->setShown( shown );
+ obj.myEdit->setVisible( shown );
+ obj.myBtn->setVisible( shown );
+ obj.myLabel->setVisible( shown );
if( !shown )
( ( QToolButton* )obj.myBtn )->setChecked( false );
}
if(aFileBuffer == NULL)
return false;
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
int aCurrentPos = 0;
ifstream aFile(theFileName);
#endif
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
aFile.seekg(0, ios::end);
int aFileBufferSize = aFile.tellg();
QList<QWidget*> wlist = createdWidgets();
for ( QList<QWidget*>::const_iterator wit = wlist.begin(); wit != wlist.end(); ++wit )
- lst += qFindChildren<QtxComboBox *>(*wit);
+ lst += (*wit)->findChildren<QtxComboBox*>();
return lst;
}
setModal( true );
setWindowTitle( tr("TLT_RENAME") );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
myButtonOk = new QPushButton( GroupButtons );
myButtonOk->setObjectName( "buttonOk" );
myButtonOk->setText( tr( "BUT_OK" ) );
- myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
+ myButtonOk->setAutoDefault( true ); myButtonOk->setDefault( true );
GroupButtonsLayout->addWidget( myButtonOk );
GroupButtonsLayout->addStretch();
myButtonCancel = new QPushButton( GroupButtons );
myButtonCancel->setObjectName( "buttonCancel" );
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
- myButtonCancel->setAutoDefault( TRUE );
+ myButtonCancel->setAutoDefault( true );
GroupButtonsLayout->addWidget( myButtonCancel );
/***************************************************************/
/*!
* \brief Constructor
*
-* Constructor sets myModule in NULL and myIsAutoResumed in TRUE
+* Constructor sets myModule in NULL and myIsAutoResumed in \c true
*/
LightApp_Operation::LightApp_Operation()
: SUIT_Operation( 0 ),
* Autoresume property is used during automatic resuming operation. If operation is
* suspended and cursor is moved above dialog of the operation then operation is resumed
* automatically (if possible). It can be resumed only program call otherwise (see
-* LightApp_SwitchOp for more description). This property is TRUE by default and may be
+* LightApp_SwitchOp for more description). This property is \c true by default and may be
* changed with setAutoResumed() method call.
*/
bool LightApp_Operation::isAutoResumed() const
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(${CAS_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData)
+SET(_link_LIBRARIES ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData)
# --- headers ---
/*!
\brief Checks whether the interactive operation is in progress.
- \return TRUE if the interaction is performed on IO object meaning
+ \return \c true if the interaction is performed on IO object meaning
that no other operations in viewer should be processed.
*/
bool OCCViewer_ClipPlaneInteractor::isPerforming() const
/*!
\brief Checks whether the interactive plane can be clicked.
- \return TRUE if the click interaction is supported for the plane.
+ \return \c true if the click interaction is supported for the plane.
*/
bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePlane )
{
/*!
\brief Checks whether the interactive plane can be dragged.
- \return TRUE if the dragging interaction is supported for the plane.
+ \return \c true if the dragging interaction is supported for the plane.
*/
bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePlane )
{
buttonOk = new QPushButton( GroupButtons );
buttonOk->setObjectName( "buttonOk" );
buttonOk->setText( tr( "BUT_APPLY_AND_CLOSE" ) );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
GroupButtonsLayout->addWidget( buttonOk );
buttonApply = new QPushButton( GroupButtons );
buttonApply->setObjectName( "buttonApply" );
buttonApply->setText( tr( "BUT_APPLY" ) );
- buttonApply->setAutoDefault( TRUE );
- buttonApply->setDefault( TRUE );
+ buttonApply->setAutoDefault( true );
+ buttonApply->setDefault( true );
GroupButtonsLayout->addWidget( buttonApply );
GroupButtonsLayout->addStretch();
buttonClose = new QPushButton( GroupButtons );
buttonClose->setObjectName( "buttonClose" );
buttonClose->setText( tr( "BUT_CLOSE" ) );
- buttonClose->setAutoDefault( TRUE );
+ buttonClose->setAutoDefault( true );
GroupButtonsLayout->addWidget( buttonClose );
QPushButton* buttonHelp = new QPushButton( tr( "HELP" ), GroupButtons );
- buttonHelp->setAutoDefault( TRUE );
+ buttonHelp->setAutoDefault( true );
GroupButtonsLayout->addWidget( buttonHelp );
/***************************************************************/
highLevel = index;
}
for( int j = lowLevel; j <= highLevel; j++ )
- myListBox->item( j )->setSelected( TRUE );
+ myListBox->item( j )->setSelected( true );
break;
}
if( myListBox->item( i )->isSelected() && i == index )
- myListBox->item( i )->setSelected( TRUE );
+ myListBox->item( i )->setSelected( true );
}
}
setModal( modal );
setWindowTitle(tr("CAPTION"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
public:
OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* ,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+ const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
~OCCViewer_SetRotationPointDlg();
void SetAction( QtxAction* theAction ) { myAction = theAction; }
{
bool isFound = false;
OCCViewer_ViewFrame* aViewFrame = dynamic_cast<OCCViewer_ViewFrame*>( theView->parent()->parent() );
- QList<QDialog*> allDialogs = qFindChildren<QDialog*>( aViewFrame );
+ QList<QDialog*> allDialogs = aViewFrame->findChildren<QDialog*>();
foreach ( QDialog* d, allDialogs )
if ( d->objectName() == theName )
isFound = true;
OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
//Support of several toolbars in the popup menu
- QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+ QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
for ( ; it!=last; it++ ) {
if ( (*it)->parentWidget()->isVisible() )
return 0;
}
-/*!
- Creates the popup. [ virtual protected ]
-*/
-/*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup )
-{
- if ( popup )
- {
- QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
- a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
- connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
- myPopupActions.append( a );
- a->addTo( popup );
- }
-}*/
-
-/*!
- Destroys the popup. [ virtual protected ]
-*/
-/*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup )
-{
- if ( popup )
- {
- for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
- a->removeFrom( popup );
- //while (!myPopupActions.isEmpty())
- // delete myPopupActions.takeFirst();
- myPopupActions.clear();
- }
-}*/
-
/*!
Performs synchronization of view parameters with the specified view.
Returns \c true if synchronization is done successfully or \c false otherwise.
virtual void zoom( int, int, int, int ) = 0;
virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
-// POPUP
-// void onCreatePopup( QPopupMenu* );
-// void onDestroyPopup( QPopupMenu* );
-
public slots:
virtual bool synchronize( OCCViewer_ViewPort* );
setObjectName( "Plot2d_FitDataDlg" );
setModal( true );
setWindowTitle( tr( "FIT_DATA_TLT" ) );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QGridLayout* topLayout = new QGridLayout( this );
topLayout->setSpacing( SPACING_SIZE );
topLayout->setMargin( MARGIN_SIZE );
// OK/Cancel buttons
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
myOkBtn->setObjectName( "buttonOk" );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
myCancelBtn->setObjectName( "buttonCancel" );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
topLayout->addWidget( myRangeGrp, 0, 0, 1, 3 );
topLayout->addWidget( myOkBtn, 1, 0 );
#include <QVariant>
#include <QStyleOption>
#include <QPaintEvent>
+#include <QTileRules>
+
#include <qwt_plot.h>
#include <qwt_painter.h>
#include <qwt_scale_map.h>
mySymbolType(0),
myPen( QPen() )
{
- myYAxisLeftIcon = yAxisLeft;
- myYAxisRightIcon = yAxisRight;
+ myYAxisLeftIcon = QPixmap(yAxisLeft);
+ myYAxisRightIcon = QPixmap(yAxisRight);
int anIconWidth = qMax( myYAxisLeftIcon.width(), myYAxisRightIcon.width() );
setSpacing( SPACING );
if(hasDeviationData()) {
painter->save();
int lineW = deviationMarkerLineWidth();
- int tickSz = deviationMarkerTickSize() + qRound(lineW/2);
+ int tickSz = deviationMarkerTickSize() + qRound(double(lineW)/2);
double min, max, xi, yi;
int xp, ytop, ybtm, tickl, tickr;
QColor c = isSelected() ? Plot2d_Object::selectionColor() : deviationMarkerColor();
{
setModal( true );
setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QGridLayout* topLayout = new QGridLayout( this );
topLayout->setSpacing( SPACING_SIZE );
/* OK/Cancel buttons */
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
- myHelpBtn->setAutoDefault( TRUE );
+ myHelpBtn->setAutoDefault( true );
QHBoxLayout* btnLayout = new QHBoxLayout;
btnLayout->addWidget( myOkBtn );
btnLayout->addStretch();
#include <qwt_plot_zoomer.h>
#include <qwt_curve_fitter.h>
#include <qwt_plot_renderer.h>
+#include <qwt_legend.h>
+#include <qwt_scale_widget.h>
#include <stdlib.h>
#include <limits>
-#include <qprinter.h>
-
-#include <qwt_legend.h>
-#include <qwt_scale_widget.h>
#define DEFAULT_LINE_WIDTH 0 // (default) line width
#define DEFAULT_MARKER_SIZE 9 // default marker size
*/
int Plot2d_ViewFrame::testOperation( const QMouseEvent& me )
{
- int btn = me.button() | me.modifiers();
- const int zoomBtn = Qt::ControlModifier | Qt::LeftButton;
- const int panBtn = Qt::ControlModifier | Qt::MidButton;
- const int fitBtn = Qt::ControlModifier | Qt::RightButton;
+ int btn = (int)me.button() | (int)me.modifiers();
+ const int zoomBtn = (int)Qt::ControlModifier | (int)Qt::LeftButton;
+ const int panBtn = (int)Qt::ControlModifier | (int)Qt::MidButton;
+ const int fitBtn = (int)Qt::ControlModifier | (int)Qt::RightButton;
int op = NoOpId;
if ( btn == zoomBtn ) {
}
}
else {
- int btn = me.button() | me.modifiers();
+ int btn = (int)me.button() | (int)me.modifiers();
if (btn == Qt::RightButton) {
QMouseEvent* aEvent = new QMouseEvent(QEvent::MouseButtonPress,
me.pos(), me.button(), me.buttons(), me.modifiers() );
#include <QTextCursor>
#include <QTextCharFormat>
#include <QRegExp>
+#include <QMimeData>
#include "PyConsole_EnhEditor.h"
#include "PyConsole_EnhInterp.h"
* If the pasted text doesn't contain a line return, no special treatment is done.
* @param source
*/
-void PyConsole_EnhEditor::insertFromMimeData(const QMimeData * source)
+void PyConsole_EnhEditor::insertFromMimeData(const QMimeData* source)
{
if (_multi_line_paste)
return;
virtual void keyPressEvent ( QKeyEvent* event);
virtual void customEvent( QEvent* event);
virtual void mousePressEvent( QMouseEvent* event );
- virtual void insertFromMimeData(const QMimeData * source);
+ virtual void insertFromMimeData(const QMimeData* source);
virtual PyInterp_Request* createTabRequest( const QString& input );
virtual void handleTab();
aMainLayout->addStretch( 1 );
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
- myHelpBtn->setAutoDefault( TRUE );
+ myHelpBtn->setAutoDefault( true );
QHBoxLayout* aButtonLayout = new QHBoxLayout;
aButtonLayout->addWidget( myOkBtn );
aButtonLayout->addStretch();
#include <QtxActionToolMgr.h>
#include <QtxMultiAction.h>
-#include <QtGui>
#include <QLocale>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QApplication>
+#include <QProcess>
+#include <QStatusBar>
+#include <QTextStream>
/*!
\class PyViewer_ViewWindow
while ( flag )
{
if ( flags & flag && widget( flag ) )
- widget( flag )->setShown( visible );
+ widget( flag )->setVisible( visible );
flag = flag >> 1;
}
}
if ( pos != -1 )
{
int i = 1;
- while ( i <= rx.numCaptures() && varName.isEmpty() )
+ while ( i <= rx.captureCount() && varName.isEmpty() )
{
QString capStr = rx.cap( i );
if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
int end = start + varName.length();
if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
- if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
+ if ( capIdx < rx.captureCount() && !rx.cap( capIdx - 1 ).isEmpty() )
end++;
len = end - start;
}
{
QImage res = img;
- int colNum = res.numColors();
+ int colNum = res.colorCount();
if ( colNum )
{
for ( int i = 0; i < colNum; i++ )
QString pattern = title.toLower();
QToolBar* res = 0;
- QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+ QList<QToolBar*> toolbars = mw->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end() && !res; ++it )
{
if ( (*it)->windowTitle().toLower() == pattern )
*/
void QtxColorButton::updateState()
{
- QList<QToolButton*> bList = qFindChildren<QToolButton*>( menu() );
+ QList<QToolButton*> bList = menu()->findChildren<QToolButton*>();
for ( QList<QToolButton*>::iterator cit = bList.begin(); cit != bList.end(); ++cit )
updateButton( *cit );
}
if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier )
{
- QObject* tab = qFindChild<QTabWidget*>( this );
+ QObject* tab = this->findChild<QTabWidget*>();
if ( tab && !property( "in_tab_event" ).toBool() ) {
setProperty( "in_tab_event", true );
QApplication::sendEvent( tab, e );
if ( !mw )
return;
- QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+ QList<QToolBar*> toolbars = mw->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end(); ++it )
{
QToolBar* tb = *it;
if ( !mw )
return;
- QList<QDockWidget*> dockwidgets = qFindChildren<QDockWidget*>( mw );
+ QList<QDockWidget*> dockwidgets = mw->findChildren<QDockWidget*>();
for ( QList<QDockWidget*>::iterator it = dockwidgets.begin(); it != dockwidgets.end(); ++it )
{
QDockWidget* dw = *it;
myMode = mode;
- myFamily->setShown( myMode == Native );
- myCustomFams->setShown( myMode == Custom );
+ myFamily->setVisible( myMode == Native );
+ myCustomFams->setVisible( myMode == Custom );
updateGeometry();
}
myMain->layout()->removeEventFilter( this );
}
- QTimer* t = qFindChild<QTimer*>( myMain->layout() );
+ QTimer* t = myMain->layout()->findChild<QTimer*>();
if ( t ) {
if ( on )
t->installEventFilter( this );
{
QStringList fList = prepareFilters( entry.filter );
if ( !fList.isEmpty() )
- entry.dlg->setFilters( fList );
+ entry.dlg->setNameFilters( fList );
}
entry.dlg->selectFile( fileName( id ) );
return;
if ( Qtx::extension( fName ).isEmpty() && !isDir )
- fName = autoExtension( fName, entry.dlg->selectedFilter() );
+ fName = autoExtension( fName, entry.dlg->selectedNameFilter() );
- fName = QDir::convertSeparators( fName );
- QString prev = QDir::convertSeparators( fileName( id ) );
+ fName = QDir::toNativeSeparators( fName );
+ QString prev = QDir::toNativeSeparators( fileName( id ) );
if ( isDir )
{
while ( prev.length() && prev.at( prev.length() - 1 ) == QDir::separator() )
ext = ext.mid( ext.indexOf( "." ) + 1 );
if ( !ext.isEmpty() && !ext.contains( "*" ) )
- fName = QDir::convertSeparators( fName ) + QString( "." ) + ext;
+ fName = QDir::toNativeSeparators( fName ) + QString( "." ) + ext;
}
return fName;
}
if ( !path.isEmpty() )
- myPath->setText( QDir::convertSeparators( path ) );
+ myPath->setText( QDir::toNativeSeparators( path ) );
myPath->setFocus();
*/
void QtxPreferenceItem::setIcon( const QIcon& ico )
{
- if ( myIcon.serialNumber() == ico.serialNumber() )
+ if ( myIcon.cacheKey() == ico.cacheKey() )
return;
myIcon = ico;
}
if( !path.isEmpty() )
{
- QString fname = QDir::convertSeparators( path );
+ QString fname = QDir::toNativeSeparators( path );
QFileInfo inf( fname );
fname = inf.absoluteFilePath();
return fname;
QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const
{
QTranslator* trans = new QtxTranslator( 0 );
- QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) );
+ QString fname = QDir::toNativeSeparators( fileName( sect, prefix, name ) );
if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) )
{
delete trans;
}
else if ( section == "import" )
{
- QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
+ QString impFile = QDir::toNativeSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
QFileInfo impFInfo( impFile );
if ( impFInfo.isRelative() )
impFInfo.setFile( aFinfo.absoluteDir(), impFile );
}
else if ( sectElem.tagName() == importTag() && sectElem.hasAttribute( nameAttribute() ) )
{
- QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
+ QString impFile = QDir::toNativeSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
QFileInfo impFInfo( impFile );
if ( impFInfo.isRelative() )
impFInfo.setFile( aFinfo.absoluteDir(), impFile );
myModWidget_layout->setMargin( 0 );
myClose = new QToolButton( myBtnWidget );
- myClose->setIcon( QIcon( close_xpm ) );
+ myClose->setIcon( QPixmap( close_xpm ) );
myClose->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myClose ) );
connect( myClose, SIGNAL( clicked() ), this, SLOT( hide() ) );
myData->installEventFilter( this );
myToFirst = new QToolButton( myBtnWidget );
- myToFirst->setIcon( QIcon( first_xpm ) );
+ myToFirst->setIcon( QPixmap( first_xpm ) );
myToFirst->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToFirst ), 0 );
connect( myToFirst, SIGNAL( clicked() ), this, SLOT( findFirst() ) );
myToFirst->installEventFilter( this );
myPrev = new QToolButton( myBtnWidget );
- myPrev->setIcon( QIcon( prev_xpm ) );
+ myPrev->setIcon( QPixmap( prev_xpm ) );
myPrev->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myPrev ), 0 );
connect( myPrev, SIGNAL( clicked() ), this, SLOT( findPrevious() ) );
myPrev->installEventFilter( this );
myNext = new QToolButton( myBtnWidget );
- myNext->setIcon( QIcon( next_xpm ) );
+ myNext->setIcon( QPixmap( next_xpm ) );
myNext->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myNext ), 0 );
connect( myNext, SIGNAL( clicked() ), this, SLOT( findNext() ) );
myNext->installEventFilter( this );
myToLast = new QToolButton( myBtnWidget );
- myToLast->setIcon( QIcon( last_xpm ) );
+ myToLast->setIcon( QPixmap( last_xpm ) );
myToLast->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToLast ), 0 );
connect( myToLast, SIGNAL( clicked() ), this, SLOT( findLast() ) );
QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole );
QIcon icon;
if ( iconData.isValid() ) {
- if ( qVariantCanConvert<QIcon>( iconData ) )
- icon = qVariantValue<QIcon>( iconData );
- else if ( qVariantCanConvert<QPixmap>( iconData ) )
- icon = qVariantValue<QPixmap>( iconData );
+ if ( iconData.canConvert( QVariant::Icon ) )
+ icon = iconData.value<QIcon>();
+ else if ( iconData.canConvert( QVariant::Pixmap ) )
+ icon = iconData.value<QPixmap>();
}
if( ( !lab.isEmpty() || !icon.isNull() ) &&
appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
connect( myWebView, SIGNAL( linkClicked( QUrl ) ), SLOT( linkClicked( QUrl ) ) );
connect( myWebView->page(), SIGNAL( linkHovered( QString, QString, QString ) ),
SLOT( linkHovered( QString, QString, QString ) ) );
- connect( myWebView->pageAction( QWebPage::DownloadLinkToDisk ), SIGNAL( activated() ),
+ connect( myWebView->pageAction( QWebPage::DownloadLinkToDisk ), SIGNAL( triggered() ),
SLOT( linkAction() ) );
disconnect( myWebView->pageAction( QWebPage::OpenLink ), 0, 0, 0 );
- connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( activated() ),
+ connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( triggered() ),
SLOT( linkAction() ) );
setCentralWidget( frame );
\brief Load URL
\param url path to the file to be opened in the browser
*/
-void QtxWebBrowser::load( const QString& url )
+void QtxWebBrowser::load( const QString& link )
{
- QString u = url;
- if ( !u.isEmpty() )
- myWebView->load( QUrl( u.replace('\\', '/') ) );
+ QString linkPath = link;
+ linkPath.replace('\\', '/');
+ QUrl url = linkPath;
+ if ( !url.isEmpty() ) {
+ if ( url.scheme().isEmpty() ) url.setScheme( "file" );
+ myWebView->load( url );
+ }
}
/*!
//
#include "QtxWorkspace.h"
-#include <QWidgetList>
+#include <QMdiSubWindow>
/*!
\class QtxWorkspace
\param parent parent widget
*/
QtxWorkspace::QtxWorkspace( QWidget* parent )
-: QWorkspace( parent )
+: QMdiArea( parent )
{
}
*/
void QtxWorkspace::tileVertical()
{
- QWidgetList winList = windowList();
+ QList<QMdiSubWindow *> winList = subWindowList();
if ( winList.isEmpty() )
return;
int count = 0;
- for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+ for ( QList<QMdiSubWindow *>::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
count++;
if ( !count )
return;
- if ( activeWindow() && ( activeWindow()->windowState() & Qt::WindowMaximized ) )
- activeWindow()->showNormal();
+ if ( activeSubWindow() && ( activeSubWindow()->windowState() & Qt::WindowMaximized ) )
+ activeSubWindow()->showNormal();
int y = 0;
int heightForEach = height() / count;
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
{
QWidget* win = *it;
if ( win->windowState() & Qt::WindowMinimized )
*/
void QtxWorkspace::tileHorizontal()
{
- QWidgetList winList = windowList();
+ QList<QMdiSubWindow *> winList = subWindowList();
if ( winList.isEmpty() )
return;
int count = 0;
- for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+ for ( QList<QMdiSubWindow *>::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
count++;
if ( !count )
return;
- if ( activeWindow() && activeWindow()->windowState() & Qt::WindowMaximized )
- activeWindow()->showNormal();
+ if ( activeSubWindow() && activeSubWindow()->windowState() & Qt::WindowMaximized )
+ activeSubWindow()->showNormal();
int x = 0;
int widthForEach = width() / count;
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
{
QWidget* win = *it;
if ( win->windowState() & Qt::WindowMinimized )
x += actualW;
}
}
+
+void QtxWorkspace::onSubWindowActivated( QMdiSubWindow* subWindow )
+{
+ QWidget* w = 0;
+ if ( subWindow )
+ w = subWindow->widget();
+ emit windowActivated( w );
+}
#include "Qtx.h"
-#include <QWorkspace>
+#include <QMdiArea>
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
-class QTX_EXPORT QtxWorkspace : public QWorkspace
+class QTX_EXPORT QtxWorkspace : public QMdiArea
{
Q_OBJECT
QtxWorkspace( QWidget* = 0 );
virtual ~QtxWorkspace();
+signals:
+ void windowActivated( QWidget* );
+
public slots:
void tileVertical();
void tileHorizontal();
+
+private slots:
+ void onSubWindowActivated( QMdiSubWindow* );
};
#ifdef WIN32
#include "QtxWorkspace.h"
#include <QMenu>
-#include <QWidgetList>
+#include <QMdiSubWindow>
/*!
\class QtxWorkspaceAction
{
QtxWorkspace* ws = workspace();
if ( ws )
- ws->tile();
+ ws->tileSubWindows();
}
/*!
if ( !ws )
return;
- ws->cascade();
+ ws->cascadeSubWindows();
int w = ws->width();
int h = ws->height();
- QWidgetList winList = ws->windowList();
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ QList<QMdiSubWindow *> winList = ws->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
(*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
}
*/
void QtxWorkspaceAction::updateContent()
{
- bool count = workspace() ? workspace()->windowList().count() : 0;
- action( Cascade )->setEnabled( count );
- action( Tile )->setEnabled( count );
- action( HTile )->setEnabled( count );
- action( VTile )->setEnabled( count );
+ bool hasWindows = workspace() && workspace()->subWindowList().count() > 0;
+ action( Cascade )->setEnabled( hasWindows );
+ action( Tile )->setEnabled( hasWindows );
+ action( HTile )->setEnabled( hasWindows );
+ action( VTile )->setEnabled( hasWindows );
updateWindows();
}
if ( menuActions() & Windows )
{
int index = 1;
- QWidgetList wList = ws->windowList();
- for ( QWidgetList::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
+ QList<QMdiSubWindow *> wList = ws->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
{
QWidget* wid = *it;
QAction* a = new QtxAction( wid->windowTitle(), wid->windowTitle(), 0, this, true );
- a->setChecked( wid == ws->activeWindow() );
+ a->setChecked( wid == ws->activeSubWindow() );
items.append( a );
map.insert( a, Windows + index );
}
if ( !ws )
return;
- QWidgetList wList = ws->windowList();
+ QList<QMdiSubWindow *> wList = ws->subWindowList();
if ( idx >= 0 && idx < (int)wList.count() )
wList.at( idx )->setFocus();
}
for ( QWidgetList::iterator itr = moveList.begin(); itr != moveList.end(); ++itr )
{
(*itr)->setParent( pWid );
- (*itr)->setShown( map.contains( *itr ) ? map[*itr] : false );
+ (*itr)->setVisible( map.contains( *itr ) ? map[*itr] : false );
}
}
\param wid_to widget specified the destination area
\param before specifies whether the first widget has to be moved before or after
the second widget
- \return TRUE if operation is completed successfully, FALSE otherwise
+ \return \c true if operation is completed successfully, \c false otherwise
*/
bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before )
{
/*!
\brief Group all windows in one area
- \return TRUE if operation is completed successfully, FALSE otherwise
+ \return \c true if operation is completed successfully, \c false otherwise
*/
void QtxWorkstack::stack()
{
// Buttons for possibility of switching the variants of split
myButtonPrevious = new QPushButton( this );
- myButtonPrevious->setIcon( QIcon( prev_xpm ) );
+ myButtonPrevious->setIcon( QPixmap( prev_xpm ) );
myButtonPrevious->setAutoDefault(true);
myButtonPrevious->setEnabled( false );
myButtonNext = new QPushButton( this );
- myButtonNext->setIcon( QIcon( next_xpm ) );
+ myButtonNext->setIcon( QPixmap( next_xpm ) );
myButtonNext->setAutoDefault(true);
myButtonNext->setEnabled( false );
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
INCLUDE(UsePyQt4)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
%Module SalomePyQtGUILight
+%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Import QtXml/QtXmlmod.sip
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
INCLUDE(UsePyQt4)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
PyModuleHelper* getPythonHelper()
{
LightApp_Module* module = getActiveModule();
- PyModuleHelper* helper = module ? qFindChild<PyModuleHelper*>( module, "python_module_helper" ) : 0;
+ PyModuleHelper* helper = module ? module->findChild<PyModuleHelper*>( "python_module_helper" ) : 0;
return helper;
}
myResult = (QAction*)module->createAction( myId, myTipText, icon, myMenuText, myStatusText, myKey, module, myToggle );
}
// for Python module, automatically connect action to callback slot
- PyModuleHelper* helper = qFindChild<PyModuleHelper*>( module, "python_module_helper" );
+ PyModuleHelper* helper = module->findChild<PyModuleHelper*>( "python_module_helper" );
if ( helper ) helper->connectAction( myResult );
}
}
// specific processing for ParaView viewer:
// hierarchy of ParaView viewer is much complex than for usual view;
// we look for sub-widget named "Viewport"
- QList<QWidget*> lst = qFindChildren<QWidget*>( wnd, "Viewport" );
+ QList<QWidget*> lst = wnd->findChildren<QWidget*>( "Viewport" );
if ( !lst.isEmpty() ) {
lst[0]->resize( myWndWidth, myWndHeight );
myResult = true;
QWidget* wnd = viewMgr->getActiveView();
myResult = viewMgr->getActiveView()->getId();
if ( wnd ) {
- wnd->setShown(myVisible);
+ wnd->setVisible(myVisible);
if ( !myVisible && myWidth == 0 && myHeight == 0 ) {
myWidth = 1024;
myHeight = 768;
%Feature ENABLE_CORBA
%Feature ENABLE_PLOT2D
+%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Import QtXml/QtXmlmod.sip
#include <QtxAction.h>
#include <QtxActionSet.h>
#include <QtxActionGroup.h>
+#include <QtxTreeView.h>
#include <SalomePyQt.h>
%End
QtxActionGroup( const QtxActionGroup& );
};
+class QtxTreeView : public QTreeView
+{
+%TypeHeaderCode
+#include <QtxTreeView.h>
+%End
+
+%ConvertToSubClassCode
+ if ( qobject_cast<QtxTreeView*>( sipCpp ) )
+ sipClass = sipClass_QtxTreeView;
+ else
+ sipClass = NULL;
+%End
+
+public:
+ explicit QtxTreeView( QWidget* /TransferThis/ = 0 );
+ QtxTreeView( const bool, QWidget* /TransferThis/ = 0 );
+ virtual ~QtxTreeView();
+
+signals:
+ void sortingEnabled( bool );
+ void selectionChanged();
+
+private:
+ QtxTreeView( const QtxTreeView& );
+};
+
enum VisibilityState
{
ShownState,
onOpenDoc( aName );
}
-/*! \retval true, if document was opened successful, else false.*/
+/*! \retval \c true, if document was opened successful, else \c false.*/
bool STD_Application::onOpenDoc( const QString& aName )
{
if ( !abortAllOperations() )
}
/*!Check the application on closing.
- * \retval true if possible, else false
+ * \retval \c true if possible, else \c false
*/
bool STD_Application::isPossibleToClose( bool& closePermanently )
{
onSaveAsDoc();
}
-/*! \retval TRUE, if doument saved successful, else FALSE.*/
+/*! \retval \c true, if document saved successfully, else \c false.*/
bool STD_Application::onSaveAsDoc()
{
SUIT_Study* study = activeStudy();
}
}
-/*!\retval true, if document opened successful, else false.*/
+/*!\retval \c true, if document opened successfully, else \c false.*/
bool STD_Application::useFile(const QString& theFileName)
{
bool res = SUIT_Application::useFile( theFileName );
}
}
-/*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/
+/*!\retval \c 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 );
setActiveViewManager( vm );
}
-/*!Sets status bar show, if \on = true, else status bar hide.*/
+/*!Shows status bar, if on is \c true, else hides status bar.*/
void STD_Application::onViewStatusBar( bool on )
{
if ( on )
#include <QFrame>
#include <QVBoxLayout>
+#include <QMdiSubWindow>
#include <stdarg.h>
*/
SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const
{
- SUIT_ViewWindow* wnd = 0;
-
- QWidget* wid = myWorkspace->activeWindow();
- if ( wid && wid->inherits( "SUIT_ViewWindow" ) )
- wnd = (SUIT_ViewWindow*)wid;
-
- return wnd;
+ return qobject_cast<SUIT_ViewWindow*>( myWorkspace->activeSubWindow()->widget() );
}
/*!
{
QList<SUIT_ViewWindow*> winList;
- QWidgetList children = myWorkspace->windowList();
- for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it )
+ QList<QMdiSubWindow *> children = myWorkspace->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = children.begin(); it != children.end(); ++it )
{
- SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( *it );
+ SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( (*it)->widget() );
if ( vw )
winList.append( vw );
}
if ( !w || !workspace() )
return;
- workspace()->addWindow( w );
+ workspace()->addSubWindow( w );
}
/*!Call method perform for operation \a type.*/
}
/*! Add action to widget \a wid.
- *\retval TRUE - successful, FALSE - not successful.
+ *\retval true - successful, false - not successful.
*/
bool SUIT_ActionOperation::addTo( QWidget* wid )
{
}
/*!
- \return FALSE if application can not be closed (because of non saved data for example).
- This method called by SUIT_Session whin closing of application was requested.
+ \return \c false if application can not be closed (because of non saved data for example).
+ This method called by SUIT_Session when closing of application was requested.
*/
bool SUIT_Application::isPossibleToClose( bool& )
{
/*!
Show/hide menu item corresponding to action
\param a - action
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setMenuShown( QAction* a, const bool on )
{
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in menu manager
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setMenuShown( const int id, const bool on )
{
/*!
Show/hide tool button corresponding to action
\param a - action
- \param on - if it is true, the button will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the button will be shown, otherwise it will be hidden
*/
void SUIT_Application::setToolShown( QAction* a, const bool on )
{
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in tool manager
- \param on - if it is true, the button will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the button will be shown, otherwise it will be hidden
*/
void SUIT_Application::setToolShown( const int id, const bool on )
{
/*!
Show/hide both menu item and tool button corresponding to action
\param a - action
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setActionShown( QAction* a, const bool on )
{
/*!
Show/hide both menu item and tool button corresponding to action
\param id - identificator in both menu manager and tool manager
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is \c true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setActionShown( const int id, const bool on )
{
\param tip - tool tip
\param key - shortcut
\param parent - parent object
- \param toggle - if it is TRUE the action will be a toggle action, otherwise it will be a command action
+ \param toggle - if it is \c true the action will be a toggle action, otherwise it will be a command action
\param reciever - object that contains slot
\param member - slot to be called when action is activated
*/
//! Returns main widget (Desktop) of the application (if it exists)
virtual SUIT_Desktop* desktop();
- /*! Returns FALSE if application can not be closed (because of non saved data for example).
+ /*! Returns \c false if application can not be closed (because of non saved data for example).
This method called by SUIT_Session whin closing of application was requested. */
virtual bool isPossibleToClose( bool& );
/*!
* Checks: Is key null?
- *\retval TRUE - if null, esle false.
+ *\retval \c true - if null, esle \c false.
*/
bool SUIT_DataObjectKeyHandle::isNull() const
{
/*!
* Operator less.
- *\retval boolean. TRUE - If current key less than \a kw.
+ *\retval boolean. \c true - If current key less than \a kw.
*/
bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) const
{
/*!
* Operator is equal.
- *\retval boolean. TRUE - If current key equal \a kw.
+ *\retval boolean. \c true - If current key equal \a kw.
*/
bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) const
{
wid->testAttribute( Qt::WA_WState_Hidden );
addWindow( wid );
- wid->setShown( !invis );
+ wid->setVisible( !invis );
}
}
myCheckPermissions( true )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-
+ setOption(QFileDialog::DontUseNativeDialog, true);
setModal( modal );
setSizeGripEnabled( true );
if ( parent )
return fileName;
QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
- int index = r.indexIn( selectedFilter().trimmed() );
+ int index = r.indexIn( selectedNameFilter().trimmed() );
if ( QFileInfo( fileName ).exists() )
return fileName; // if file exists return as is
// Due to transformations from the filter list (*.txt *.*xx *.c++ SUIT*.* ) we
// will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only,
// we remove everything except extension mask from the pattern
- QString wildcard = selectedFilter().mid( index, r.matchedLength() ).trimmed();
+ QString wildcard = selectedNameFilter().mid( index, r.matchedLength() ).trimmed();
// replace '|' and ';' separators by space symbol and also brackets if there are some
wildcard.replace( QRegExp( "[\\|;|(|)]" )," " );
*/
void SUIT_FileDlg::addFilter( const QString& filter )
{
- QStringList flist = filters();
+ QStringList flist = nameFilters();
if ( !flist.contains( filter ) ) {
flist << filter;
- setFilters( flist );
+ setNameFilters( flist );
}
- selectFilter( filter );
+ selectNameFilter( filter );
}
/*!
tmpfilename = tmpfilename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );
fd.setFileMode( ExistingFiles );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );
* \brief Test the flags of operation
* \param f - flags of operation to be tested
*
-* Returns TRUE if the specified flags setted in the operation (see Flags enumeration)
+* Returns \c true if the specified flags setted in the operation (see Flags enumeration)
*/
bool SUIT_Operation::testFlags( const int f ) const
{
/*!
* \brief Verifies whether operator is ready to start.
- * \return TRUE if operation is ready to start
+ * \return \c true if operation is ready to start
*
-* Default implementation returns TRUE. Redefine this method to add own verifications
+* Default implementation returns \c true. Redefine this method to add own verifications
*/
bool SUIT_Operation::isReadyToStart() const
{
/*!
* \brief Sets slot which is called when operation is started
- * \param theReceiver - object containing slot
- * \param theSlot - slot of theReceiver object
- * \return TR if slot was connected successfully, FALSE otherwise
-*
-* Sets slot which is called when operation is started. There is no point in
-* using this method. It would be better to inherit own operator from base
-* one and redefine startOperation method
-*/
+ * \param theReceiver - object containing slot
+ * \param theSlot - slot of theReceiver object
+ * \return \c true if slot was connected successfully, \c false otherwise
+ *
+ * Sets slot which is called when operation is started. There is no point in
+ * using this method. It would be better to inherit own operator from base
+ * one and redefine startOperation method
+ */
bool SUIT_Operation::setSlot( const QObject* theReceiver, const char* theSlot )
{
return connect( this, SIGNAL( callSlot() ), theReceiver, theSlot );
/*!
* \brief Verifies whether given operator is valid for this one
* \param theOtherOp - other operation
- * \return Returns TRUE if the given operator is valid for this one
+ * \return Returns \c true if the given operator is valid for this one
*
* Verifies whether given operator is valid for this one (i.e. can be started "above"
* this operator)
/*!
* \brief Verifies whether this operator can be always started above any already runnig one
- * \return Returns TRUE if current operation must not be checked for ActiveOperation->IsValid( this )
+ * \return Returns \c true if current operation must not be checked for ActiveOperation->IsValid( this )
*
* This method must be redefined in derived operation if operation of derived class
-* must be always can start above any launched one. Default implementation returns FALSE,
+* must be always can start above any launched one. Default implementation returns \c false,
* so it is being checked for IsValid, but some operations may overload IsGranted()
* In this case they will always start, no matter what operation is running.
*/
/*!
* \brief Verifies whether operation is an runned one (state()==Running)
- * \return TRUE if operation is active, FALSE otherwise
+ * \return \c true if operation is active, \c false otherwise
*
-* Verifies whether operation is an running. Returns TRUE if state of operator
+* Verifies whether operation is an running. Returns \c true if state of operator
* is Running
*/
bool SUIT_Operation::isRunning() const
/*!
* \brief Verifies whether operation is an active for study.
- * \return TRUE if operation is active, FALSE otherwise
+ * \return \c true if operation is active, \c false otherwise
*
-* Verifies whether operation is an active on. Returns TRUE if this operator
+* Verifies whether operation is an active on. Returns \c true if this operator
* is active for study
*/
bool SUIT_Operation::isActive() const
}
/*!
- * \brief Returns TRUE if transaction is opened.
+ * \brief Returns \c true if transaction is opened.
*/
bool SUIT_Operation::hasTransaction() const
{
// Try config file, given in arguments
for (int i = 1; i < arguments.count(); i++) {
QRegExp rx ("--resources=(.+)");
- if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 0 ) {
+ if ( rx.indexIn( arguments[i] ) >= 0 && rx.captureCount() > 0 ) {
QString file = rx.cap(1);
QFileInfo fi (file);
pathName = fi.absoluteFilePath();
}
/*!
- *\retval TRUE - if study saved, else FALSE.
+ *\retval \c true - if study saved, else \c false.
*/
bool SUIT_Study::isSaved() const
{
}
/*!
- *\retval TRUE - if study modified, else FALSE.
+ *\retval \c true - if study modified, else \c false.
*/
bool SUIT_Study::isModified() const
{
}
/*!
- * Open document. Sets file name. return true.
+ * Open document. Sets file name. return \c true.
*/
bool SUIT_Study::openDocument( const QString& fileName )
{
}
/*!
- *\retval TRUE - if document saved successful, else FALSE.
+ *\retval \c true - if document saved successful, else \c false.
*/
bool SUIT_Study::saveDocument()
{
/*!
* \brief Starts operation
* \param theOp - operation to be started
- * \param toCheck - if parameters is equal TRUE then checking performed whether
+ * \param toCheck - if parameters is equal \c true then checking performed whether
* all already started operations allow to start this operation above them (default
- * value is TRUE
- * \return TRUE if operation is started, FALSE otherwise
+ * value is \c true
+ * \return \c true if operation is started, \c false otherwise
*
* Verifies whether theOp operation can be started above already started ones (if toCheck
-* parameter is equal TRUE) and starts it
+* parameter is equal \c true) and starts it
*/
bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck )
{
/*!
* \brief Aborts operation
* \param theOp - operation to be aborted
- * \return TRUE if operation is aborted successfully
+ * \return \c true if operation is aborted successfully
*
* Verifies whether operation already started and aborts it in this case (sets execution
* status to Rejected and stops operation)
/*!
* \brief Commits operation
* \param theOp - operation to be committed
- * \return TRUE if operation is committed successfully
+ * \return \c true if operation is committed successfully
*
* Verifies whether operation already started and commits it in this case (sets execution
* status to Accepted and stops operation)
/*!
* \brief Commits operation
* \param theOp - operation to be committed
- * \return TRUE if operation is suspended successfully
+ * \return \c true if operation is suspended successfully
*
* Verifies whether operation already started and suspends it in this case. Operations
* ususlly are suspended to start other one above them.
/*!
* \brief Resumes operation
* \param theOp - operation to be resumed
- * \return TRUE if operation is aborted successfully
+ * \return \c true if operation is aborted successfully
*
* Verifies whether operation already started but suspended and resumesit in this case.
*/
}
/*!
- * \brief Returns TRUE if transaction is opened.
+ * \brief Returns \c true if transaction is opened.
*/
bool SUIT_Study::hasTransaction() const
{
void SUIT_ViewManager::setShown( const bool on )
{
for ( int i = 0; i < myViews.count(); i++ )
- myViews.at( i )->setShown( on );
+ myViews.at( i )->setVisible( on );
}
/*!Emit on \a theEvent mouse pressed in \a theView.*/
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if ( app ) {
SUIT_Desktop* d = app->desktop();
- QList<SUIT_ViewWindow*> allViews = qFindChildren<SUIT_ViewWindow*>( d );
+ QList<SUIT_ViewWindow*> allViews = d->findChildren<SUIT_ViewWindow*>();
foreach( SUIT_ViewWindow* vw, allViews ) {
if ( !vw || vw == this ) continue; // skip invalid views and this one
SUIT_CameraProperties otherProps = vw->cameraProperties();
SUIT_Desktop* d = app->desktop();
if ( !d ) return;
- QList<SUIT_ViewWindow*> allViews = qFindChildren<SUIT_ViewWindow*>( d );
+ QList<SUIT_ViewWindow*> allViews = d->findChildren<SUIT_ViewWindow*>();
foreach( SUIT_ViewWindow* vw, allViews ) {
if ( !vw->cameraProperties().isValid() )
continue; // omit views not supporting camera properties
{
QList<QWidget*> aList = createdWidgets();
for ( QList<QWidget*>::const_iterator it = aList.begin(); it != aList.end(); ++it )
- updateCombo( qFindChild<QComboBox*>(*it) );
+ updateCombo( (*it)->findChild<QComboBox*>() );
}
void SVTK_ComboAction::updateCombo( QComboBox* combo )
// Start a one-shot timer for <DELAY> ms.
//
static int DELAY = 1;
- myTimer->setSingleShot(TRUE);
+ myTimer->setSingleShot(true);
myTimer->start(DELAY);
return 1;
}
m_MainWindow(theParent)
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
// Create <OK> button
QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2);
m_bOk->setObjectName("m_bOk");
- m_bOk->setDefault(TRUE);
- m_bOk->setAutoDefault(TRUE);
+ m_bOk->setDefault(true);
+ m_bOk->setAutoDefault(true);
// Create <Apply> button
QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2);
m_bApply->setObjectName("m_bApply");
- m_bApply->setAutoDefault(TRUE);
+ m_bApply->setAutoDefault(true);
// Create <Cancel> button
QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2);
m_bCancel->setObjectName("m_bCancel");
- m_bCancel->setAutoDefault(TRUE);
+ m_bCancel->setAutoDefault(true);
// Layout buttons
aHBoxLayout2->addWidget(m_bOk);
myRWInteractor(theParent->GetInteractor())
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
aGridLayout->addWidget(aLabel, 0, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 0, 1);
myCurrentUpdateRateLineEdit = aLineEdit;
aGridLayout->addWidget(aLabel, 1, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 1, 1);
myNumberOfCellsLineEdit = aLineEdit;
aHBoxLayout->setSpacing(6);
{
QPushButton* aPushButton = new QPushButton(tr("OK"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickOk()));
}
{
QPushButton* aPushButton = new QPushButton(tr("Apply"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickApply()));
}
aHBoxLayout->addStretch();
{
QPushButton* aPushButton = new QPushButton(tr("Close"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickClose()));
}
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
//Support of several toolbars in the popup menu
- QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+ QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
for( ; it!=last; it++ )
thePopup->addAction( (*it)->toggleViewAction() );
myRWInteractor(theParent->GetInteractor())
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Top layout
QVBoxLayout* aTopLayout = new QVBoxLayout(this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onDumpView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onDumpView()));
mgr->registerAction( anAction, DumpId );
// FitAll
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
tr( "MNU_FITALL" ), 0, this);
anAction->setStatusTip(tr("DSC_FITALL"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFitAll()));
mgr->registerAction( anAction, FitAllId );
// FitRect
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
tr( "MNU_FITRECT" ), 0, this);
anAction->setStatusTip(tr("DSC_FITRECT"));
- connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateWindowFit()));
mgr->registerAction( anAction, FitRectId );
// FitSelection
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITSELECTION" ) ),
tr( "MNU_FITSELECTION" ), 0, this);
anAction->setStatusTip(tr("DSC_FITSELECTION"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onFitSelection()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFitSelection()));
mgr->registerAction( anAction, FitSelectionId );
// Zoom
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateZoom()));
mgr->registerAction( anAction, ZoomId );
// Panning
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
tr( "MNU_PAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_PAN_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activatePanning()));
mgr->registerAction( anAction, PanId );
// Global Panning
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning()));
mgr->registerAction( anAction, GlobalPanId );
// Change rotation point
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
tr( "MNU_ROTATE_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(activateRotation()));
mgr->registerAction( anAction, RotationId );
// Projections
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
this->addAction(anAction);
mgr->registerAction( anAction, FrontId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
anAction->setStatusTip(tr("DSC_BACK_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onBackView()));
this->addAction(anAction);
mgr->registerAction( anAction, BackId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
anAction->setStatusTip(tr("DSC_TOP_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onTopView()));
this->addAction(anAction);
mgr->registerAction( anAction, TopId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
this->addAction(anAction);
mgr->registerAction( anAction, BottomId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
this->addAction(anAction);
mgr->registerAction( anAction, LeftId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onRightView()));
this->addAction(anAction);
mgr->registerAction( anAction, RightId );
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
anAction->setStatusTip(tr("DSC_RESET_VIEW"));
- connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onResetView()));
this->addAction(anAction);
mgr->registerAction( anAction, ResetId );
tr( "MNU_SVTK_PRESELECTION_STANDARD" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_STANDARD"));
anAction->setCheckable(true);
- connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map()));
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
aSignalMapper->setMapping( anAction, Standard_Preselection );
mgr->registerAction( anAction, StandardPreselectionId );
tr( "MNU_SVTK_PRESELECTION_DYNAMIC" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DYNAMIC"));
anAction->setCheckable(true);
- connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map()));
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
aSignalMapper->setMapping( anAction, Dynamic_Preselection );
mgr->registerAction( anAction, DynamicPreselectionId );
tr( "MNU_SVTK_PRESELECTION_DISABLED" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DISABLED"));
anAction->setCheckable(true);
- connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map()));
+ connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
aSignalMapper->setMapping( anAction, Preselection_Disabled );
mgr->registerAction( anAction, DisablePreselectionId );
#include <SALOME_LifeCycleCORBA.hxx>
#include <QApplication>
+#include <QWidget>
#include <QAction>
#include <QRegExp>
#include <QCheckBox>
QStringList pyfiles;
QString loadStudy;
- for (int i = 1; i < qApp->argc(); i++) {
+ for (int i = 1; i < qApp->arguments().size(); i++) {
QRegExp rxs ("--study-hdf=(.+)");
- if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
+ if ( rxs.indexIn( qApp->arguments()[i] ) >= 0 && rxs.capturedTexts().count() > 1 ) {
QString file = rxs.capturedTexts()[1];
QFileInfo fi ( file );
QString extension = fi.suffix().toLower();
}
else {
QRegExp rxp ("--pyscript=\\[(.+)\\]");
- if ( rxp.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) {
+ if ( rxp.indexIn( qApp->arguments()[i] ) >= 0 && rxp.capturedTexts().count() > 1 ) {
// pyscript
QStringList dictList = rxp.capturedTexts()[1].split("},", QString::SkipEmptyParts);
for (int k = 0; k < dictList.count(); ++k) {
DumpStudyFileDlg fd( desktop() );
fd.setValidator( new DumpStudyFileValidator( &fd ) );
fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
- fd.setFilters( aFilters );
+ fd.setNameFilters( aFilters );
fd.myPublishChk->setChecked( anIsPublish );
fd.myMultiFileChk->setChecked( anIsMultiFile );
fd.mySaveGUIChk->setChecked( anIsSaveGUI );
/*!Gets CORBA::ORB_var*/
CORBA::ORB_var SalomeApp_Application::orb()
{
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ static CORBA::ORB_var _orb;
+
+ if ( CORBA::is_nil( _orb ) ) {
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
+ }
+
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ _orb = init( argc, argv );
+
+ delete [] argv;
+ }
+
return _orb;
}
*/
CORBA::ORB_var SalomeApp_Engine_i::orb()
{
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- // TODO: using QApplication here looks ugly, think how to
- // obtain the ORB reference in a nicer way...
- static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ static CORBA::ORB_var _orb;
+
+ if ( CORBA::is_nil( _orb ) ) {
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
+ }
+
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ _orb = init( argc, argv );
+
+ delete [] argv;
+ }
+
return _orb;
}
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myIsChanged(false)
{
- setModal( TRUE );
+ setModal( true );
setWindowTitle(tr("TLT_STUDY_PROPERTIES"));
setSizeGripEnabled( true );
# variable *_ROOT_DIR).
#
+INCLUDE(UsePyQt4)
+
+# --- resources ---
+
+# uic files / to be processed by pyuic
+SET(_pyuic_files
+ minmax.ui
+)
+
+# scripts / pyuic wrappings
+PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+
# --- scripts ---
# scripts / static
# TODO: process UIC files via PyQt4 pyuic tool, see UsePyQt4.cmake
SET(_plugins_SCRIPTS
- minmax_dialog.py
+ ${_pyuic_SCRIPTS}
minmax_plugin.py
trihedron.py
tubedialog_ui.py
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# Form implementation generated from reading ui file 'minmax.ui'
-#
-# Created: Thu Mar 1 15:23:57 2012
-# by: PyQt4 UI code generator 4.8.1
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-try:
- _fromUtf8 = QtCore.QString.fromUtf8
-except AttributeError:
- _fromUtf8 = lambda s: s
-
-class Ui_Dialog(object):
- def setupUi(self, Dialog):
- Dialog.setObjectName(_fromUtf8("Dialog"))
- Dialog.resize(178, 156)
- Dialog.setSizeGripEnabled(True)
- self.gridLayout = QtGui.QGridLayout(Dialog)
- self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
- self.label_2 = QtGui.QLabel(Dialog)
- self.label_2.setObjectName(_fromUtf8("label_2"))
- self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
- self.mesh = QtGui.QLineEdit(Dialog)
- self.mesh.setReadOnly(True)
- self.mesh.setObjectName(_fromUtf8("mesh"))
- self.gridLayout.addWidget(self.mesh, 0, 1, 1, 2)
- self.label_3 = QtGui.QLabel(Dialog)
- self.label_3.setObjectName(_fromUtf8("label_3"))
- self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1)
- self.control = QtGui.QComboBox(Dialog)
- self.control.setObjectName(_fromUtf8("control"))
- self.gridLayout.addWidget(self.control, 1, 1, 1, 2)
- self.label = QtGui.QLabel(Dialog)
- self.label.setObjectName(_fromUtf8("label"))
- self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
- self.minvalue = QtGui.QLineEdit(Dialog)
- self.minvalue.setReadOnly(True)
- self.minvalue.setObjectName(_fromUtf8("minvalue"))
- self.gridLayout.addWidget(self.minvalue, 2, 1, 1, 2)
- self.label_4 = QtGui.QLabel(Dialog)
- self.label_4.setObjectName(_fromUtf8("label_4"))
- self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
- self.maxvalue = QtGui.QLineEdit(Dialog)
- self.maxvalue.setReadOnly(True)
- self.maxvalue.setObjectName(_fromUtf8("maxvalue"))
- self.gridLayout.addWidget(self.maxvalue, 3, 1, 1, 2)
- self.buttonBox = QtGui.QDialogButtonBox(Dialog)
- self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
- self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Help)
- self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
- self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 3)
-
- self.retranslateUi(Dialog)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.OnCancel)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("helpRequested()")), Dialog.helpMessage)
- QtCore.QObject.connect(self.control, QtCore.SIGNAL(_fromUtf8("activated(QString)")), Dialog.compute_minmax)
- QtCore.QMetaObject.connectSlotsByName(Dialog)
- Dialog.setTabOrder(self.mesh, self.control)
- Dialog.setTabOrder(self.control, self.minvalue)
- Dialog.setTabOrder(self.minvalue, self.maxvalue)
- Dialog.setTabOrder(self.maxvalue, self.buttonBox)
-
- def retranslateUi(self, Dialog):
- Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Get min and max value of control", None, QtGui.QApplication.UnicodeUTF8))
- self.label_2.setText(QtGui.QApplication.translate("Dialog", "Mesh", None, QtGui.QApplication.UnicodeUTF8))
- self.label_3.setText(QtGui.QApplication.translate("Dialog", "Control", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("Dialog", "Min", None, QtGui.QApplication.UnicodeUTF8))
- self.label_4.setText(QtGui.QApplication.translate("Dialog", "Max", None, QtGui.QApplication.UnicodeUTF8))
-
from PyQt4.QtCore import Qt
from PyQt4.QtCore import SIGNAL
- from minmax_dialog import Ui_Dialog
+ from minmax_ui import Ui_Dialog
import salome
import SMESH
switch ( type )
{
case QtDebugMsg:
- //MESSAGE( "Debug: " << msg );
+#ifdef QT_DEBUG_MESSAGE
+ MESSAGE( "Debug: " << qPrintable( QString(msg) ) );
+#endif
break;
case QtWarningMsg:
- MESSAGE( "Warning: " << msg );
+ MESSAGE( "Warning: " << qPrintable( QString(msg) ) );
break;
case QtFatalMsg:
- MESSAGE( "Fatal: " << msg );
+ MESSAGE( "Fatal: " << qPrintable( QString(msg) ) );
break;
}
}
_qappl.setApplicationVersion( salomeVersion() );
// Add application library path (to search style plugin etc...)
- QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
+ QString path = QDir::toNativeSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
_qappl.addLibraryPath( path );
bool isGUI = isFound( "GUI", argc, argv );
// start check servers
int current = 0;
QString error;
- int argc = QApplication::instance()->argc();
- char** argv = QApplication::instance()->argv();
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
+ }
+
+ bool OK = true;
+
// 1. Check naming service
- for ( int i = 0; i < myAttempts; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( argc, argv );
CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
if ( !CORBA::is_nil( _root_context ) ) {
if ( i == myAttempts-1 ) {
setError( tr( "Unable to contact the naming service.\n" ) );
- return;
+ OK = false;
+ //return;
}
}
// 2. Check registry server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Registry server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 3. Check data server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Study server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 4. Check module catalogue server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Module catalogue server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 5. Check data server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Session server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 6. Check C++ container
if ( myCheckCppContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
// 7. Check Python container
if ( myCheckPyContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
// 8. Check supervision container
if ( myCheckSVContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
+
+ delete [] argv;
}
{
_argc = argc ;
_argv = argv ;
- _isGUI = FALSE ;
+ _isGUI = false ;
_runningStudies= 0 ;
_orb = CORBA::ORB::_duplicate(orb) ;
_poa = PortableServer::POA::_duplicate(poa) ;
#include <QSlider>
#include <QMainWindow>
#include <QPixmapCache>
-
-#include <limits.h>
+#include <QTileRules>
#define SHADOW 1
#define LINE_GR_MARGIN 10
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <QtGui>
+#include <QInputDialog>
+#include <QContextMenuEvent>
#include "mainwindow.hxx"
#include "TreeModel.hxx"
// Author: Guillaume Boulant (EDF/R&D)
-#include <QtGui>
-
#include "TreeItem.hxx"
#include "TreeModel.hxx"
* call virtual method IsValid( const int theId ).
* \param theActor - actor
* \param theCellId - cell id.
- * \retval TRUE - if cell id is valid, else false.
+ * \retval \c true - if cell id is valid, else \c false.
*/
bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const int theCellId )
{
}
-/*!\retval TRUE if needs redrawing*/
+/*!\retval \c true if needs redrawing*/
bool VTKViewer_InteractorStyle::needsRedrawing()
{
return State == VTK_INTERACTOR_STYLE_CAMERA_ZOOM ||
/*!Checks: is valid cell(node) with id \a theId in actor \a theActor.
*\param theActor - VTKViewer_Actor pointer.
*\param theId - cell id.
- *\param theIsNode - boolean flag, if true - node, else - cell.
+ *\param theIsNode - boolean flag, if \c true - node, else - cell.
*/
bool VTKViewer_InteractorStyle::IsValid( VTKViewer_Actor* theActor,
const int theId,
///
/// Start a one-shot timer for 10ms.
///
- mTimer->setSingleShot(TRUE) ;
+ mTimer->setSingleShot(true) ;
mTimer->start(10) ;
return 1 ;
}
aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onDumpView()));
myActionsMap[ DumpId ] = aAction;
//! \li FitAll
aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
tr( "MNU_FITALL" ), 0, this);
aAction->setStatusTip(tr("DSC_FITALL"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onFitAll()));
myActionsMap[ FitAllId ] = aAction;
//! \li FitRect
aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
tr( "MNU_FITRECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITRECT"));
- connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(activateWindowFit()));
myActionsMap[ FitRectId ] = aAction;
//! \li FitSelection
aAction = new QtxAction(tr("MNU_FITSELECTION"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITSELECTION" ) ),
tr( "MNU_FITSELECTION" ), 0, this);
aAction->setStatusTip(tr("DSC_FITSELECTION"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onFitSelection()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onFitSelection()));
myActionsMap[ FitSelectionId ] = aAction;
//! \li Zoom
aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(activateZoom()));
myActionsMap[ ZoomId ] = aAction;
//! \li Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(activatePanning()));
myActionsMap[ PanId ] = aAction;
//! \li Global Panning
aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning()));
myActionsMap[ GlobalPanId ] = aAction;
//! \li Rotation
aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
tr( "MNU_ROTATE_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(activateRotation()));
myActionsMap[ RotationId ] = aAction;
//! \li Projections
aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
tr( "MNU_FRONT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
myActionsMap[ FrontId ] = aAction;
//! \li Back view
aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
tr( "MNU_BACK_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_BACK_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onBackView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onBackView()));
myActionsMap[ BackId ] = aAction;
//! \li Top view
aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
tr( "MNU_TOP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_TOP_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onTopView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onTopView()));
myActionsMap[ TopId ] = aAction;
//! \li Bottom view
aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
tr( "MNU_BOTTOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
myActionsMap[ BottomId ] = aAction;
//! \li Left view
aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
tr( "MNU_LEFT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
myActionsMap[ LeftId ] = aAction;
//! \li Right view
aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
tr( "MNU_RIGHT_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onRightView()));
myActionsMap[ RightId ] = aAction;
// \li Rotate anticlockwise
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onResetView()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView()));
myActionsMap[ ResetId ] = aAction;
//! \li Trihedron shown
aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
- connect(aAction, SIGNAL(activated()), this, SLOT(onTrihedronShow()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onTrihedronShow()));
myActionsMap[ TrihedronShowId ] = aAction;
}
ViewerTools_DialogBase(QtxAction* theAction,
QWidget* theParent,
const char* theName = "",
- bool theModal = FALSE,
+ bool theModal = false,
Qt::WindowFlags theWFalgs = 0);
~ViewerTools_DialogBase();
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+INCLUDE(UseQt4Ext)
+
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
//
#include "GenericDialog.h"
+#include <QDebug>
-GenericDialog::GenericDialog(QDialog *parent) : QDialog(parent)
+GenericDialog::GenericDialog(QDialog* parent) : QDialog(parent)
{
ui.setupUi(this); // A faire en premier
// buttonbox (inherited features)
}
-QFrame * GenericDialog::getPanel() {
+QFrame* GenericDialog::getPanel() {
return ui.centralPanel;
}
-QDialogButtonBox * GenericDialog::getButtonBox() {
+QDialogButtonBox* GenericDialog::getButtonBox() {
return ui.buttonBox;
}
-
-#include <QDebug>
void GenericDialog::accept() {
qDebug() << "accept() is not implemented yet";
QDialog::accept();
#ifndef _GenericDialog_HXX
#define _GenericDialog_HXX
-#include <QtGui>
+#include <QDialog>
+
#include "ui_GenericDialog.h"
+class QFrame;
+class QDialogButtonBox;
+
class GenericDialog : public QDialog
{
Q_OBJECT
-
+
public:
- GenericDialog(QDialog *parent = 0);
+ GenericDialog(QDialog* parent = 0);
- protected:
- QFrame * getPanel();
+protected:
+ QFrame* getPanel();
QDialogButtonBox * getButtonBox();
-
- protected slots:
- void accept();
- //void reject();
-
- private:
+
+protected slots:
+ void accept();
+
+private:
Ui_GenericDialog ui; // instance of the class defined in ui_GenericDialog.h
};
#include "__CLASSNAME__.h"
-__CLASSNAME__::__CLASSNAME__(QDialog *parent) : GenericDialog(parent)
+__CLASSNAME__::__CLASSNAME__(QDialog* parent) : GenericDialog(parent)
{
ui.setupUi(this->getPanel());
}
#ifndef ___CLASSNAME___HXX
#define ___CLASSNAME___HXX
-#include <QtGui>
#include "ui___CLASSNAME__.h"
#include "GenericDialog.h"
class __CLASSNAME__ : public GenericDialog
{
Q_OBJECT
-
- public:
- __CLASSNAME__(QDialog *parent = 0);
-
- private:
+
+public:
+ __CLASSNAME__(QDialog* parent = 0);
+
+private:
Ui___CLASSNAME__ ui; // instance of the class defined in ui___CLASSNAME__.hxx
};
#include "__CLASSNAME__.h"
+#include <QDebug>
-__CLASSNAME__::__CLASSNAME__(QDialog *parent) : QDialog(parent)
+__CLASSNAME__::__CLASSNAME__(QDialog* parent) : QDialog(parent)
{
ui.setupUi(this); // A faire en premier
// buttonbox (inherited features)
}
-#include <QDebug>
void __CLASSNAME__::accept() {
qDebug() << "accept() is not implemented yet";
QDialog::accept();
#ifndef ___CLASSNAME___HXX
#define ___CLASSNAME___HXX
-#include <QtGui>
+#include <QDialog>
+
#include "ui___CLASSNAME__.h"
class __CLASSNAME__ : public QDialog
{
Q_OBJECT
-
- public:
- __CLASSNAME__(QDialog *parent = 0);
-
- protected slots:
- void accept();
- //void reject();
-
- private:
+
+public:
+ __CLASSNAME__(QDialog* parent = 0);
+
+protected slots:
+ void accept();
+
+private:
Ui___CLASSNAME__ ui; // instance of the class defined in ui___CLASSNAME__.hxx
};
// (gboulant - 12/10/2010)
//
#include <QApplication>
-#include <QtGui>
#include "GDialogTest.h"
void TEST_show() {
- GDialogTest * dialog = new GDialogTest();
+ GDialogTest* dialog = new GDialogTest();
dialog->show();
}
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
QApplication app(argc, argv);
TEST_show();
// (gboulant - 12/10/2010)
//
#include <QApplication>
-#include <QtGui>
#include "QDialogTest.h"
void TEST_show() {
- QDialogTest * dialog = new QDialogTest();
+ QDialogTest* dialog = new QDialogTest();
dialog->show();
}
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
QApplication app(argc, argv);
TEST_show();