コード例 #1
0
ファイル: mpmainwindow.cpp プロジェクト: mareuter/PVMockupGui
mpMainWindow::mpMainWindow(QWidget *parent) : QMainWindow(parent)
{
  this->setupUi(this);

  // Unset the connections since the views aren't up yet.
  this->removeProxyTabWidgetConnections();

  new pqParaViewBehaviors(this, this);

  // We want the actionLoad to result in the showing up the ParaView's OpenData
  // dialog letting the user pick from one of the supported file formats.
  pqLoadDataReaction* dataLoader = new pqLoadDataReaction(this->action_Open);
  QObject::connect(dataLoader, SIGNAL(loadedData(pqPipelineSource*)),
    this, SLOT(onDataLoaded(pqPipelineSource*)));

  QObject::connect(this->modeControlWidget,
		  SIGNAL(executeSwitchViews(ModeControlWidget::Views)),
		  this, SLOT(switchViews(ModeControlWidget::Views)));

  //pqUndoReaction
  //QObject::connect()

  // Commented this out to only use Mantid supplied readers
  // Initialize all readers available to ParaView. Now our application can load
  // all types of datasets supported by ParaView.
  vtkSMProxyManager::GetProxyManager()->GetReaderFactory()->RegisterPrototypes("sources");

  // Set the standard view as the default
  this->currentView = this->setMainViewWidget(this->viewWidget,
		  ModeControlWidget::STANDARD);
  this->setMainWindowComponentsForView();
}
コード例 #2
0
ファイル: mainwindow.cpp プロジェクト: andyleadbetter/qtknots
void MainWindow::launch()
{
#if defined( Q_WS_MAEMO_5 )
    _navigator = new QmlApplicationViewer( this );
    QGLFormat format = QGLFormat::defaultFormat();
    format.setSampleBuffers(false);

    setAttribute(Qt::WA_Maemo5NonComposited, true);
    setAttribute(Qt::WA_Maemo5AutoOrientation, true);

    _glWidget = new QGLWidget(format);

    //### potentially faster, but causes junk to appear if top-level is Item, not Rectangle
    _glWidget->setAutoFillBackground(false);
    _glWidget->setAttribute(Qt::WA_Maemo5NonComposited, true);
    _navigator->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    _navigator->setAttribute(Qt::WA_Maemo5NonComposited, true);
    _navigator->setViewport(_glWidget);





#else
    _navigator = new QmlApplicationViewer( this );
#endif

    _navigator->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    _navigator->setSource(QUrl("qrc:///qml/QKnots.qml"));
    _navigator->setResizeMode(QDeclarativeView::SizeRootObjectToView);
#if USE_DISK_CACHE
    _navigator->engine()->setNetworkAccessManagerFactory(new MyQmlNetworkCache );
#endif

    _videoPlayer = new QmlApplicationViewer( this );
    _videoPlayer->setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    _videoPlayer->setSource(QUrl("qrc:///qml/common/PlayingView.qml"));
    _videoPlayer->setResizeMode(QDeclarativeView::SizeRootObjectToView);
    _videoPlayer->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
#if USE_DISK_CACHE
    _videoPlayer->engine()->setNetworkAccessManagerFactory(new MyQmlNetworkCache);
#endif

#if defined( Q_WS_MAEMO_5 )
    _videoPlayer->setAttribute(Qt::WA_Maemo5NonComposited, true);
#endif

    QObject::connect(_navigator->engine(), SIGNAL(quit()), QCoreApplication::instance(),SLOT(quit()));
    connect( QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(onQmlFinished()));

    switchViews(false);
    showExpanded();
}
コード例 #3
0
void KdeObservatory::moveViewLeft()
{
    switchViews(-1);
}
コード例 #4
0
ファイル: mainwindow.cpp プロジェクト: andyleadbetter/qtknots
void MainWindow::onPlayerStateChange( KnotsPlayer::PlayingState newState )
{
    switchViews(KnotsPlayer::Stopped != newState );
}
コード例 #5
0
void KdeObservatory::moveViewRight()
{
    switchViews(1);
}