IF(NOT SALOME_BUILD_WITH_QT5)
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
INCLUDE(${QT_USE_FILE})
+ ADD_DEFINITIONS("-DUSE_SALOME_STYLE")
ELSE()
FIND_PACKAGE(SalomeQt5 REQUIRED)
ENDIF()
int aFontCont = 0;
QString aFontDef = theFont->toString();
char** xFontList = XListFonts( aDisp, aFontDef.toLatin1()/*aFindFont.myFontString.data()*/, 1, &aFontCont );
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
if( !theFont->handle() )
{
cout << "Choosing cmap for vID = " << vi->visualid << endl;
#endif
- /* if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
#ifdef DEBUG
cout << "Using x11AppColormap" << endl;
#endif
return QX11Info::appColormap();
- } */
-
+ }
+#endif
if ( mesa_gl )
{
Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
removeFromGroup( aChild );
if( QGraphicsScene* aScene = aChild->scene() )
aScene->removeItem( aChild );
- delete ( aChild );
+ delete aChild;
aChild = 0;
}
}
#include <SALOME_Event.h>
+#ifdef USE_SALOME_STYLE
#include <Style_Salome.h>
#include <Style_PrefDlg.h>
+#endif // USE_SALOME_STYLE
#include <CAM_Module.h>
#include <CAM_DataModel.h>
createMenu( MRUId, fileMenu, 100, -1 );
createMenu( separator(), fileMenu, -1, 100, -1 );
+#ifdef USE_SALOME_STYLE
createAction( StyleId, tr( "TOT_THEME" ), QIcon(), tr( "MEN_DESK_THEME" ), tr( "PRP_THEME" ),
0, desk, false, this, SLOT( onStylePreferences() ) );
+#endif // USE_SALOME_STYLE
createAction( FullScreenId, tr( "TOT_FULLSCREEN" ), QIcon(), tr( "MEN_DESK_FULLSCREEN" ), tr( "PRP_FULLSCREEN" ),
Qt::Key_F11, desk, false, this, SLOT( onFullScreen() ) );
int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1 );
createMenu( separator(), viewMenu, -1, 20, -1 );
+#ifdef USE_SALOME_STYLE
createMenu( StyleId, viewMenu, 20, -1 );
+#endif // USE_SALOME_STYLE
createMenu( FullScreenId, viewMenu, 20, -1 );
int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ), // title (language-dependant)
void LightApp_Application::onStylePreferences()
{
+#ifdef USE_SALOME_STYLE
Style_PrefDlg dlg( desktop() );
dlg.exec();
resourceMgr()->setValue( "Style", "use_salome_style", Style_Salome::isActive() );
+#endif // USE_SALOME_STYLE
}
void LightApp_Application::onFullScreen(){
//#ifdef DEBUG
//cout << "Choosing cmap for vID = " << vi->visualid << endl;
//#endif
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
*/
void QtxWorkspaceAction::updateContent()
{
- bool count = workspace() ? workspace()->subWindowList().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();
}
#include "SUIT_LicenseDlg.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
+#ifdef USE_SALOME_STYLE
#include "Style_Salome.h"
+#endif // USE_SALOME_STYLE
#include "QtxSplash.h"
#include <QDir>
if ( !qtdir.isEmpty() )
QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
//Set a "native" graphic system in case if application runs on the remote host
QString remote(::getenv("REMOTEHOST"));
QString client(::getenv("SSH_CLIENT"));
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
if(remote.length() > 0 || client.length() > 0 ) {
QApplication::setGraphicsSystem(QLatin1String("native"));
}
SUIT_Application* theApp = aSession.startApplication( argList.first() );
if ( theApp )
{
+#ifdef USE_SALOME_STYLE
Style_Salome::initialize( theApp->resourceMgr() );
if ( theApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
Style_Salome::apply();
+#endif // USE_SALOME_STYLE
if ( !noExceptHandling )
app.setHandler( aSession.handler() );
#ifdef ENABLE_TESTRECORDER
: TestApplication( argc, argv ),
#else
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if !defined(WIN32) && (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
// san: Opening an X display and choosing a visual most suitable for 3D visualization
// in order to make SALOME viewers work with non-native X servers
/*!
Constructor
*/
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
#ifdef ENABLE_TESTRECORDER
public:
SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* = 0 );
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* = 0 );
#endif
#endif
}
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#ifdef WIN32
virtual void focusOutEvent( QFocusEvent* );
//! To handle native events (from such devices as SpaceMouse)
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#ifdef WIN32
virtual bool winEvent( MSG*, long* );
#include <Qtx.h>
#include <QtxSplash.h>
+#ifdef USE_SALOME_STYLE
#include <Style_Salome.h>
+#endif // USE_SALOME_STYLE
#include "GUI_version.h"
#include <SUIT_Tools.h>
SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
#else
SALOME_QApplication( int& argc, char** argv )
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if !defined WIN32 && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
// san: Opening an X display and choosing a visual most suitable for 3D visualization
// in order to make SALOME viewers work with non-native X servers
qInstallMessageHandler( MessageOutput );
#endif
+// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
//Set a "native" graphic system in case if application runs on the remote host
QString remote(getenv("REMOTEHOST"));
SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
if ( aGUIApp )
{
+#ifdef USE_SALOME_STYLE
Style_Salome::initialize( aGUIApp->resourceMgr() );
if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
Style_Salome::apply();
+#endif // USE_SALOME_STYLE
if ( !isFound( "noexcepthandler", argc, argv ) )
_qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
p->setPen(opt->palette.text().color());
} // Fall through!
case PE_IndicatorViewItemCheck:
- /* case PE_Q3CheckListIndicator: {
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ case PE_Q3CheckListIndicator:
+#endif
+ {
if (!doRestore) {
p->save();
doRestore = true;
if (doRestore)
p->restore();
break;
- }*/
+ }
case PE_IndicatorRadioButton: {
if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),