#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qgroupbox.h>
+#include <QtxGridBox.h>
+
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QPixmap>
+#include <QIcon>
+#include <QGroupBox>
/*!Constructor.*/
LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& defVer, QWidget* parent )
-: QtxDialog( parent, "salome_about_dialog", true, false, None )
+: QtxDialog( parent, true, false, None )
{
+ setObjectName( "salome_about_dialog" );
+
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
QPixmap ico = resMgr->loadPixmap( "LightApp", tr( "ICO_ABOUT" ), false );
if ( !ico.isNull() )
- setIcon( ico );
+ setWindowIcon( ico );
QPalette pal = palette();
- QColorGroup cg = pal.active();
- cg.setColor( QColorGroup::Foreground, Qt::darkBlue );
- cg.setColor( QColorGroup::Background, Qt::white );
- pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
+
+ pal.setBrush( QPalette::Active, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+ pal.setBrush( QPalette::Active, QPalette::Window, QBrush( Qt::white ) );
+
+ pal.setBrush( QPalette::Inactive, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+ pal.setBrush( QPalette::Inactive, QPalette::Window, QBrush( Qt::white ) );
+
+ pal.setBrush( QPalette::Disabled, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+ pal.setBrush( QPalette::Disabled, QPalette::Window, QBrush( Qt::white ) );
+
setPalette(pal);
QVBoxLayout* main = new QVBoxLayout( mainFrame() );
- QGroupBox* base = new QGroupBox( 1, Qt::Horizontal, "", mainFrame() );
- base->setFrameStyle( QFrame::NoFrame );
+ QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, mainFrame(), 0, 0 );
base->setInsideMargin( 0 );
main->addWidget( base );
QString capText = tr( "ABOUT_CAPTION" );
if ( capText.contains( "%1" ) )
capText = capText.arg( defName );
- setCaption( capText );
+ setWindowTitle( capText );
setSizeGripEnabled( false );
}
if ( !lab )
return;
- bool vis = !lab->text().stripWhiteSpace().isEmpty() ||
+ bool vis = !lab->text().trimmed().isEmpty() ||
( lab->pixmap() && !lab->pixmap()->isNull() );
vis ? lab->show() : lab->hide();
}
// Copyright (C) CEA 2005
#ifndef DISABLE_PYCONSOLE
- #include "PythonConsole_PyInterp.h" // WARNING! This include must be the first!
- #include <PythonConsole_PyConsole.h>
+ #include "PyConsole_Interp.h" // WARNING! This include must be the first!
+ #include <PyConsole_Console.h>
#endif
#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_DataObject.h"
+#include "SALOME_Event.h"
+
#include <CAM_Module.h>
#include <CAM_DataModel.h>
#include <CAM_Study.h>
#include <QtxMRUAction.h>
#include <QtxDockAction.h>
#include <QtxToolBar.h>
-#include <qprocess.h>
+#include <QProcess>
#include <LogWindow.h>
-#include <OB_Browser.h>
-#include <OB_ListView.h>
+// temporary commented
+//#include <OB_Browser.h>
+//#include <OB_ListView.h>
#ifndef DISABLE_GLVIEWER
#include <GLViewer_Viewer.h>
// #include <SUPERVGraph_ViewManager.h>
//#endif
-#include <QtxWorkstack.h>
-
-#include <qdir.h>
-#include <qimage.h>
-#include <qstring.h>
-#include <qwidget.h>
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qapplication.h>
-#include <qmap.h>
-#include <qstatusbar.h>
-#include <qthread.h>
-#include <qobjectlist.h>
-#include <qcombobox.h>
-#include <qinputdialog.h>
-#include <qfontdatabase.h>
+#include <QDir>
+#include <QImage>
+#include <QString>
+#include <QWidget>
+#include <QStringList>
+#include <QFile>
+#include <QApplication>
+#include <QMap>
+#include <QStatusBar>
+#include <QThread>
+#include <QObjectList>
+#include <QComboBox>
+#include <QInputDialog>
+#include <QFontDatabase>
+#include <QIcon>
+#include <QByteArray>
+#include <QMenu>
+
+using namespace Qt;
#define FIRST_HELP_ID 1000000
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
- desktop()->setIcon( aLogo );
+ desktop()->setWindowIcon( aLogo );
desktop()->setDockableMenuBar( true );
desktop()->setDockableStatusBar( false );
// base logo (salome itself)
- desktop()->addLogo( "_app_base", aResMgr->loadPixmap( "LightApp", tr( "APP_BASE_LOGO" ), false ) );
+ desktop()->logoInsert( "_app_base", aResMgr->loadPixmap( "LightApp", tr( "APP_BASE_LOGO" ), false ) );
// extra logo (salome-based application)
- desktop()->addLogo( "_app_extra", aResMgr->loadPixmap( "LightApp", tr( "APP_EXTRA_LOGO" ), false ) );
+ desktop()->logoInsert( "_app_extra", aResMgr->loadPixmap( "LightApp", tr( "APP_EXTRA_LOGO" ), false ) );
clearViewManagers();
if ( famdb.contains(f.family()) || !aResMgr->hasValue( "PyConsole", "additional_families" ) )
return;
- QStringList anAddFamilies = QStringList::split( ";", aResMgr->stringValue( "PyConsole", "additional_families" ) );
+ QStringList anAddFamilies = aResMgr->stringValue( "PyConsole", "additional_families" ).split( ";", QString::SkipEmptyParts );
QString aFamily;
for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
{
/*!Start application.*/
void LightApp_Application::start()
{
- if ( desktop() )
- desktop()->loadGeometry( resourceMgr(), "desktop" );
-
+ if ( desktop() ) {
+ desktop()->retrieveGeometry( resourceMgr()->stringValue( "desktop", "geometry", "(800%)x(800%) (+400%) (+400%) :(full)" ) );
+ //desktop()->retrieveGeometry( SUIT_Session::session()->resourceMgr()->stringValue( "desktop", "state", "normal" ));
+ //desktop()->retrieveGeometry( SUIT_Session::session()->resourceMgr()->stringValue( "desktop", "pos_x", "center" ));
+ //desktop()->retrieveGeometry( SUIT_Session::session()->resourceMgr()->stringValue( "desktop", "pos_y", "center" ));
+ //desktop()->retrieveGeometry( SUIT_Session::session()->resourceMgr()->stringValue( "desktop", "widht", "800" ));
+ //desktop()->retrieveGeometry( SUIT_Session::session()->resourceMgr()->stringValue( "desktop", "height", "800" ));
+ }
+
CAM_Application::start();
- QAction* a = action( ViewWindowsId );
- if ( a && a->inherits( "QtxDockAction" ) )
- ((QtxDockAction*)a)->setAutoPlace( true );
-
updateWindows();
updateViewManagers();
putInfo( "" );
- desktop()->statusBar()->message( "" );
+ desktop()->statusBar()->showMessage( "" );
LightApp_EventFilter::Init();
}
path += QString( "bin/salome/VERSION" );
QFile vf( path );
- if ( vf.open( IO_ReadOnly ) )
+ if ( vf.open( QIODevice::ReadOnly ) )
{
- QString line;
- vf.readLine( line, 1024 );
+ QString line( vf.readLine( 1024 ) );
vf.close();
if ( !line.isEmpty() )
while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
line.remove( line.length() - 1, 1 );
- int idx = line.findRev( ":" );
+ int idx = line.lastIndexOf( ":" );
if ( idx != -1 )
- _app_version = line.mid( idx + 1 ).stripWhiteSpace();
+ _app_version = line.mid( idx + 1 ).trimmed();
}
}
}
const QString& suffix,
const int accel )
{
- QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), QIconSet(),
- tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
- tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
+ QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), QIcon(),
+ tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
+ tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
accel, desktop(), false, this, SLOT( onNewWindow() ) );
createMenu( a, parentId, -1 );
}
SUIT_ResourceMgr* resMgr = resourceMgr();
//! Preferences
- createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIconSet(),
+ createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
CTRL+Key_F, desk, false, this, SLOT( onPreferences() ) );
int id = LightApp_Application::UserID + FIRST_HELP_ID;
// help for KERNEL and GUI
- QCString dir;
+ QString dir;//QByteArray dir;
QString aFileName = "index.htm";
QString root;
QAction* a;
- if (dir = getenv("GUI_ROOT_DIR")) {
+ dir = getenv("GUI_ROOT_DIR");
+ if ( !dir.isEmpty() ) {
root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash("GUI") );
if ( QFileInfo( root + aFileName ).exists() ) {
- a = createAction( id, tr( QString("GUI Help") ), QIconSet(),
- tr( QString("GUI Help") ),
- tr( QString("GUI Help") ),
+ a = createAction( id, tr( QString("GUI Help").toLatin1().constData() ), QIcon(),
+ tr( QString("GUI Help").toLatin1().constData() ),
+ tr( QString("GUI Help").toLatin1().constData() ),
0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setName( QString("GUI") );
+ a->setObjectName( QString("GUI") );
createMenu( a, helpModuleMenu, -1 );
id++;
}
}
- if (dir = getenv("KERNEL_ROOT_DIR")) {
+ dir = getenv("KERNEL_ROOT_DIR");
+ if ( !dir.isEmpty() ) {
QString aFN = "index.html";
root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
Qtx::addSlash("salome") );
if ( QFileInfo( root + aFN ).exists() ) {
- a = createAction( id, tr( QString("KERNEL Help") ), QIconSet(),
- tr( QString("KERNEL Help") ),
- tr( QString("KERNEL Help") ),
+ a = createAction( id, tr( QString("KERNEL Help").toLatin1().constData() ), QIcon(),
+ tr( QString("KERNEL Help").toLatin1().constData() ),
+ tr( QString("KERNEL Help").toLatin1().constData() ),
0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setName( QString("KERNEL") );
+ a->setObjectName( QString("KERNEL") );
createMenu( a, helpModuleMenu, -1 );
id++;
}
QString modName = moduleName( *it );
- if (dir = getenv( modName + "_ROOT_DIR")) {
+ dir = getenv( (modName + "_ROOT_DIR").toLatin1().constData() );
+ if ( !dir.isEmpty() ) {
root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash(modName) );
if ( QFileInfo( root + aFileName ).exists() ) {
- QAction* a = createAction( id, tr( moduleTitle(modName) + QString(" Help") ), QIconSet(),
- tr( moduleTitle(modName) + QString(" Help") ),
- tr( moduleTitle(modName) + QString(" Help") ),
+ QAction* a = createAction( id, tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ), QIcon(),
+ tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
+ tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setName( modName );
+ a->setObjectName( modName );
createMenu( a, helpModuleMenu, -1 );
id++;
}
if( modList.count()>1 )
{
QToolBar* modTBar = new QtxToolBar( true, desk );
- modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
+ modTBar->setObjectName( "ModuleToolBar" );
+ modTBar->setWindowTitle( tr( "INF_TOOLBAR_MODULES" ) );
QActionGroup* modGroup = new QActionGroup( this );
modGroup->setExclusive( true );
- modGroup->setUsesDropDown( true );
+ //modGroup->setUsesDropDown( true ); // to use a new class for this purpose
a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
tr( "PRP_APP_MODULE" ), 0, desk, true );
- modGroup->add( a );
+ modGroup->addAction( a );
myActions.insert( QString(), a );
QMap<QString, QString> iconMap;
const int iconSize = 20;
- modGroup->addTo( modTBar );
- QObjectList *l = modTBar->queryList( "QComboBox" );
- QObjectListIt oit( *l );
- while ( QObject* obj = oit.current() ) {
- QComboBox* cb = (QComboBox*)obj;
- if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
- ++oit;
+ modTBar->addActions(modGroup->actions());
+ QList<QComboBox*> l = modTBar->findChildren<QComboBox*>();
+ QListIterator<QComboBox*> oit( l );
+ while ( oit.hasNext() ) {
+ QComboBox* cb = oit.next();
+ if ( cb ) cb->setFocusPolicy( Qt::NoFocus );
}
- delete l;
modTBar->addSeparator();
{
icon = modIcon;
printf( "****************************************************************\n" );
- printf( "* Icon for %s not found. Using the default one.\n", (*it).latin1() );
+ printf( "* Icon for %s not found. Using the default one.\n", (*it).toLatin1().constData() );
printf( "****************************************************************\n" );
}
- icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
+ icon.fromImage( icon.toImage().scaled( iconSize, iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
- a->addTo( modTBar );
- modGroup->add( a );
+ modTBar->addAction( a );
+ modGroup->addAction( a );
myActions.insert( *it, a );
}
#endif
- createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
+ createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
if ( !a )
return;
- QString modName = a->menuText();
+ QString modName = a->text();
if ( modName == tr( "APP_NAME" ) )
modName = QString::null;
case 0:
default:
putInfo( tr("INF_CANCELLED") );
- myActions[QString()]->setOn( true );
+ myActions[QString()]->setChecked( true );
cancelled = true;
}
}
// Look among opened studies
if (activeStudy()) { // at least one study is opened
SUIT_Session* aSession = SUIT_Session::session();
- QPtrList<SUIT_Application> aAppList = aSession->applications();
- QPtrListIterator<SUIT_Application> it (aAppList);
+ QList<SUIT_Application*> aAppList = aSession->applications();
+ QListIterator<SUIT_Application*> it (aAppList);
SUIT_Application* aApp = 0;
// iterate on all applications
- for (; (aApp = it.current()) && !isAlreadyOpen; ++it) {
+ while ( it.hasNext() && !isAlreadyOpen ) {
+ if ( !(aApp = it.next()) ) break;
if (aApp->activeStudy()->studyName() == aName) {
isAlreadyOpen = true; // Already opened, ask user what to do
if ( !myApp.isEmpty())
{
- aCommand.sprintf("%s %s %s",myApp.latin1(),myParams.latin1(),myHelpFile.latin1());
+ aCommand.sprintf("%s %s %s",myApp.toLatin1().constData(),myParams.toLatin1().constData(),myHelpFile.toLatin1().constData());
QProcess* proc = new QProcess();
- proc->addArgument( aCommand );
//myStatus = system(aCommand);
//if(myStatus != 0)
- if(!proc->start())
+ proc->start(aCommand);
+ if (proc->waitForStarted())
{
- QCustomEvent* ce2000 = new QCustomEvent( 2000 );
+ SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
QString* msg = new QString( QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile) );
ce2000->setData( msg );
- postEvent( myLApp, ce2000 );
+ QApplication::postEvent( myLApp, ce2000 );
}
}
}
{
const QAction* obj = (QAction*) sender();
- QString aComponentName = obj->name();
+ QString aComponentName = obj->objectName();
QString aFileName = "index.htm";
QString aFileNameKernel = "index.html";
- QCString dir = getenv( aComponentName + "_ROOT_DIR");
+ QString dir = getenv( (aComponentName + "_ROOT_DIR").toLatin1().constData() );
QString homeDir = !aComponentName.compare(QString("KERNEL")) ?
Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") ) :
Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash(aComponentName) );
- QString helpFile = QFileInfo( homeDir + (!aComponentName.compare(QString("KERNEL")) ? aFileNameKernel : aFileName) ).absFilePath();
+ QString helpFile = QFileInfo( homeDir + (!aComponentName.compare(QString("KERNEL")) ? aFileNameKernel : aFileName) ).absoluteFilePath();
SUIT_ResourceMgr* resMgr = resourceMgr();
QString platform;
#ifdef WIN32
*/
void LightApp_Application::onHelpContextModule(const QString& theComponentName, const QString& theFileName)
{
- QCString dir = getenv( theComponentName + "_ROOT_DIR");
+ QString dir = getenv( (theComponentName + "_ROOT_DIR").toLatin1().constData() );
QString homeDir = Qtx::addSlash(Qtx::addSlash(dir)+Qtx::addSlash("share")+Qtx::addSlash("doc")+Qtx::addSlash("salome")+Qtx::addSlash("gui")+Qtx::addSlash(theComponentName));
- QString helpFile = QFileInfo( homeDir + theFileName ).absFilePath();
+ QString helpFile = QFileInfo( homeDir + theFileName ).absoluteFilePath();
SUIT_ResourceMgr* resMgr = resourceMgr();
QString platform;
#ifdef WIN32
// asv: connecting a slot for storing visibility flag of a window
connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) );
myWindows.insert( flag, newWC );
- if ( winMap.contains( flag ) )
- desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
-
- myWindows[flag]->setResizeEnabled( true );
- myWindows[flag]->setCloseMode( QDockWindow::Always );
- myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
- myWindows[flag]->setFixedExtentWidth( wid->width() );
- myWindows[flag]->setFixedExtentHeight( wid->height() );
+ if ( winMap.contains( flag ) ) {
+ desktop()->removeDockWidget( myWindows[flag] );
+ desktop()->addDockWidget( (DockWidgetArea)winMap[flag], myWindows[flag] );
+ }
+
+ //myWindows[flag]->setResizeEnabled( true );
+ myWindows[flag]->setFeatures( QDockWidget::DockWidgetClosable );
+ myWindows[flag]->setObjectName( QString( "dock_window_%1" ).arg( flag ) );
+ //myWindows[flag]->setFixedExtentWidth( wid->width() );
+ //myWindows[flag]->setFixedExtentHeight( wid->height() );
+ myWindows[flag]->resize( wid->width(), wid->height() );
}
QFont f;
#ifndef DISABLE_PYCONSOLE
- if( wid->inherits( "PythonConsole" ) )
+ if( wid->inherits( "PyConsole_Console" ) )
{
if( resourceMgr()->hasValue( "PyConsole", "font" ) )
f = resourceMgr()->fontValue( "PyConsole", "font" );
else
{
- f = ( ( PythonConsole* )wid )->font();
+ f = ( ( PyConsole_Console* )wid )->font();
resourceMgr()->setValue( "PyConsole", "font", f );
}
}
if ( myWindows.contains( type ) )
{
SUIT_Desktop* desk = ((LightApp_Application*)this)->desktop();
- res = desk && desk->appropriate( myWindows[type] );
+ //res = desk && desk->appropriate( myWindows[type] );
}
return res;
}
if ( !desktop() || !myWindows.contains( type ) )
return;
- QDockWindow* dw = myWindows[type];
- desktop()->setAppropriate( dw, on );
+ QDockWidget* dw = myWindows[type];
+ //desktop()->setAppropriate( dw, on );
if( on )
dw->show();
- else if( dw->isShown() )
+ else if( dw->isVisible() )
{
dw->hide();
myWindowsVisible[ type ] = true;
/*!
\return Object Browser
*/
-OB_Browser* LightApp_Application::objectBrowser()
+// temporary commented
+/*OB_Browser* LightApp_Application::objectBrowser()
{
OB_Browser* ob = 0;
QWidget* wid = window( WT_ObjectBrowser );
if ( wid && wid->inherits( "OB_Browser" ) )
ob = (OB_Browser*)wid;
return ob;
-}
+}*/
/*!
\return Log Window
/*!
\return Python Console
*/
-PythonConsole* LightApp_Application::pythonConsole()
+PyConsole_Console* LightApp_Application::pythonConsole()
{
- PythonConsole* console = 0;
+ PyConsole_Console* console = 0;
QWidget* wid = getWindow( WT_PyConsole );
- if ( wid->inherits( "PythonConsole" ) )
- console = (PythonConsole*)wid;
+ if ( wid->inherits( "PyConsole_Console" ) )
+ console = (PyConsole_Console*)wid;
return console;
}
#endif
// update existing data models
if ( updateModels )
{
- const bool isAutoUpdate = objectBrowser() ? objectBrowser()->isAutoUpdate() : true;
+ // temporary commented
+ /*const bool isAutoUpdate = objectBrowser() ? objectBrowser()->isAutoUpdate() : true;
if( objectBrowser() )
- objectBrowser()->setAutoUpdate( false );
+ objectBrowser()->setAutoUpdate( false );*/
LightApp_Study* study = dynamic_cast<LightApp_Study*>(activeStudy());
if ( study ) {
CAM_Study::ModelList dm_list;
study->dataModels( dm_list );
- for ( CAM_Study::ModelListIterator it( dm_list ); it.current(); ++it ) {
- CAM_DataModel* camDM = it.current();
+ QListIterator<CAM_DataModel*> it( dm_list );
+ while ( it.hasNext() ) {
+ CAM_DataModel* camDM = it.next();
if ( camDM && camDM->inherits( "LightApp_DataModel" ) )
((LightApp_DataModel*)camDM)->update();
}
}
- if( objectBrowser() )
- objectBrowser()->setAutoUpdate( isAutoUpdate );
+ // temporary commented
+ /*if( objectBrowser() )
+ objectBrowser()->setAutoUpdate( isAutoUpdate );*/
}
- if ( objectBrowser() )
+ // temporary commented
+ /*if ( objectBrowser() )
{
objectBrowser()->updateGeometry();
objectBrowser()->updateTree( 0, false );
- }
+ }*/
}
/*!
//aRoot->setName( tr( "DATA_MODELS" ) );
}
getWindow( WT_ObjectBrowser );
- if ( objectBrowser() != 0 )
- objectBrowser()->setRootObject( aRoot );
+ // temporary commented
+ /*if ( objectBrowser() != 0 )
+ objectBrowser()->setRootObject( aRoot );*/
activateModule( defaultModule() );
- if ( objectBrowser() )
- objectBrowser()->openLevels();
+ // temporary commented
+ /*if ( objectBrowser() )
+ objectBrowser()->openLevels();*/
activateWindows();
}
//aRoot->dump();
}
getWindow( WT_ObjectBrowser );
- if ( objectBrowser() )
- objectBrowser()->setRootObject( aRoot );
+ // temporary commented
+ /*if ( objectBrowser() )
+ objectBrowser()->setRootObject( aRoot );*/
activateModule( defaultModule() );
- if ( objectBrowser() )
- objectBrowser()->openLevels();
+ // temporary commented
+ /*if ( objectBrowser() )
+ objectBrowser()->openLevels();*/
activateWindows();
{
if ( !parent )
parent = desktop();
- QStringList fls = QStringList::split( ";;", filters, false );
+ QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
return SUIT_FileDlg::getFileName( parent, initial, fls, caption, open, true );
}
{
if ( !parent )
parent = desktop();
- QStringList fls = QStringList::split( ";;", filters, false );
+ QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
return SUIT_FileDlg::getOpenFileNames( parent, initial, fls, caption, true );
}
/*!Private SLOT. On preferences.*/
void LightApp_Application::onPreferences()
{
- QApplication::setOverrideCursor( Qt::waitCursor );
+ QApplication::setOverrideCursor( Qt::WaitCursor );
LightApp_PreferencesDlg* prefDlg = new LightApp_PreferencesDlg( preferences( true ), desktop());
if ( ( prefDlg->exec() == QDialog::Accepted || prefDlg->isSaved() ) && resourceMgr() ) {
if ( desktop() )
- desktop()->saveGeometry( resourceMgr(), "desktop" );
+ resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
resourceMgr()->save();
}
QWidget* wid = 0;
if ( flag == WT_ObjectBrowser )
{
- OB_Browser* ob = new OB_Browser( desktop() );
+ // temporary commented
+ /*OB_Browser* ob = new OB_Browser( desktop() );
ob->setAutoUpdate( true );
//ob->setAutoOpenLevel( 1 ); // commented by ASV as a fix to bug IPAL10107
ob->setCaption( tr( "OBJECT_BROWSER" ) );
wid = ob;
ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
+ */
}
#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
- PythonConsole* pyCons = new PythonConsole( desktop() );
- pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
+ PyConsole_Console* pyCons = new PyConsole_Console( desktop() );
+ pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
wid = pyCons;
// pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
else if ( flag == WT_LogWindow )
{
LogWindow* logWin = new LogWindow( desktop() );
- logWin->setCaption( tr( "LOG_WINDOW" ) );
+ logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
wid = logWin;
logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
*/
void LightApp_Application::defaultWindows( QMap<int, int>& aMap ) const
{
- aMap.insert( WT_ObjectBrowser, Qt::DockLeft );
+ aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
#ifndef DISABLE_PYCONSOLE
- aMap.insert( WT_PyConsole, Qt::DockBottom );
+ aMap.insert( WT_PyConsole, Qt::BottomDockWidgetArea );
#endif
// aMap.insert( WT_LogWindow, Qt::DockBottom );
}
that->myPrefs = _prefs_;
- QPtrList<SUIT_Application> appList = SUIT_Session::session()->applications();
- for ( QPtrListIterator<SUIT_Application> appIt ( appList ); appIt.current(); ++appIt )
+ QList<SUIT_Application*> appList = SUIT_Session::session()->applications();
+ QListIterator<SUIT_Application*> appIt ( appList );
+ while ( appIt.hasNext() )
{
- if ( !appIt.current()->inherits( "LightApp_Application" ) )
+ SUIT_Application* anItem = appIt.next();
+ if ( !anItem->inherits( "LightApp_Application" ) )
continue;
- LightApp_Application* app = (LightApp_Application*)appIt.current();
+ LightApp_Application* app = (LightApp_Application*)anItem;
QStringList modNameList;
app->modules( modNameList, false );
ModuleList modList;
app->modules( modList );
- for ( ModuleListIterator itr( modList ); itr.current(); ++itr )
+ QListIterator<CAM_Module*> itr( modList );
+ while ( itr.hasNext() )
{
LightApp_Module* mod = 0;
- if ( itr.current()->inherits( "LightApp_Module" ) )
- mod = (LightApp_Module*)itr.current();
+
+ CAM_Module* anItem = itr.next();
+ if ( anItem->inherits( "LightApp_Module" ) )
+ mod = (LightApp_Module*)anItem;
if ( mod && !_prefs_->hasModule( mod->moduleName() ) )
{
int modCat = _prefs_->addPreference( mod->moduleName() );
- _prefs_->setItemProperty( modCat, "info", QString::null );
+ _prefs_->setItemProperty( modCat, "info", QString() );
if( toCreate )
mod->createPreferences();
}
if ( myPrefs && lightMod && !myPrefs->hasModule( lightMod->moduleName() ))
{
int modCat = myPrefs->addPreference( mod->moduleName() );
- myPrefs->setItemProperty( modCat, "info", QString::null );
+ myPrefs->setItemProperty( modCat, "info", QString() );
lightMod->createPreferences();
}
}
#endif
int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, LightApp_Preferences::File, "ExternalBrowser", platform );
pref->setItemProperty( apppref, "existing", true );
- pref->setItemProperty( apppref, "flags", QFileInfo::ExeUser );
+ pref->setItemProperty( apppref, "flags", QFile::ExeUser );
pref->setItemProperty( apppref, "readOnly", false );
pref->addPreference( tr( "PREF_PARAM" ), extgroup, LightApp_Preferences::String, "ExternalBrowser", "parameters" );
aLegendPosList.append( tr("PREF_TOP") );
aLegendPosList.append( tr("PREF_BOTTOM") );
- QValueList<QVariant> anIndexesList;
+ QList<QVariant> anIndexesList;
anIndexesList.append(0);
anIndexesList.append(1);
anIndexesList.append(2);
if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
{
double sz = resMgr->doubleValue( sec, param, -1 );
- QPtrList<SUIT_ViewManager> lst;
+ QList<SUIT_ViewManager*> lst;
viewManagers( OCCViewer_Viewer::Type(), lst );
- for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() && sz >= 0 )
{
- SUIT_ViewModel* vm = it.current()->getViewModel();
+ SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
continue;
{
double sz = resMgr->doubleValue( "VTKViewer", "trihedron_size", -1 );
bool isRelative = resMgr->booleanValue( "VTKViewer", "relative_size", true );
- QPtrList<SUIT_ViewManager> lst;
+ QList<SUIT_ViewManager*> lst;
#ifndef DISABLE_SALOMEOBJECT
viewManagers( SVTK_Viewer::Type(), lst );
- for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() && sz >= 0 )
{
- SUIT_ViewModel* vm = it.current()->getViewModel();
+ SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
continue;
#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && ( param == QString( "iso_number_u" ) || param == QString( "iso_number_v" ) ) )
{
- QPtrList<SUIT_ViewManager> lst;
+ QList<SUIT_ViewManager*> lst;
viewManagers( OCCViewer_Viewer::Type(), lst );
int u = resMgr->integerValue( sec, "iso_number_u" );
int v = resMgr->integerValue( sec, "iso_number_v" );
- for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
{
- OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.current() );
+ OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.next() );
if( mgr && mgr->getOCCViewer() )
mgr->getOCCViewer()->setIsos( u, v );
}
{
if( param=="auto_size" || param=="auto_size_first" )
{
- OB_Browser* ob = objectBrowser();
+ // temporary commented
+ /*OB_Browser* ob = objectBrowser();
if( !ob )
return;
for( int i=1; i<ob->listView()->columns(); i++ )
if( ob->listView()->columnWidth( i )>0 )
ob->listView()->adjustColumn( i );
- updateObjectBrowser( false );
+ updateObjectBrowser( false );*/
}
}
if ( resourceMgr() )
{
if ( desktop() )
- desktop()->saveGeometry( resourceMgr(), "desktop" );
+ resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
resourceMgr()->save();
}
}
aTitle += QString( " " ) + aVer;
if ( activeStudy() ) {
- QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
+ QString sName = SUIT_Tools::file( activeStudy()->studyName().trimmed(), false );
aTitle += QString( " - [%1]" ).arg( sName );
}
- desktop()->setCaption( aTitle );
+ desktop()->setWindowTitle( aTitle );
}
/*!
modName = activeModule()->moduleName();
if ( myActions.contains( modName ) )
- myActions[modName]->setOn( true );
+ myActions[modName]->setChecked( true );
}
/*!
for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it ) {
getWindow( it.key() );
- Dock dock; int index, extraOffset; bool nl;
- if ( desktop()->getLocation( myWindows[it.key()], dock, index, nl, extraOffset )
+ DockWidgetArea dock = desktop()->dockWidgetArea( myWindows[it.key()] );
+ if ( dock != NoDockWidgetArea
&&
- dock != (Dock)it.data() )
- desktop()->moveDockWindow( myWindows[it.key()], (Dock)it.data() );
+ dock != (DockWidgetArea)it.value() ) {
+ desktop()->removeDockWidget( myWindows[it.key()] );
+ desktop()->addDockWidget( (DockWidgetArea)it.value(), myWindows[it.key()] );
+ }
}
loadWindowsGeometry();
!myWindowsVisible[ itr.key() ] )
continue;
- setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) );
+ setWindowShown( itr.key(), !itr.value()->isEmpty() && winMap.contains( itr.key() ) );
}
}
if( !store )
return;
- QtxDockAction* dockMgr = 0;
-
- QAction* a = action( ViewWindowsId );
- if ( a && a->inherits( "QtxDockAction" ) )
- dockMgr = (QtxDockAction*)a;
-
- if ( !dockMgr )
- return;
-
QString modName;
if ( activeModule() )
- modName = activeModule()->name("");
-
- QString section = QString( "windows_geometry" );
- if ( !modName.isEmpty() )
- section += QString( "." ) + modName;
+ modName = activeModule()->objectName();
- dockMgr->loadGeometry( resourceMgr(), section, false );
- dockMgr->restoreGeometry();
+ desktop()->restoreState( resourceMgr()->stringValue( "windows_geometry", modName ).toLatin1() );
}
/*!
if( !store )
return;
- QtxDockAction* dockMgr = 0;
-
- QAction* a = action( ViewWindowsId );
- if ( a && a->inherits( "QtxDockAction" ) )
- dockMgr = (QtxDockAction*)a;
-
- if ( !dockMgr )
- return;
-
QString modName;
if ( activeModule() )
- modName = activeModule()->name("");
+ modName = activeModule()->objectName();
- QString section = QString( "windows_geometry" );
- if ( !modName.isEmpty() )
- section += QString( "." ) + modName;
-
- dockMgr->storeGeometry();
- dockMgr->saveGeometry( resourceMgr(), section, false );
+ resourceMgr()->setValue( "windows_geometry", modName, desktop()->saveState() );
}
/*!
if ( activeStudy() )
{
for ( WindowMap::Iterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
- itr.data()->activate( activeStudy()->id() );
+ itr.value()->activate( activeStudy()->id() );
}
}
/*!
Inserts items in popup, which necessary for current application
*/
-void LightApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
+void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
{
CAM_Application::contextMenuPopup( type, thePopup, title );
- OB_Browser* ob = objectBrowser();
+ // temporary commented
+ /*OB_Browser* ob = objectBrowser();
if ( !ob || type != ob->popupClientType() )
- return;
+ return;*/
- thePopup->insertSeparator();
- thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
+ thePopup->addSeparator();
+ thePopup->addAction( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
}
/*!
void LightApp_Application::createEmptyStudy()
{
CAM_Application::createEmptyStudy();
- if ( objectBrowser() )
- objectBrowser()->updateTree();
+ // temporary commented
+ /*if ( objectBrowser() )
+ objectBrowser()->updateTree();*/
}
/*!
bool LightApp_Application::activateModule( CAM_Module* mod )
{
bool res = CAM_Application::activateModule( mod );
- if ( objectBrowser() )
- objectBrowser()->updateTree();
+ // temporary commented
+ /*if ( objectBrowser() )
+ objectBrowser()->updateTree();*/
return res;
}
// remove destroyed widget container from windows map
for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
{
- if ( itr.data() != ob )
+ if ( itr.value() != ob )
continue;
int key = itr.key();
return;
bool ok;
- QString name = QInputDialog::getText( tr( "TOT_RENAME" ), tr( "PRP_RENAME" ), QLineEdit::Normal, w->caption(), &ok, w );
+ QString name = QInputDialog::getText( w, tr( "TOT_RENAME" ), tr( "PRP_RENAME" ), QLineEdit::Normal, w->windowTitle(), &ok );
if( ok && !name.isEmpty() )
- w->setCaption( name );
+ w->setWindowTitle( name );
}
/*!
QStringList paths;
#ifdef WIN32
- paths = QStringList::split( ";", ::getenv( "PATH" ) );
+ paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
#else
- paths = QStringList::split( ":", ::getenv( "LD_LIBRARY_PATH" ) );
+ paths = QString(::getenv( "LD_LIBRARY_PATH" )).split( ":", QString::SkipEmptyParts );
#endif
bool isLibFound = false;
if ( !isLibFound )
{
printf( "****************************************************************\n" );
- printf( "* Warning: library %s cannot be found\n", moduleTitle.latin1() );
+ printf( "* Warning: library %s cannot be found\n", moduleTitle.toLatin1().constData() );
printf( "* Module will not be available\n" );
printf( "****************************************************************\n" );
}
// Check the python library
#ifdef WIN32
- paths = QStringList::split( ";", ::getenv( "PATH" ) );
+ paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
#else
- paths = QStringList::split( ":", ::getenv( "PYTHONPATH" ) );
+ paths = QString(::getenv( "PYTHONPATH" )).split( ":", QString::SkipEmptyParts );
#endif
bool isPyLib = false, isPyGuiLib = false;
QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
}
printf( "****************************************************************\n" );
- printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.latin1() );
+ printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() );
if (!isPyLib)
- printf( "* No module named %s\n", moduleName( moduleTitle ).latin1() );
+ printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
if (!isPyGuiLib)
- printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).latin1() );
+ printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
printf( "****************************************************************\n" );
return true;
}
const QObject* win = sender();
for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
- if ( itr.data() == win )
+ if ( itr.value() == win )
{
myWindowsVisible[ itr.key() ] = visible;
return;
{
if( e && e->type()==2000 )
{
- QCustomEvent* ce = ( QCustomEvent* )e;
+ SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e;
QString* d = ( QString* )ce->data();
if( SUIT_MessageBox::question(0, tr("WRN_WARNING"),
d ? *d : "",
#include <CAM_Application.h>
class LogWindow;
-class OB_Browser;
+//class OB_Browser;
#ifndef DISABLE_PYCONSOLE
- class PythonConsole;
+ class PyConsole_Console;
#endif
-class STD_Application;
+//class STD_Application;
class LightApp_WidgetContainer;
class LightApp_Preferences;
class LightApp_SelectionMgr;
class QString;
class QWidget;
class QStringList;
-class QPixmap;
+//class QPixmap;
#ifdef WIN32
#pragma warning( disable:4251 )
LightApp_SelectionMgr* selectionMgr() const;
LogWindow* logWindow();
- OB_Browser* objectBrowser();
+ //OB_Browser* objectBrowser();
#ifndef DISABLE_PYCONSOLE
- PythonConsole* pythonConsole();
+ PyConsole_Console* pythonConsole();
#endif
virtual void updateObjectBrowser( const bool = true );
virtual void start();
- virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
+ virtual void contextMenuPopup( const QString&, QMenu*, QString& );
virtual void createEmptyStudy();
#include "LightApp_Module.h"
#include "LightApp_Application.h"
-#include <OB_Browser.h>
+// temporary commented
+//#include <OB_Browser.h>
-#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
#include <SUIT_DataObject.h>
/*!
void LightApp_DataModel::updateWidgets()
{
LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
- if( app )
- app->objectBrowser()->updateTree( 0, false );
+ // temporary commented
+ /*if( app )
+ app->objectBrowser()->updateTree( 0, false );*/
}
/*!
if( modelRoot )
{
ch = modelRoot->children();
- for ( DataObjectListIterator it( ch ); it.current(); ++it )
- it.current()->setParent( 0 );
+ QListIterator<SUIT_DataObject*> it( ch );
+ while ( it.hasNext() )
+ it.next()->setParent( 0 );
}
build();
if( modelRoot )
{
DataObjectList new_ch = modelRoot->children();
- for ( DataObjectListIterator it1( new_ch ); it1.current(); ++it1 )
- aMap.insert( it1.current(), 0 );
+ QListIterator<SUIT_DataObject*> it1( new_ch );
+ while ( it1.hasNext() )
+ aMap.insert( it1.next(), 0 );
}
updateWidgets();
- for( DataObjectListIterator it( ch ); it.current(); ++it )
- if( !aMap.contains( it.current() ) )
- delete it.current();
+ QListIterator<SUIT_DataObject*> it( ch );
+ while ( it.hasNext() ) {
+ SUIT_DataObject* aDO = it.next();
+ if( !aMap.contains( aDO ) )
+ delete aDO;
+ }
}
/*!
#include "CAM_DataModel.h"
#include "CAM_Module.h"
-#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
#include <SUIT_DataObjectKey.h>
-#include <qobject.h>
-
/*!
Class: LightApp_DataObject::Key
Level: Internal
#include "LightApp.h"
#include "CAM_DataObject.h"
-#include "CAM_DataModel.h"
#include "CAM_RootObject.h"
+class CAM_DataModel;
+
class LightApp_Study;
/*!Description : Data Object has empty entry so it's children must redefine metod entry() and return some unique string*/
#include "LightApp_DataOwner.h"
-#include "LightApp_DataObject.h"
-
-#include <iostream>
-
/*!Constructor. Initialize by \a theEntry.*/
LightApp_DataOwner::LightApp_DataOwner( const QString& theEntry )
: myEntry( theEntry )
//
#include "LightApp_DataSubOwner.h"
-#include "LightApp_DataObject.h"
-
/*!Constructor.Initialize by \a entry and \a index*/
LightApp_DataSubOwner::LightApp_DataSubOwner( const QString& entry, const int index )
: LightApp_DataOwner( entry ),
#include <LightApp_Dialog.h>
#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
-#include <qtoolbutton.h>
-#include <qlineedit.h>
-#include <qlabel.h>
+#include <QAbstractButton>
+#include <QToolButton>
+#include <QLineEdit>
+#include <QLabel>
/*!
Constructor
*/
LightApp_Dialog::LightApp_Dialog( QWidget* parent, const char* name, bool modal,
- bool allowResize, const int f, WFlags wf )
-: QtxDialog( parent, name, modal, allowResize, f, wf ),
+ bool allowResize, const int f, Qt::WindowFlags wf )
+: QtxDialog( parent, modal, allowResize, f, wf ),
myIsExclusive( true ),
myIsBusy( false )
{
+ setObjectName( name );
setObjectPixmap( "LightApp", tr( "ICON_SELECT" ) );
}
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
{
- QToolButton* but = (QToolButton*)anIt.data().myBtn;
- if( but && but->isOn() )
+ QToolButton* but = (QToolButton*)anIt.value().myBtn;
+ if( but && but->isChecked() )
{
if( id==-1 )
id = anIt.key();
if( anIt.key()!=id )
- but->setOn( false );
+ but->setChecked( false );
}
}
}
obj.myBtn->setShown( shown );
obj.myLabel->setShown( shown );
if( !shown )
- ( ( QToolButton* )obj.myBtn )->setOn( false );
+ ( ( QToolButton* )obj.myBtn )->setChecked( false );
}
}
*/
bool LightApp_Dialog::isObjectShown( const int id ) const
{
- return myObjects.contains( id ) && myObjects[ id ].myEdit->isShown();
+ return myObjects.contains( id ) && myObjects[ id ].myEdit->isVisible();
}
/*!
obj.myBtn->setEnabled( en );
// obj.myLabel->setEnabled( en );
if( !en )
- ( ( QToolButton* )obj.myBtn )->setOn( false );
+ ( ( QToolButton* )obj.myBtn )->setChecked( false );
}
}
ObjectMap::iterator anIt = myObjects.begin(),
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
- if( anIt.data().myBtn->isOn() )
+ if( anIt.value().myBtn->isChecked() )
selectObject( anIt.key(), _names, _types, _ids, update );
}
myObjects[ nid ].myLabel = lab;
QToolButton* but = new QToolButton( parent );
- but->setIconSet( QIconSet( myPixmap ) );
- but->setToggleButton( true );
+ but->setIcon( QIcon( myPixmap ) );
+ but->setCheckable( true );
but->setMaximumWidth( but->height() );
but->setMinimumWidth( but->height() );
connect( but, SIGNAL( toggled( bool ) ), this, SLOT( onToggled( bool ) ) );
*/
void LightApp_Dialog::onToggled( bool on )
{
- QButton* but = ( QButton* )sender();
+ QAbstractButton* but = ( QAbstractButton* )sender();
int id = -1;
if( !but )
ObjectMap::const_iterator anIt = myObjects.begin(),
aLast = myObjects.end();
for( ; anIt!=aLast && id==-1; anIt++ )
- if( anIt.data().myBtn==but )
+ if( anIt.value().myBtn==but )
id = anIt.key();
if( id!=-1 )
ObjectMap::const_iterator anIt = myObjects.begin(),
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
- ( ( QToolButton* )anIt.data().myBtn )->setIconSet( p );
+ ( ( QToolButton* )anIt.value().myBtn )->setIcon( p );
}
/*!
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
{
- anIt.data().myNI = ni;
+ anIt.value().myNI = ni;
setReadOnly( anIt.key(), isReadOnly( anIt.key() ) );
aNext = anIt; aNext++;
updateObject( anIt.key(), aNext==aLast );
QMap<int,int>::const_iterator aMIt = typesCount.begin(),
aMLast = typesCount.end();
for( ; aMIt!=aMLast; aMIt++ )
- typeCount.append( QString( "%1 %2" ).arg( aMIt.data() ).arg( typeName( aMIt.key() ) ) );
+ typeCount.append( QString( "%1 %2" ).arg( aMIt.value() ).arg( typeName( aMIt.key() ) ) );
return typeCount.join( ", " );
}
*/
void LightApp_Dialog::activateObject( const int theId )
{
- if ( myObjects.contains( theId ) && !myObjects[ theId ].myBtn->isOn() )
+ if ( myObjects.contains( theId ) && !myObjects[ theId ].myBtn->isChecked() )
myObjects[ theId ].myBtn->toggle();
}
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
{
- QToolButton* btn = ( QToolButton* )anIt.data().myBtn;
- btn->setOn( false );
+ QToolButton* btn = ( QToolButton* )anIt.value().myBtn;
+ btn->setChecked( false );
}
}
ObjectMap::const_iterator anIt = myObjects.begin(),
aLast = myObjects.end();
for( ; anIt!=aLast; anIt++ )
- if( anIt.data().myEdit == edit )
+ if( anIt.value().myEdit == edit )
id = anIt.key();
if( id>=0 && !isReadOnly( id ) )
{
- QStringList list = QStringList::split( " ", text );
+ QStringList list = text.split( " ", QString::SkipEmptyParts );
emit objectChanged( id, list );
}
}
#include "LightApp.h"
#include <QtxDialog.h>
-#include <qvaluelist.h>
-#include <qmap.h>
-#include <qpixmap.h>
+#include <QList>
+#include <QMap>
+#include <QPixmap>
class QLineEdit;
-class QButton;
+class QAbstractButton;
class QLabel;
class SUIT_ResourceMgr;
Q_OBJECT
public:
- typedef QValueList<int> TypesList;
+ typedef QList<int> TypesList;
typedef QMap<int,QStringList> SelectedObjects;
enum ObjectWg
public:
LightApp_Dialog( QWidget* = 0, const char* = 0, bool = false,
- bool = false, const int = Standard, WFlags = 0 );
+ bool = false, const int = Standard, Qt::WindowFlags = 0 );
virtual ~LightApp_Dialog();
virtual void show();
private:
typedef struct
{
- QLineEdit* myEdit;
- QButton* myBtn;
- QLabel* myLabel;
- QStringList myNames, myIds;
- TypesList myTypes, myPossibleTypes;
- NameIndication myNI;
+ QLineEdit* myEdit;
+ QAbstractButton* myBtn;
+ QLabel* myLabel;
+ QStringList myNames, myIds;
+ TypesList myTypes, myPossibleTypes;
+ NameIndication myNI;
} Object;
#include <SUIT_ViewModel.h>
#include <SUIT_ViewWindow.h>
-#include <qstring.h>
+#include <QString>
#ifndef DISABLE_SALOMEOBJECT
#include "SALOME_InteractiveObject.hxx"
#endif
if ( app )
{
SUIT_Desktop* desk = app->desktop();
- QPtrList<SUIT_ViewWindow> wnds = desk->windows();
- SUIT_ViewWindow* wnd;
- for ( wnd = wnds.first(); wnd; wnd = wnds.next() )
+ QListIterator<SUIT_ViewWindow*> itWnds( desk->windows() );
+ while ( itWnds.hasNext() )
{
- SUIT_ViewManager* vman = wnd->getViewManager();
+ SUIT_ViewManager* vman = itWnds.next()->getViewManager();
if( !vman )
continue;
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
if ( vf ) {
- SALOME_Prs* prs = vf->CreatePrs( entry.latin1() );
+ SALOME_Prs* prs = vf->CreatePrs( entry.toLatin1() );
if ( prs ) {
vf->Erase( prs, forced );
if ( updateViewer )
{
#ifndef DISABLE_SALOMEOBJECT
Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject();
- temp->setEntry( entry.latin1() );
+ temp->setEntry( entry.toLatin1() );
res = vf->isVisible( temp );
#endif
}
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
if ( vf )
- prs = vf->CreatePrs( entry.latin1() );
+ prs = vf->CreatePrs( entry.toLatin1() );
return prs;
}
#include <OSD_Path.hxx>
#include <OSD_File.hxx>
#include <OSD_Directory.hxx>
-#include <OSD_Process.hxx>
-#include <OSD_Directory.hxx>
#include <OSD_Protection.hxx>
-#include <OSD_SingleProtection.hxx>
#include <OSD_FileIterator.hxx>
-#include <qfileinfo.h>
-#include <qdir.h>
+#include <QFileInfo>
+#include <QDir>
#ifdef WIN32
#include <time.h>
if(aFileBuffer == NULL)
return false;
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).dirPath( true ) + "/" ).latin1() ;
+ myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
int aCurrentPos = 0;
ifstream aFile(theFileName);
#endif
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).dirPath( true ) + "/" ).latin1() ;
+ myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
aFile.seekg(0, ios::end);
int aFileBufferSize = aFile.tellg();
#include <SUIT_Desktop.h>
-#include <qapplication.h>
+#include <QApplication>
LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL;
#include "LightApp.h"
-#include <qobject.h>
+#include <QObject>
#if defined WIN32
#pragma warning( disable: 4251 )
#include "LightApp_GLSelector.h"
#include "LightApp_DataOwner.h"
-#include "LightApp_DataObject.h"
#include <GLViewer_Context.h>
+#include <GLViewer_Object.h>
/*!Constructor. Initialize by GLViewer_Viewer2d and SUIT_SelectionMgr.*/
LightApp_GLSelector::LightApp_GLSelector( GLViewer_Viewer2d* viewer, SUIT_SelectionMgr* mgr )
#include <GLViewer_Viewer2d.h>
-#include <string>
-#include <GLViewer_Object.h>
+#include <QObject>
class LightApp_DataObject;
\class LightApp_GLSelector
Custom selector to get/set selection from GL viewer
*/
-class LIGHTAPP_EXPORT LightApp_GLSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_GLSelector : public QObject, public SUIT_Selector
{
Q_OBJECT
//
#include "LightApp_HDFDriver.h"
-#include "HDFexplorer.hxx"
#include "HDFOI.hxx"
// OCCT Includes
#include "LightApp_UpdateFlags.h"
#include "LightApp_ShowHideOp.h"
-#include "SUIT_Operation.h"
#include <SUIT_Study.h>
#include <SUIT_DataObject.h>
+#include <SUIT_Operation.h>
+#include <SUIT_ViewManager.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
#ifndef DISABLE_VTKVIEWER
#ifndef DISABLE_SALOMEOBJECT
#endif
#endif
-#include <OB_Browser.h>
+// temporary commented
+//#include <OB_Browser.h>
#include <QtxPopupMgr.h>
-#include <qvariant.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <QVariant>
+#include <QString>
+#include <QStringList>
/*!Constructor.*/
LightApp_Module::LightApp_Module( const QString& name )
}
/*!Context menu popup.*/
-void LightApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ )
+void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QString& /*title*/ )
{
- LightApp_Selection* sel = createSelection();
- sel->init( client, getApp()->selectionMgr() );
- popupMgr()->updatePopup( menu, sel );
+ LightApp_Selection* sel = createSelection( client, getApp()->selectionMgr() );
+ popupMgr()->setSelection( sel );
+ popupMgr()->setMenu( menu );
+ popupMgr()->updateMenu();
delete sel;
}
void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
SUIT_DataObject* theDataObject )
{
- bool upd = getApp()->objectBrowser()->isAutoUpdate();
- getApp()->objectBrowser()->setAutoUpdate( false );
+ // temporary commented
+ /*bool upd = getApp()->objectBrowser()->isAutoUpdate();
+ getApp()->objectBrowser()->setAutoUpdate( false );*/
if( theIsUpdateDataModel ){
if( CAM_DataModel* aDataModel = dataModel() ){
}
}
}
- getApp()->objectBrowser()->setAutoUpdate( upd );
- getApp()->objectBrowser()->updateTree( 0, false );
+ // temporary commented
+ /*getApp()->objectBrowser()->setAutoUpdate( upd );
+ getApp()->objectBrowser()->updateTree( 0, false );*/
}
/*!NOT IMPLEMENTED*/
// abort all operations
MapOfOperation::const_iterator anIt;
for( anIt = myOperations.begin(); anIt != myOperations.end(); anIt++ ) {
- anIt.data()->abort();
+ anIt.value()->abort();
}
return CAM_Module::activateModule( study );
if( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) )
aModel->update( 0, dynamic_cast<LightApp_Study*>( getApp()->activeStudy() ) );
}
- if ( theFlags & UF_ObjBrowser )
- getApp()->objectBrowser()->updateTree( 0 );
+ // temporary commented
+ /*if ( theFlags & UF_ObjBrowser )
+ getApp()->objectBrowser()->updateTree( 0 );*/
if ( theFlags & UF_Controls )
updateControls();
if ( theFlags & UF_Viewer )
}
/*!Create and return instance of LightApp_Selection.*/
-LightApp_Selection* LightApp_Module::createSelection() const
+LightApp_Selection* LightApp_Module::createSelection( const QString& client, LightApp_SelectionMgr* mgr ) const
{
- return new LightApp_Selection();
+ return new LightApp_Selection( client, mgr );
}
/*!NOT IMPLEMENTED*/
QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) )";
QString uniform = "true in $canBeDisplayed and %1 and ( activeModule = '%2' )";
uniform = uniform.arg( oneAndNotActive ).arg( name() );
- myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, true );
- myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, true );
- myPopupMgr->setRule( dispOnly, uniform, true );
+ myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
+ myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
+ myPopupMgr->setRule( dispOnly, uniform, QtxPopupMgr::VisibleRule );
QStringList viewers;
for( ; anIt!=aLast; anIt++ )
strViewers+=temp.arg( *anIt );
strViewers+="}";
- myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), true );
+ myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), QtxPopupMgr::VisibleRule );
}
}
return myPopupMgr;
MapOfOperation::const_iterator anIt = myOperations.begin(),
aLast = myOperations.end();
for( ; anIt!=aLast; anIt++ )
- if( anIt.data()==op )
+ if( anIt.value()==op )
{
myOperations.remove( anIt.key() );
break;
class LightApp_Selection;
class LightApp_Operation;
class LightApp_SwitchOp;
-class LightApp_ShowHideOp;
class LightApp_Displayer;
+class LightApp_SelectionMgr;
class SUIT_Study;
class SUIT_DataObject;
virtual void windows( QMap<int, int>& ) const;
virtual void viewManagers( QStringList& ) const;
- virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
+ virtual void contextMenuPopup( const QString&, QMenu*, QString& );
virtual void createPreferences();
virtual void studyActivated() {};
virtual LightApp_Displayer* displayer();
- virtual LightApp_Selection* createSelection() const;
+ virtual LightApp_Selection* createSelection( const QString&, LightApp_SelectionMgr* ) const;
public slots:
virtual bool activateModule( SUIT_Study* );
#include <LightApp_ModuleDlg.h>
-#include <qframe.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
+#include <QFrame>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
#ifndef WIN32
using namespace std;
*/
//==============================================================================================================================
LightApp_ModuleDlg::LightApp_ModuleDlg ( QWidget * parent, const QString& component, const QPixmap icon )
- : QDialog ( parent, "ActivateModuleDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ : QDialog ( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
+ setObjectName( "ActivateModuleDlg" );
+ setModal( true );
+
QPixmap defaultIcon( ( const char** ) default_icon );
- setCaption( tr( "CAPTION" ) );
+ setWindowTitle( tr( "CAPTION" ) );
setSizeGripEnabled( TRUE );
QGridLayout* ActivateModuleDlgLayout = new QGridLayout( this );
ActivateModuleDlgLayout->setMargin( 11 ); ActivateModuleDlgLayout->setSpacing( 6 );
// Module's name and icon
- myComponentFrame = new QFrame( this, "myComponentFrame" );
+ myComponentFrame = new QFrame( this );
+ myComponentFrame->setObjectName( "myComponentFrame" );
myComponentFrame->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ) );
myComponentFrame->setMinimumHeight( 100 );
myComponentFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
myComponentFrameLayout->setMargin( 11 ); myComponentFrameLayout->setSpacing( 6 );
// --> icon
- myComponentIcon = new QLabel( myComponentFrame, "myComponentIcon" );
+ myComponentIcon = new QLabel( myComponentFrame );
+ myComponentIcon->setObjectName( "myComponentIcon" );
myComponentIcon->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myComponentIcon->setPixmap( !icon.isNull() ? icon : defaultIcon );
myComponentIcon->setScaledContents( false );
- myComponentIcon->setAlignment( AlignCenter );
+ myComponentIcon->setAlignment( Qt::AlignCenter );
// --> name
- myComponentLab = new QLabel( component, myComponentFrame, "myComponentLab" );
+ myComponentLab = new QLabel( component, myComponentFrame );
+ myComponentLab->setObjectName( "myComponentLab" );
QFont fnt = myComponentLab->font(); fnt.setBold( TRUE ); myComponentLab->setFont( fnt );
- myComponentLab->setAlignment( AlignCenter );
+ myComponentLab->setAlignment( Qt::AlignCenter );
myComponentFrameLayout->addWidget( myComponentIcon, 0, 0 );
myComponentFrameLayout->addWidget( myComponentLab, 0, 1 );
infoLayout->setMargin( 0 ); infoLayout->setSpacing( 6 );
// --> top line
- QFrame* myLine1 = new QFrame( this, "myLine1" );
+ QFrame* myLine1 = new QFrame( this );
+ myLine1->setObjectName( "myLine1" );
myLine1->setFrameStyle( QFrame::HLine | QFrame::Plain );
// --> info label
- myInfoLabel = new QLabel( tr ("ActivateComponent_DESCRIPTION"), this, "myInfoLabel" );
- myInfoLabel->setAlignment( AlignCenter );
+ myInfoLabel = new QLabel( tr ("ActivateComponent_DESCRIPTION"), this );
+ myInfoLabel->setObjectName( "myInfoLabel" );
+ myInfoLabel->setAlignment( Qt::AlignCenter );
// --> bottom line
- QFrame* myLine2 = new QFrame( this, "myLine2" );
+ QFrame* myLine2 = new QFrame( this );
+ myLine2->setObjectName( "myLine2" );
myLine2->setFrameStyle( QFrame::HLine | QFrame::Plain );
infoLayout->addStretch();
btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 );
// --> New
- myNewBtn = new QPushButton( tr( "NEW" ), this, "myNewBtn" );
+ myNewBtn = new QPushButton( tr( "NEW" ), this );
+ myNewBtn->setObjectName( "myNewBtn" );
myNewBtn->setDefault( true ); myNewBtn->setAutoDefault( true );
// --> Open
- myOpenBtn = new QPushButton( tr( "OPEN" ), this, "myOpenBtn" );
+ myOpenBtn = new QPushButton( tr( "OPEN" ), this );
+ myOpenBtn->setObjectName( "myOpenBtn" );
myOpenBtn->setAutoDefault( true );
// --> Load
- myLoadBtn = new QPushButton( tr( "LOAD" ), this, "myLoadBtn" );
+ myLoadBtn = new QPushButton( tr( "LOAD" ), this );
+ myLoadBtn->setObjectName( "myLoadBtn" );
myLoadBtn->setAutoDefault( true );
// --> Cancel
- myCancelBtn = new QPushButton( tr( "CANCEL" ), this, "myCancelBtn" );
+ myCancelBtn = new QPushButton( tr( "CANCEL" ), this );
+ myCancelBtn->setObjectName( "myCancelBtn" );
myCancelBtn->setAutoDefault( true );
btnLayout->addWidget( myNewBtn );
btnLayout->addStretch();
btnLayout->addWidget( myCancelBtn );
- ActivateModuleDlgLayout->addWidget( myComponentFrame, 0, 0 );
- ActivateModuleDlgLayout->addLayout( infoLayout, 0, 1 );
- ActivateModuleDlgLayout->addMultiCellLayout( btnLayout, 1, 1, 0, 1 );
+ ActivateModuleDlgLayout->addWidget( myComponentFrame, 0, 0 );
+ ActivateModuleDlgLayout->addLayout( infoLayout, 0, 1 );
+ ActivateModuleDlgLayout->addLayout( btnLayout, 1, 0, 1, 2 );
// signals and slots connections
connect( myNewBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
#define LIGHTAPP_MODULEDLG_H
#include "LightApp.h"
-#include <qdialog.h>
-#include <qpixmap.h>
+#include <QDialog>
+#include <QPixmap>
class QFrame;
class QLabel;
// $Header$
#include <LightApp_NameDlg.h>
-#include <SUIT_Application.h>
-#include <SUIT_Desktop.h>
#include <SUIT_Tools.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
#ifndef WIN32
using namespace std;
*/
LightApp_NameDlg::LightApp_NameDlg( QWidget* parent )
: QDialog( parent ? parent : NULL,//application()->desktop(),
-"LightApp_NameDlg",
-true,
-WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
- setCaption( tr("TLT_RENAME") );
+ setObjectName( "LightApp_NameDlg" );
+ setModal( true );
+
+ setWindowTitle( tr("TLT_RENAME") );
setSizeGripEnabled( TRUE );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
/***************************************************************/
- QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
- GroupC1->setColumnLayout(0, Qt::Vertical );
- GroupC1->layout()->setMargin( 0 ); GroupC1->layout()->setSpacing( 0 );
- QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1->layout() );
+ QGroupBox* GroupC1 = new QGroupBox( this );
+ GroupC1->setObjectName( "GroupC1" );
+ QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1 );
GroupC1Layout->setAlignment( Qt::AlignTop );
GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 );
- QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" );
+ QLabel* TextLabel = new QLabel( GroupC1 );
+ TextLabel->setObjectName( "TextLabel1" );
TextLabel->setText( tr( "NAME_LBL" ) );
GroupC1Layout->addWidget( TextLabel );
- myLineEdit = new QLineEdit( GroupC1, "LineEdit1" );
+ myLineEdit = new QLineEdit( GroupC1 );
+ myLineEdit->setObjectName( "LineEdit1" );
myLineEdit->setMinimumSize( 250, 0 );
GroupC1Layout->addWidget( myLineEdit );
/***************************************************************/
- QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setMargin( 0 ); GroupButtons->layout()->setSpacing( 0 );
- QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
+ QGroupBox* GroupButtons = new QGroupBox( this );
+ GroupButtons->setObjectName( "GroupButtons" );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
- myButtonOk = new QPushButton( GroupButtons, "buttonOk" );
+ myButtonOk = new QPushButton( GroupButtons );
+ myButtonOk->setObjectName( "buttonOk" );
myButtonOk->setText( tr( "BUT_OK" ) );
myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( myButtonOk );
GroupButtonsLayout->addStretch();
- myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+ myButtonCancel = new QPushButton( GroupButtons );
+ myButtonCancel->setObjectName( "buttonCancel" );
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
myButtonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( myButtonCancel );
*/
void LightApp_NameDlg::accept()
{
- if ( name().stripWhiteSpace().isEmpty() )
+ if ( name().trimmed().isEmpty() )
return;
QDialog::accept();
}
#define LIGHTAPP_NAMEDLG_H
#include "LightApp.h"
-#include <qdialog.h>
+#include <QDialog>
class QLineEdit;
class QPushButton;
#include "LightApp_DataObject.h"
#include "LightApp_Application.h"
-#include <OB_Browser.h>
+// temporary commented
+//#include <OB_Browser.h>
#include <SUIT_Session.h>
#include <SUIT_DataObjectIterator.h>
-#include <qdatetime.h>
+#include <QTime>
#include <time.h>
Constructor
*/
LightApp_OBSelector::LightApp_OBSelector( OB_Browser* ob, SUIT_SelectionMgr* mgr )
-: SUIT_Selector( mgr, ob ),
- myBrowser( ob )
+ : SUIT_Selector( mgr/* temporary commented : , ob */ )/*,*/
+ // temporary commented : myBrowser( ob )
{
- if ( myBrowser ) {
+ // temporary commented
+ /*if ( myBrowser ) {
connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
- }
+ }*/
setModified();
}
if ( !myBrowser )
return;
DataObjectList objlist;
- myBrowser->getSelected( objlist );
+ // temporary commented
+ //myBrowser->getSelected( objlist );
LightApp_OBSelector* that = (LightApp_OBSelector*)this;
- for ( DataObjectListIterator it( objlist ); it.current(); ++it )
+ QListIterator<SUIT_DataObject*> it( objlist );
+ while ( it.hasNext() )
{
- LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
+ LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.next() );
if ( obj && app->checkDataObject(obj) )
{
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
- ( obj->entry(), obj->componentDataType(), obj->name() );
+ ( obj->entry().toLatin1().constData(),
+ obj->componentDataType().toLatin1().constData(),
+ obj->name().toLatin1().constData() );
LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
#else
LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
if ( !myBrowser )
return;
- if( myEntries.count() == 0 ||
- myModifiedTime < myBrowser->getModifiedTime() )
+ if( myEntries.count() == 0
+ // temporary commented
+ /*||
+ myModifiedTime < myBrowser->getModifiedTime()*/ )
fillEntries( myEntries );
DataObjectList objList;
objList.append( myEntries[owner->entry()] );
}
- myBrowser->setSelected( objList );
+ // temporary commented
+ //myBrowser->setSelected( objList );
mySelectedList.clear();
}
mySelectedList.clear();
selectionChanged();
QTime t2 = QTime::currentTime();
- qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ) );
+ qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ).toLatin1().constData() );
}
/*!Fill entries.*/
if ( !myBrowser )
return;
- for ( SUIT_DataObjectIterator it( myBrowser->getRootObject(),
+ // temporary commented
+ /*for ( SUIT_DataObjectIterator it( myBrowser->getRootObject(),
SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it )
{
LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
if ( obj )
entires.insert( obj->entry(), obj );
- }
+ }*/
setModified();
}
#include <SUIT_Selector.h>
#include <SUIT_DataOwner.h>
+#include <QObject>
+
class OB_Browser;
class LightApp_DataObject;
\class LightApp_OBSelector
Custom selector to get/set selection from object browser
*/
-class LIGHTAPP_EXPORT LightApp_OBSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_OBSelector : public QObject, public SUIT_Selector
{
Q_OBJECT
#include <SUIT_Selector.h>
#include <SUIT_DataOwner.h>
+#include <QObject>
+
#include <OCCViewer_ViewModel.h>
class Handle_AIS_InteractiveObject;
\class LightApp_OCCSelector
Custom selector to get/set selection from OCC viewer
*/
-class LIGHTAPP_EXPORT LightApp_OCCSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_OCCSelector : public QObject, public SUIT_Selector
{
Q_OBJECT
#include <LightApp_Operation.h>
#include <LightApp_Module.h>
#include <LightApp_Application.h>
-#include <LightApp_Operation.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_Dialog.h>
#include <SUIT_Desktop.h>
-
-#include <qapplication.h>
-
+#include <SUIT_Study.h>
/*!
* \brief Constructor
if( active )
{
activateSelection();
- dlg()->setActiveWindow();
+ dlg()->activateWindow();
}
}
}
#include <SUIT_Operation.h>
class LightApp_Module;
-class LightApp_Application;
-class LightApp_Operation;
class LightApp_SelectionMgr;
class LightApp_Dialog;
class SUIT_Desktop;
#include "LightApp_Preferences.h"
-#include <QtxListResourceEdit.h>
-
-#include <qlayout.h>
-
/*!
Constructor.Initialize by resource manager and parent QWidget.
*/
{
bool res = false;
for ( PrefModuleMap::ConstIterator it = myPrefMod.begin(); it != myPrefMod.end() && !res; ++it )
- res = it.data() == mod;
+ res = it.value() == mod;
return res;
}
#define LIGHTAPP_PREFERENCES_H
#include <LightApp.h>
-
-#include <QtxDialog.h>
#include <QtxListResourceEdit.h>
-#include <qmap.h>
+#include <QMap>
class QtxResourceMgr;
#include <SUIT_MessageBox.h>
-#include <qbutton.h>
-#include <qlayout.h>
-#include <qvbox.h>
-#include <qfiledialog.h>
+#include <QAbstractButton>
+#include <QVBoxLayout>
+#include <QFileDialog>
/*!
Constructor.
*/
LightApp_PreferencesDlg::LightApp_PreferencesDlg( LightApp_Preferences* prefs, QWidget* parent )
-: QtxDialog( parent, 0, true, true, OK | Close | Apply ),
+: QtxDialog( parent, true, true, OK | Close | Apply ),
myPrefs( prefs ), mySaved ( false )
{
- setCaption( tr( "CAPTION" ) );
+ setWindowTitle( tr( "CAPTION" ) );
- QVBoxLayout* main = new QVBoxLayout( mainFrame(), 5 );
+ QVBoxLayout* main = new QVBoxLayout( mainFrame() );
+ main->setMargin( 5 );
+ main->setSpacing( 5 );
- QVBox* base = new QVBox( mainFrame() );
- main->addWidget( base );
+ QWidget* vbox = new QWidget( mainFrame() );
+ main->addWidget( vbox );
- myPrefs->reparent( base, QPoint( 0, 0 ), true );
+ QVBoxLayout *base = new QVBoxLayout( vbox );
+
+ myPrefs->setParent( vbox );
+ myPrefs->move( QPoint( 0, 0 ) );
+ myPrefs->show();
setFocusProxy( myPrefs );
+ base->addWidget( myPrefs );
+
setButtonPosition( Right, Close );
setDialogFlags( AlignOnce );
connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
- QButton* defBtn = userButton( insertButton( tr( "DEFAULT_BTN_TEXT" ) ) );
+ QAbstractButton* defBtn = userButton( insertButton( tr( "DEFAULT_BTN_TEXT" ) ) );
if ( defBtn )
connect( defBtn, SIGNAL( clicked() ), this, SLOT( onDefault() ) );
- QButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
+ QAbstractButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
if( impBtn )
connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) );
}
if ( !myPrefs )
return;
- myPrefs->reparent( 0, QPoint( 0, 0 ), false );
+ myPrefs->setParent( 0 );
+ myPrefs->move( QPoint( 0, 0 ) );
+ myPrefs->hide();
myPrefs = 0;
}
if( !mgr )
return;
- QFileDialog dlg( ".", "*", this, "" );
- dlg.setCaption( tr("IMPORT_PREFERENCES") );
- dlg.setShowHiddenFiles( true );
+ QFileDialog dlg( this, tr("IMPORT_PREFERENCES"), ".", "*" );
+ dlg.setObjectName( "" );
+ //dlg.setShowHiddenFiles( true );
dlg.exec();
- QString fname = dlg.selectedFile();
- if( fname.isEmpty() )
+
+ QStringList files = dlg.selectedFiles();
+ if ( files.isEmpty() )
return;
+ QString fname = files[0];
if( mgr->import( fname ) )
{
myPrefs->retrieve();
#include "LightApp_Application.h"
#include "LightApp_Displayer.h"
+#include "CAM_Module.h"
+
#include "SUIT_Session.h"
#include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Selector.h"
/*!
Constructor
*/
-LightApp_Selection::LightApp_Selection()
+LightApp_Selection::LightApp_Selection( const QString& client, LightApp_SelectionMgr* mgr )
: myStudy( 0 )
-{
-}
-
-/*!
- Destructor.
-*/
-LightApp_Selection::~LightApp_Selection()
-{
-}
-
-/*!
- Initialization.
-*/
-void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr)
{
myPopupClient = client;
- myStudy = 0;
if( mgr )
{
mgr->selected( sel, client );
//2) to take such owners from other popup clients that it's entry is different with every entry from current list
- QPtrList<SUIT_Selector> aSelectors;
+ QList<SUIT_Selector*> aSelectors;
mgr->selectors( aSelectors );
- for( SUIT_Selector* selector = aSelectors.first(); selector; selector = aSelectors.next() )
+ QListIterator<SUIT_Selector*> it( aSelectors );
+ while ( it.hasNext() )
{
- qDebug( selector->type() );
+ SUIT_Selector* selector = it.next();
+ qDebug( selector->type().toLatin1().constData() );
if( selector->type()!=client )
{
mgr->selected( cur_sel, selector->type() );
}
}
+/*!
+ Destructor.
+*/
+LightApp_Selection::~LightApp_Selection()
+{
+}
+
QString LightApp_Selection::referencedToEntry( const QString& entry ) const
{
return myStudy->referencedToEntry( entry );
}
/*!
- Gets QtxValue();
+ Gets QVariant();
*/
-QtxValue LightApp_Selection::param( const int ind, const QString& p ) const
+QVariant LightApp_Selection::parameter( const int ind, const QString& p ) const
{
LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy ? myStudy->application() : 0 );
if( !( ind>=0 && ind<count() ) || !app )
- return QtxValue();
+ return QVariant();
if( p=="isVisible" )
{
- QString mod_name = app->moduleTitle( param( ind, "component" ).toString() );
+ QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
// false in last parameter means that now we doesn't load module, if it isn't loaded
LightApp_Displayer local_d;
vis = local_d.IsDisplayed( myEntries[ ind ] );
}
- return QtxValue( vis, 0 );
+ return QVariant( vis );
}
else if( p=="component" )
else if( p=="isComponent" )
{
- return QtxValue( myStudy->isComponent( myEntries[ ind ] ), 0 );
+ return QVariant( myStudy->isComponent( myEntries[ ind ] ) );
}
else if( p=="isReference" )
- return QtxValue( isReference( ind ), false );
+ return QVariant( isReference( ind ) );
else if( p=="displayer" )
- return param( ind, "component" );
+ return parameter( ind, "component" );
else if( p=="canBeDisplayed" )
{
- QString mod_name = app->moduleTitle( param( ind, "component" ).toString() );
+ QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
// false in last parameter means that now we doesn't load module, if it isn't loaded
//operations under object
}
- return QtxValue();
+ return QVariant();
}
/*!
Gets global parameters. client, isActiveView, activeView etc.
*/
-QtxValue LightApp_Selection::globalParam( const QString& p ) const
+QVariant LightApp_Selection::parameter( const QString& p ) const
{
- if ( p == "client" ) return QtxValue( myPopupClient );
+ if ( p == "client" ) return QVariant( myPopupClient );
else if ( p == "activeModule" )
{
LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy->application() );
if( !mod_name.isEmpty() )
return mod_name;
else
- return QtxValue();
+ return QVariant();
}
- else if ( p == "isActiveView" ) return QtxValue( (bool)activeVW() );
- else if ( p == "activeView" ) return QtxValue( activeViewType() );
+ else if ( p == "isActiveView" ) return QVariant( (bool)activeVW() );
+ else if ( p == "activeView" ) return QVariant( activeViewType() );
#ifndef WIN32
- else return QtxPopupMgr::Selection::globalParam( p );
+ else return QtxPopupSelection::parameter( p );
#else
- else return Selection::globalParam( p );
+ else return QtxPopupSelection::parameter( p ); //Selection::parameter( p ); //?
#endif
}
It is able to return values of standard object properties
(isVisible,isComponent,canBeDisplayed,isReference, etc)
*/
-class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupMgr::Selection
+class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
{
public:
- LightApp_Selection();
+ LightApp_Selection( const QString&, LightApp_SelectionMgr* );
virtual ~LightApp_Selection();
- virtual void init( const QString&, LightApp_SelectionMgr* );
virtual void processOwner( const LightApp_DataOwner* );
virtual int count() const;
- virtual QtxValue param( const int, const QString& ) const;
- virtual QtxValue globalParam( const QString& ) const;
+ virtual QVariant parameter( const int, const QString& ) const;
+ virtual QVariant parameter( const QString& ) const;
void setModuleName( const QString );
protected:
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
+ #include <TCollection_AsciiString.hxx>
#endif
/*!
if ( !entryMap.contains( checkEntry ) ) {
if ( refEntry != entry ) {
QString component = study->componentDataType( refEntry );
- theList.Append( new SALOME_InteractiveObject( refEntry, component, ""/*refobj->Name().c_str()*/ ) );
+ theList.Append( new SALOME_InteractiveObject( refEntry.toLatin1().constData(), component.toLatin1().constData(), ""/*refobj->Name().c_str()*/ ) );
}
else if( !owner->IO().IsNull() )
theList.Append( owner->IO() );
{
SUIT_DataOwnerPtrList aList;
- MapIOOfMapOfInteger::Iterator it;
- for ( it = theMapIO.begin(); it != theMapIO.end(); ++it )
+ MapIOOfMapOfInteger::Iterator it(theMapIO);
+ for ( ; it.More(); it.Next() )
{
- if ( it.data().IsEmpty() )
- aList.append( new LightApp_DataOwner( QString(it.key()->getEntry()) ) );
+ if ( it.Value().IsEmpty() )
+ aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
else
{
int i;
- for ( i = 1; i <= it.data().Extent(); i++ )
- aList.append( new LightApp_DataSubOwner( QString(it.key()->getEntry()), it.data()( i ) ) );
+ for ( i = 1; i <= it.Value().Extent(); i++ )
+ aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
}
}
*/
void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
{
- theMap.clear();
+ theMap.Clear();
TColStd_IndexedMapOfInteger anIndexes;
const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
if ( subOwner )
{
- if ( !theMap.contains( subOwner->entry() ) )
+#ifndef WNT
+ if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) )
+#else
+ if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
+#endif
{
anIndexes.Clear();
GetIndexes( subOwner->entry(), anIndexes );
- theMap.insert( subOwner->entry(), anIndexes );
+ theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
}
}
}
#ifndef DISABLE_SALOMEOBJECT
#include <SALOME_InteractiveObject.hxx>
- #include <qmap.h>
+ #include <QMap>
+ #include <NCollection_DataMap.hxx>
class SALOME_ListIO;
class TColStd_IndexedMapOfInteger;
class TColStd_MapOfInteger;
+ class TCollection_AsciiString;
#else
-#include <qstringlist.h>
+#include <QStringList>
#endif
class LightApp_Application;
LightApp_Application* application() const;
#ifndef DISABLE_SALOMEOBJECT
- typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
- typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
+ typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
+ typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
void selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) const;
void setSelectedObjects( const SALOME_ListIO&, const bool = false );
#include "LightApp_ShowHideOp.h"
#include "LightApp_Application.h"
-#include "LightApp_DataOwner.h"
#include "LightApp_Module.h"
#include "LightApp_Study.h"
#include "LightApp_Displayer.h"
-#include "CAM_Study.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Selection.h"
if( !mod )
return;
- LightApp_Selection* sel = mod->createSelection();
+ LightApp_Selection* sel = mod->createSelection( "", mgr );
if( !sel )
return;
- sel->init( "", mgr );
if( sel->count()==0 && myActionType!=ERASE_ALL )
{
abort();
QString mod_name;
if( sel->count()>0 )
{
- QString aStr = sel->param( 0, "displayer" ).toString();
+ QString aStr = sel->parameter( 0, "displayer" ).toString();
mod_name = app->moduleTitle( aStr );
}
else if( app->activeModule() )
#include "LightApp_Operation.h"
-class LightApp_Displayer;
-
/*!
\class LightApp_ShowHideOp
Standard operation allowing to show/hide selected objects
#include "LightApp_Study.h"
#include "CAM_DataModel.h"
+#include "CAM_Module.h"
#include "LightApp_Application.h"
#include "LightApp_DataModel.h"
#include "LightApp_DataObject.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_DataObjectIterator.h"
-#include <OB_Browser.h>
-
-#include <TCollection_AsciiString.hxx>
-
-#include <OSD_Path.hxx>
-#include <OSD_File.hxx>
-#include <OSD_Directory.hxx>
-#include <OSD_Process.hxx>
-#include <OSD_Directory.hxx>
-#include <OSD_Protection.hxx>
-#include <OSD_SingleProtection.hxx>
-#include <OSD_FileIterator.hxx>
-
#include <set>
-#include <qstring.h>
+#include <QString>
/*!
Constructor.
/*!
Create document.
*/
-void LightApp_Study::createDocument()
+bool LightApp_Study::createDocument( const QString& theStr )
{
setStudyName( QString( "Study%1" ).arg( LightApp_Application::studyId() ) );
// create myRoot
setRoot( new LightApp_RootObject( this ) );
- CAM_Study::createDocument();
+ bool aRet = CAM_Study::createDocument( theStr );
emit created( this );
+
+ return aRet;
}
/*!
// update loaded data models: call open() and update() on them.
ModelList dm_s;
dataModels( dm_s );
- for ( ModelListIterator it( dm_s ); it.current(); ++it )
- openDataModel( studyName(), it.current() );
+ QListIterator<CAM_DataModel*> it( dm_s );
+ while ( it.hasNext() )
+ openDataModel( studyName(), it.next() );
// this will build a SUIT_DataObject-s tree under myRoot member field
// passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
// but tree that corresponds to not-loaded data models will be updated any way.
ModelList dm_s;
dataModels( dm_s );
- for ( ModelListIterator it( dm_s ); it.current(); ++it )
- openDataModel( studyName(), it.current() );
+ QListIterator<CAM_DataModel*> it( dm_s );
+ while ( it.hasNext() )
+ openDataModel( studyName(), it.next() );
// this will build a SUIT_DataObject-s tree under myRoot member field
// passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
ModelList list;
dataModels( list );
- LightApp_DataModel* aModel = (LightApp_DataModel*)list.first();
-
QStringList listOfFiles;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- for ( ; aModel; aModel = (LightApp_DataModel*)list.next() )
+ QListIterator<CAM_DataModel*> itList( list );
+ while ( itList.hasNext() )
{
- std::vector<std::string> anOldList = myDriver->GetListOfFiles( aModel->module()->name() );
+ LightApp_DataModel* aModel = (LightApp_DataModel*)itList.next();
+ if ( !aModel ) continue;
+
+ std::vector<std::string> anOldList = myDriver->GetListOfFiles( aModel->module()->name().toLatin1().constData() );
listOfFiles.clear();
aModel->saveAs( theFileName, this, listOfFiles );
if ( !listOfFiles.isEmpty() )
// removing previous temporary files. These files are not removed before saving
// because they may be required for it.
- std::vector<std::string> aNewList = myDriver->GetListOfFiles( aModel->module()->name() );
+ std::vector<std::string> aNewList = myDriver->GetListOfFiles( aModel->module()->name().toLatin1().constData() );
std::set<std::string> aNewNames;
std::set<std::string> toRemove;
{
ModelList list; dataModels( list );
- LightApp_DataModel* aModel = (LightApp_DataModel*)list.first();
-
myDriver->ClearDriverContents();
QStringList listOfFiles;
- for ( ; aModel; aModel = (LightApp_DataModel*)list.next() ) {
+ QListIterator<CAM_DataModel*> itList( list );
+ while ( itList.hasNext() ) {
+ LightApp_DataModel* aModel = (LightApp_DataModel*)itList.next();
+ if ( !aModel ) continue;
+
listOfFiles.clear();
aModel->save( listOfFiles );
saveModuleData(aModel->module()->name(), listOfFiles);
ModelList list; dataModels( list );
LightApp_DataModel* aModel = 0;
- for ( QPtrListIterator<CAM_DataModel> it( list ); it.current() && !isAnyChanged; ++it ){
- aModel = dynamic_cast<LightApp_DataModel*>( it.current() );
+ QListIterator<CAM_DataModel*> it( list );
+ while ( it.hasNext() && !isAnyChanged ) {
+ aModel = dynamic_cast<LightApp_DataModel*>( it.next() );
if ( aModel )
isAnyChanged = aModel->isModified();
}
for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
if ( (*it).isEmpty() )
continue;
- aListOfFiles[anIndex] = (*it).latin1();
+ aListOfFiles[anIndex] = (*it).toLatin1().constData();
anIndex++;
}
- myDriver->SetListOfFiles(theModuleName, aListOfFiles);
+ myDriver->SetListOfFiles(theModuleName.toLatin1().constData(), aListOfFiles);
}
/*!
*/
void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListOfFiles)
{
- std::vector<std::string> aListOfFiles = myDriver->GetListOfFiles(theModuleName);
+ std::vector<std::string> aListOfFiles = myDriver->GetListOfFiles(theModuleName.toLatin1().constData());
int i, aLength = aListOfFiles.size() - 1;
if (aLength < 0)
return;
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->SaveDatasInFile(theFileName.latin1(), isMultiFile);
+ bool aRes = myDriver->SaveDatasInFile(theFileName.toLatin1(), isMultiFile);
return aRes;
}
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->ReadDatasFromFile(theFileName.latin1(), isMultiFile);
+ bool aRes = myDriver->ReadDatasFromFile(theFileName.toLatin1(), isMultiFile);
return aRes;
}
#include <LightApp_Driver.h>
#include <CAM_Study.h>
-#include <CAM_DataModel.h>
-#include <SUIT_Study.h>
#include "string"
#include "vector"
+class SUIT_Study;
class SUIT_Application;
class CAM_DataModel;
LightApp_Study( SUIT_Application* );
virtual ~LightApp_Study();
- virtual void createDocument();
+ virtual bool createDocument( const QString& );
virtual bool openDocument( const QString& );
virtual bool loadDocument( const QString& );
#include <CAM_Application.h>
#include <SUIT_Operation.h>
#include <SUIT_Study.h>
-#include <qevent.h>
-#include <qwidget.h>
-#include <qptrlist.h>
-#include <qapplication.h>
+
+#include <QEvent>
+#include <QWidget>
+#include <QList>
+#include <QApplication>
/*!
* \brief Constructor
// try to find operation corresponding to the dialog
if ( aDlg != 0 && study() != 0 )
{
- QPtrListIterator<SUIT_Operation> anIter( study()->operations() );
- while( SUIT_Operation* anOp = anIter.current() )
+ QListIterator<SUIT_Operation*> anIter( study()->operations() );
+ while( anIter.hasNext() )
{
- if ( anOp->inherits( "LightApp_Operation" ) &&
+ SUIT_Operation* anOp = anIter.next();
+
+ if ( anOp &&
+ anOp->inherits( "LightApp_Operation" ) &&
((LightApp_Operation*)anOp)->dlg() == aDlg )
return ((LightApp_Operation*)anOp);
- ++anIter;
- }
+ }
}
return 0;
#define LightApp_SwitchOp_H
#include "LightApp.h"
-#include <qobject.h>
+#include <QObject>
class LightApp_Module;
class LightApp_Operation;
#include "LightApp_VTKSelector.h"
#include "LightApp_DataOwner.h"
+#include "SUIT_Desktop.h"
+
#ifndef DISABLE_VTKVIEWER
#include "SVTK_ViewModelBase.h"
#include "SVTK_ViewManager.h"
aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
}else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
Handle(SALOME_InteractiveObject) anIO =
- new SALOME_InteractiveObject(anOwner->entry().latin1(),"");
+ new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
aSelector->AddIObject(anIO);
anAppendList.Append(anIO);
}
QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
REnd = toRemove.end();
for( ; RIt!=REnd; RIt++ )
- aSelector->RemoveIObject( RIt.data() );
+ aSelector->RemoveIObject( RIt.value() );
aView->onSelectionChanged();
}
#include "LightApp.h"
#include "LightApp_DataOwner.h"
+#include <QObject>
+
class SUIT_Desktop;
#ifndef DISABLE_VTKVIEWER
- #include <vtkSmartPointer.h>
#include <TColStd_IndexedMapOfInteger.hxx>
#include "SVTK_Selection.h"
#ifndef DISABLE_SALOMEOBJECT
\class LightApp_VTKSelector
Custom selector to get/set selection from object browser
*/
-class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector
{
Q_OBJECT;
//
#include "LightApp_WidgetContainer.h"
-#include <qobjectlist.h>
-#include <qwidgetstack.h>
+#include <QList>
+#include <QStackedWidget>
/*!
Constructor.
*/
LightApp_WidgetContainer::LightApp_WidgetContainer( const int type, QWidget* parent )
-: QDockWindow( QDockWindow::InDock, parent ),
-myType( type )
+ : QDockWidget( /*QDockWindow::InDock,*/ parent ),
+ myType( type )
{
- setWidget( myStack = new QWidgetStack( this ) );
+ setObjectName(QString("WC_%1").arg(type));
+ setWidget( myStack = new QStackedWidget( this ) );
myStack->show();
}
*/
bool LightApp_WidgetContainer::isEmpty() const
{
- const QObjectList* lst = myStack->children();
- if ( !lst )
+ const QList<QObject*> lst = myStack->children();
+ if ( lst.isEmpty() )
return true;
bool res = true;
- for ( QObjectListIt it( *lst ); it.current() && res; ++it )
+ QListIterator<QObject*> it( lst );
+ while ( it.hasNext() && res )
{
- if ( it.current()->isWidgetType() && myStack->id( (QWidget*)it.current() ) != -1 )
+ QObject* anItem = it.next();
+ if ( anItem->isWidgetType() && myStack->indexOf( (QWidget*)anItem ) != -1 )
res = false;
}
return res;
if ( contains( id ) )
remove( id );
- int stackId = myStack->addWidget( wid, id );
- if ( !myStack->visibleWidget() )
- myStack->raiseWidget( wid );
+ int stackId = myStack->insertWidget( id, wid );
+ if ( !myStack->currentWidget() )
+ myStack->setCurrentWidget( wid );
- setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
+ setWindowTitle( myStack->currentWidget() ? myStack->currentWidget()->windowTitle() : QString::null );
return stackId;
}
{
remove( myStack->widget( id ) );
- setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
+ setWindowTitle( myStack->currentWidget() ? myStack->currentWidget()->windowTitle() : QString::null );
}
/*!
{
myStack->removeWidget( wid );
- setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
+ setWindowTitle( myStack->currentWidget() ? myStack->currentWidget()->windowTitle() : QString::null );
}
/*!
*/
void LightApp_WidgetContainer::activate( const int id )
{
- myStack->raiseWidget( id );
+ myStack->setCurrentIndex( id );
- setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
+ setWindowTitle( myStack->currentWidget() ? myStack->currentWidget()->windowTitle() : QString::null );
}
/*!
*/
void LightApp_WidgetContainer::activate( QWidget* wid )
{
- myStack->raiseWidget( wid );
+ myStack->setCurrentWidget( wid );
- setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
+ setWindowTitle( myStack->currentWidget() ? myStack->currentWidget()->windowTitle() : QString::null );
}
/*!
*/
QWidget* LightApp_WidgetContainer::active() const
{
- return myStack->visibleWidget();
+ return myStack->currentWidget();
}
#include "LightApp.h"
-#include <qdockwindow.h>
+#include <QDockWidget>
class QWidget;
-class QWidgetStack;
+class QStackedWidget;
/*!
Class which privade widget container.
*/
-class LIGHTAPP_EXPORT LightApp_WidgetContainer : public QDockWindow
+class LIGHTAPP_EXPORT LightApp_WidgetContainer : public QDockWidget
{
Q_OBJECT
QWidget* widget( const int ) const;
private:
- int myType;
- QWidgetStack* myStack;
+ int myType;
+ QStackedWidget* myStack;
};
#endif
libLightApp_la_CPPFLAGS=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS) \
$(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD \
-I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow \
- -I$(srcdir)/../Prs -I$(srcdir)/../Qtx
+ -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event
libLightApp_la_LDFLAGS=$(QT_MT_LIBS)
if ENABLE_VTKVIEWER
libLightApp_la_CPPFLAGS+= -DDISABLE_OCCVIEWER
endif
if ENABLE_PYCONSOLE
- libLightApp_la_CPPFLAGS+= $(PYTHON_INCLUDES) -I$(srcdir)/../PythonConsole -I$(srcdir)/../PyInterp
+ libLightApp_la_CPPFLAGS+= $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp
libLightApp_la_LDFLAGS+= $(PYTHON_LIBS)
else !ENABLE_PYCONSOLE
libLightApp_la_CPPFLAGS+= -DDISABLE_PYCONSOLE
endif
libLightApp_la_LIBADD= ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la \
- ../ObjBrowser/libObjBrowser.la ../LogWindow/libLogWindow.la $(CAS_KERNEL) \
+ ../LogWindow/libLogWindow.la $(CAS_KERNEL) \
../Prs/libSalomePrs.la $(HDF5_LIBS) $(KERNEL_LDFLAGS) -lSalomeHDFPersist
+#../ObjBrowser/libObjBrowser.la
if ENABLE_SALOMEOBJECT
libLightApp_la_LIBADD+= ../OBJECT/libSalomeObject.la
libLightApp_la_LIBADD+= ../GLViewer/libGLViewer.la
endif
if ENABLE_PLOT2DVIEWER
- libLightApp_la_LIBADD+= ../Plot2d/libPlot2d.la
+# libLightApp_la_LIBADD+= ../Plot2d/libPlot2d.la
if ENABLE_SALOMEOBJECT
- libLightApp_la_LIBADD+= ../SPlot2d/libSPlot2d.la
+# libLightApp_la_LIBADD+= ../SPlot2d/libSPlot2d.la
endif
endif
if ENABLE_PYCONSOLE
- libLightApp_la_LIBADD+= ../PyInterp/libPyInterp.la ../PythonConsole/libPythonConsole.la
+ libLightApp_la_LIBADD+= ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
endif
if ENABLE_SUPERVGRAPHVIEWER
- libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
+# libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
endif
</section>
<section name="desktop" >
<!-- Default GUI desktop state, position, size -->
+ <parameter name="geometry" value="(800%)x(800%) (+400%) (+400%) :(full)"/>
<parameter name="state" value="normal"/>
<parameter name="pos_x" value="center"/>
<parameter name="pos_y" value="center"/>
# VSR: this is the original packages list
#SUBDIRS += Event LightApp ResExporter
# VSR: already migrated to Qt4 packages
-SUBDIRS += Event ResExporter
+SUBDIRS += Event LightApp ResExporter
if GUI_ENABLE_CORBA
# VSR: this is the original packages list