Ejemplo n.º 1
0
MainWindow::MainWindow()
{
    createMenus();
    createToolBars();
    createDockWidgets();
    //setMenuWidget(new QPushButton("Hello"));
}
Ejemplo n.º 2
0
MainWindow2::MainWindow2( QWidget *parent ) : QMainWindow( parent )
{
    ui = new Ui::MainWindow2;
    ui->setupUi( this );

    mBackground = new BackgroundWidget( this );

    mScribbleArea = new ScribbleArea( mBackground );
    mScribbleArea->setFocusPolicy( Qt::StrongFocus );

    // Show the UI over the background
    //
    QVBoxLayout* layout = new QVBoxLayout();
    layout->setSpacing(0);
    layout->setMargin(0);
    layout->setContentsMargins(0,0,0,0);
    layout->addWidget(mScribbleArea);

    mBackground->setLayout(layout);

    // Central widget
    setCentralWidget(mBackground);


    Object* object = new Object();
    object->init();

    mEditor = new Editor( this );
    mEditor->setScribbleArea(mScribbleArea);
    mEditor->init();
    mEditor->setObject( object );

    mScribbleArea->setCore( mEditor );
    mScribbleArea->init();

    mEditor->setScribbleArea( mScribbleArea );
    makeConnections( mEditor, mScribbleArea );

    mCommands = new CommandCenter( this );
    mCommands->setCore( mEditor );

    createDockWidgets();
    createMenus();
    setupKeyboardShortcuts();

    readSettings();

    connect( mEditor, &Editor::needSave, this, &MainWindow2::saveDocument );
    connect( mToolBox, &ToolBoxWidget::clearButtonClicked, mEditor, &Editor::clearCurrentFrame );

    //connect( mScribbleArea, &ScribbleArea::refreshPreview, mPreview, &PreviewWidget::updateImage );

    mEditor->setCurrentLayer( mEditor->object()->getLayerCount() - 1 );
    mEditor->tools()->setDefaultTool();

    mBackground->init(mEditor->preference());

    mEditor->updateObject();
    mEditor->color()->setColorNumber(0);
}
Ejemplo n.º 3
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    textEdit = new QTextEdit;
    setCentralWidget(textEdit);

    createAction();
    createMenu();
    createToolBar();
    createStatuBar();
    createDockWidgets();
}
Ejemplo n.º 4
0
PlaYUVerApp::PlaYUVerApp() :
        m_pcCurrentSubWindow( NULL ),
        m_pcCurrentVideoSubWindow( NULL ),
        m_pcAboutDialog( NULL )
{

  setWindowModality( Qt::ApplicationModal );
  setWindowModality( Qt::NonModal );

  // DBus
#ifdef USE_QTDBUS
  m_pDBusAdaptor = new PlaYUVerAppAdaptor( this );
#endif

  m_pcWindowHandle = new PlaYUVerSubWindowHandle( this );

  m_appModuleVideo = new VideoHandle( this, m_pcWindowHandle );
  m_appModuleQuality = new QualityHandle( this, m_pcWindowHandle );
  m_appModuleExtensions = new ModulesHandle( this, m_pcWindowHandle, m_appModuleVideo );

  createActions();
  createToolBars();
  createDockWidgets();
  createMenus();
  createStatusBar();
  updateMenus();

  readSettings();

  setWindowTitle( QApplication::applicationName() );
  setWindowIcon( QIcon( ":/images/playuver.png" ) );
  setUnifiedTitleAndToolBarOnMac( true );
  setCentralWidget( m_pcWindowHandle );
  setAcceptDrops( true );
  setBackgroundRole( QPalette::Background );

  connect( m_pcWindowHandle, SIGNAL( windowActivated() ), this, SLOT( update() ) );
  connect( m_pcWindowHandle, SIGNAL( changed() ), this, SLOT( update() ) );
  connect( m_appModuleVideo, SIGNAL( changed() ), this, SLOT( update() ) );
  connect( m_appModuleQuality, SIGNAL( changed() ), this, SLOT( update() ) );
  connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) );

}
Ejemplo n.º 5
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), gridGroup(0), addOffset(OffsetIncrement),
      pasteOffset(OffsetIncrement)
{
    printer = new QPrinter(QPrinter::HighResolution);

    createSceneAndView();
    createActions();
    createMenusAndToolBars();
    createDockWidgets();
    createConnections();

    QSettings settings;
    viewShowGridAction->setChecked(
        settings.value(ShowGrid, true).toBool());
    QString filename = settings.value(MostRecentFile).toString();
    if (filename.isEmpty() || filename == tr("Unnamed"))
        QTimer::singleShot(0, this, SLOT(fileNew()));
    else {
        setWindowFilePath(filename);
        QTimer::singleShot(0, this, SLOT(loadFile()));
    }
}
Ejemplo n.º 6
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
                                        , timer_(new QTimer(this))
{
    setDockNestingEnabled( true );
    setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
    setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );

    statusBar()->setProperty( "p_styled", true );
    statusBar()->addWidget( new QLabel );
    
    if ( auto p = statusBar()->findChild<QLabel *>() ) {
        p->setText( "STATUS:" );
    }

    setupFileActions();
    setupEditActions();
    {
        QMenu *helpMenu = new QMenu(tr("Help"), this);
        menuBar()->addMenu(helpMenu);
        helpMenu->addAction(tr("About"), this, SLOT(about()));
        helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
    }
#if defined USING_CHARTS
    auto widget = new ChartView( this );
#else
    auto widget = new WaveformView( this );
#endif
    setCentralWidget( widget );    

    grabGesture( Qt::PanGesture );
    grabGesture( Qt::PinchGesture );

    connect( document::instance(), &document::updateData, this, &MainWindow::handleUpdateData );

    createDockWidgets();
}
Ejemplo n.º 7
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    MainWindow::mw = this;

    //resize(800, 600);
    cartesianWidget = new Cartesian2DWidget;
    cartesianWidget->resize(800, 600);
    cartesianWidget->setMinimumSize(800, 600);
    setCentralWidget(cartesianWidget);
    setWindowState(Qt::WindowMaximized);

    createMenus();
    createToolBars();
    createDockWidgets();
    createStatusBar();

    connect(cartesianWidget, SIGNAL(centerChanged(double,double)), this, SLOT(cwCenterChanged(double,double)));
    connect(cartesianWidget, SIGNAL(offsetChanged(int,int)), this, SLOT(cwOffsetChanged(int,int)));
    connect(cartesianWidget, SIGNAL(scaleChanged(int,int)), this, SLOT(cwScaleChanged(int,int)));
    connect(cartesianWidget, SIGNAL(zoomChanged(double)), this, SLOT(cwZoomChanged(double)));
    connect(cartesianWidget, SIGNAL(boundsChanged(double,double,double,double)), this, SLOT(cwBoundsChanged(double,double,double,double)));
    cartesianWidget->reset();
}