#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "controlpanel.h"
#include "scenepanel.h"
class QMdiSubWindow;
class QMdiArea;
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
signals:
public slots:
private:
void createActions();
void createMenus();
void createToolbars();
QMdiArea *mdiArea;
ScenePanel *scenePanel;
ControlPanel *controlPanel;
QMdiSubWindow * sceneWindow;
QMdiSubWindow * controlWindow;
private slots:
void showScenePanel();
void showControlPanel();
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "controlpanel.h"
#include "scenepanel.h"
class QAction;
class QMdiSubWindow;
class QMdiArea;
class QMenu;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
signals:
public slots:
private:
void createActions();
void createMenus();
void createToolbars();
QMdiArea *mdiArea;
QAction *sceneAction;
QAction *controlAction;
ScenePanel *scenePanel;
ControlPanel *controlPanel;
QMdiSubWindow * sceneWindow;
QMdiSubWindow * controlWindow;
private slots:
void showScenePanel();
void showControlPanel();
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
#include "mainwindow.h"
#include <QtGui>
MainWindow
::MainWindow(QWidget *parent
) :{
this->setWindowTitle(tr("mdiLine"));
mdiArea = new QMdiArea;
setCentralWidget( mdiArea );
createActions();
createMenus();
createToolbars();
scenePanel = new ScenePanel;
scenePanel
->setWindowIcon
(QIcon(":/Icons/Scene.png"));
sceneWindow = mdiArea->addSubWindow(scenePanel);
sceneWindow->resize(500, 500);
controlPanel = new ControlPanel;
controlPanel
->setWindowIcon
(QIcon(":/Icons/Control.png"));
controlWindow = mdiArea->addSubWindow(controlPanel);
connect(controlPanel, SIGNAL(drawLine(QVector3D,QVector3D)), scenePanel, SLOT(drawLine(QVector3D,QVector3D)));
showScenePanel();
showControlPanel();
}
void MainWindow::createActions() {
sceneAction
= new QAction( QIcon(":/Icons/Scene.png"), tr
("&Scene"),
this );
sceneAction->setStatusTip( tr("Scene Panel") );
connect( sceneAction, SIGNAL(triggered()), this, SLOT(showScenePanel()) );
controlAction
= new QAction( QIcon(":/Icons/Control.png"), tr
("&Control"),
this );
controlAction->setStatusTip( tr("Control Panel") );
connect( controlAction, SIGNAL(triggered()), this, SLOT(showControlPanel()) );
}
void MainWindow::createMenus() {
menu = menuBar()->addMenu( tr("&Panels") );
menu->addAction( sceneAction );
menu->addAction( controlAction );
}
void MainWindow::createToolbars() {
toolbar = addToolBar( tr("Panels") );
toolbar->addAction( sceneAction );
toolbar->addAction( controlAction );
}
void MainWindow::showScenePanel()
{
sceneWindow->show();
}
void MainWindow::showControlPanel()
{
controlWindow->show();
}
#include "mainwindow.h"
#include <QtGui>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
this->setWindowTitle(tr("mdiLine"));
mdiArea = new QMdiArea;
setCentralWidget( mdiArea );
createActions();
createMenus();
createToolbars();
scenePanel = new ScenePanel;
scenePanel->setWindowIcon(QIcon(":/Icons/Scene.png"));
sceneWindow = mdiArea->addSubWindow(scenePanel);
sceneWindow->resize(500, 500);
controlPanel = new ControlPanel;
controlPanel->setWindowIcon(QIcon(":/Icons/Control.png"));
controlWindow = mdiArea->addSubWindow(controlPanel);
connect(controlPanel, SIGNAL(drawLine(QVector3D,QVector3D)), scenePanel, SLOT(drawLine(QVector3D,QVector3D)));
showScenePanel();
showControlPanel();
}
void MainWindow::createActions() {
sceneAction = new QAction( QIcon(":/Icons/Scene.png"), tr("&Scene"), this );
sceneAction->setStatusTip( tr("Scene Panel") );
connect( sceneAction, SIGNAL(triggered()), this, SLOT(showScenePanel()) );
controlAction = new QAction( QIcon(":/Icons/Control.png"), tr("&Control"), this );
controlAction->setStatusTip( tr("Control Panel") );
connect( controlAction, SIGNAL(triggered()), this, SLOT(showControlPanel()) );
}
void MainWindow::createMenus() {
QMenu *menu;
menu = menuBar()->addMenu( tr("&Panels") );
menu->addAction( sceneAction );
menu->addAction( controlAction );
}
void MainWindow::createToolbars() {
QToolBar *toolbar;
toolbar = addToolBar( tr("Panels") );
toolbar->addAction( sceneAction );
toolbar->addAction( controlAction );
}
void MainWindow::showScenePanel()
{
sceneWindow->show();
}
void MainWindow::showControlPanel()
{
controlWindow->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks