コード例 #1
0
ファイル: mainwindow.cpp プロジェクト: andysim/chemvp
MainWindow::MainWindow(FileParser *parser_in):
		parser(parser_in)
{
	undoStack = new QUndoStack();
	drawingInfo = new DrawingInfo();
	canvas = new DrawingCanvas(drawingInfo, parser);

	createActions();
	createToolBox();
	createMenus();
	createToolbars();

	Atom::fillLabelToVdwRadiusMap();
	Atom::fillLabelToMassMap();

	QSettings settings;
	QMap<QString, QVariant> colorMap = settings.value("Default Atom Colors", QVariant(QMap<QString, QVariant>())).toMap();
	if(colorMap.isEmpty())
		Atom::fillLabelToColorMap();
	else
		Atom::labelToColor = colorMap;

	QHBoxLayout* layout = new QHBoxLayout;
	view = new DrawingDisplay(canvas, drawingInfo);
	view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	view->setGeometry(0, 0, static_cast<int>(DEFAULT_SCENE_SIZE_X), static_cast<int>(DEFAULT_SCENE_SIZE_Y));
	view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);

	drawingInfo->setHeight(view->sceneRect().height());
	drawingInfo->setWidth(view->sceneRect().width());
	drawingInfo->determineScaleFactor();
	canvas->setSceneRect(view->sceneRect());
	canvas->refresh();

	QDesktopWidget qdw;
	int screenCenterX = qdw.width() / 2;
	int screenCenterY = qdw.height() / 2;
	this->setGeometry(screenCenterX - 600, screenCenterY - 350, 1200, 700);

	splitter = new QSplitter(Qt::Horizontal);
	splitter->addWidget(view);
	splitter->addWidget(toolBox);
	layout->addWidget(splitter);

	QWidget *widget = new QWidget;
	widget->setLayout(layout);
	setCentralWidget(widget);
	loadFile();

	// The undo/redo framework needs to update the buttons appropriately
	connect(undoStack, SIGNAL(canRedoChanged(bool)), redoAction, SLOT(setEnabled(bool)));
	connect(undoStack, SIGNAL(canUndoChanged(bool)), undoAction, SLOT(setEnabled(bool)));

	resetSignalsOnFileLoad();

	this->setWindowIconText("cheMVP");
	this->setWindowTitle("cheMVP");
}
コード例 #2
0
void DesktopMainWindow::initUi()
{
	setWindowTitle(tr("Godzi[*] - Pelican Mapping"));
	setWindowIcon(QIcon(":/resources/images/pmicon32.png"));
    
	_osgViewer = new Godzi::UI::ViewerWidget( this, 0, 0, true );
    _app->setView( _osgViewer );
	setCentralWidget(_osgViewer);

	createActions();
	createMenus();
	createToolbars();
	createDockWindows();

  QSettings settings(ORG_NAME, APP_NAME);

  //Set default state/geometry if unset
  //if (!settings.value("default_state").isValid())
    settings.setValue("default_state", saveState());

  //Restore window state
  restoreGeometry(settings.value("geometry").toByteArray());
  restoreState(settings.value("windowstate").toByteArray());
  
  updateStatusBar(tr("Ready"));
}
コード例 #3
0
//! [0]
MainWindow::MainWindow()
{
    createActions();
    createToolBox();
    createMenus();

    scene = new DiagramScene(itemMenu, this);
    scene->setSceneRect(QRectF(0, 0, 5000, 5000));
    connect(scene, SIGNAL(itemInserted(DiagramItem*)),
            this, SLOT(itemInserted(DiagramItem*)));
    connect(scene, SIGNAL(textInserted(QGraphicsTextItem*)),
        this, SLOT(textInserted(QGraphicsTextItem*)));
    connect(scene, SIGNAL(itemSelected(QGraphicsItem*)),
        this, SLOT(itemSelected(QGraphicsItem*)));
    createToolbars();

    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(toolBox);
    view = new QGraphicsView(scene);
    layout->addWidget(view);

    QWidget *widget = new QWidget;
    widget->setLayout(layout);

    setCentralWidget(widget);
    setWindowTitle(tr("Diagramscene"));
    setUnifiedTitleAndToolBarOnMac(true);
}
コード例 #4
0
DiagramWindow::DiagramWindow(QDomDocument* proj,Ide* parent):parent(parent)
{

    createActions();
    createMenus();

    currentTask = -1;
    currentData = -1;

    scene = new DiagramScene(itemMenu,proj, this);
    scene->setSceneRect(QRectF(0, 0, 5000, 5000));
    connect(scene, SIGNAL(itemInserted(DiagramItem*)),
            this, SLOT(itemInserted(DiagramItem*)));

    layout = new QVBoxLayout;
    createToolbars();
    loadData(proj);

    layout->addWidget(editToolBar);

    view = new QGraphicsView(scene);
    layout->addWidget(view);

    this->setLayout(layout);

    setWindowTitle(tr("Workflow Diagram"));

    scene->loadDiagram();
}
コード例 #5
0
ファイル: mainwindow.cpp プロジェクト: hkutangyu/QTDemo
MainWindow::MainWindow()
{
    createActions();
    createMenus();    
    createToolbars();
    statusBar()->showMessage(tr("Ready"));

    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

    scene = new QGraphicsScene;
    scene->setSceneRect(-400, -300, 800, 600);
    scene->setItemIndexMethod(QGraphicsScene::NoIndex);

    for (int i = 0; i < TargetCount; ++i) {
        Target *target = new Target;
        target->setPos(qrand() % 800 - 400,
                       qrand() % 600 - 300);
		target->setVisible(true);
        scene->addItem(target);
    }

    view = new RadarView(scene, this);
    view->setRenderHint(QPainter::Antialiasing);
    view->setBackgroundBrush(Qt::black);
    view->setCacheMode(QGraphicsView::CacheBackground);
    view->setDragMode(QGraphicsView::ScrollHandDrag);

    setCentralWidget(view);
   	setWindowTitle(tr("º£Õ½Ä£Äâ"));
}
コード例 #6
0
LuaDebuggerInterface::LuaDebuggerInterface() :
    _BaseIconDir("./Data/Icons"),
    _ToolButtonSize(40.0f,40.0f)
{
    createUtilTabs();
    createToolbars();
    createCodeEditor();
}
コード例 #7
0
SchematicViewer::SchematicViewer(QWidget *parent)
	: QWidget(parent), m_fullSchematic(true), m_maximizedNode(false), m_sceneHandle(0)
{
	m_viewer = new SchematicSceneViewer(this);
	m_stageScene = new StageSchematicScene(this);
	m_fxScene = new FxSchematicScene(this);

	m_commonToolbar = new QToolBar(m_viewer);
	m_stageToolbar = new QToolBar(m_viewer);
	m_fxToolbar = new QToolBar(m_viewer);
	m_swapToolbar = new QToolBar(m_viewer);

	m_commonToolbar->setObjectName("ToolBarWithoutBorder");
	m_stageToolbar->setObjectName("ToolBarWithoutBorder");
	m_fxToolbar->setObjectName("ToolBarWithoutBorder");
	m_swapToolbar->setObjectName("ToolBarWithoutBorder");

	createToolbars();
	createActions();

	// layout
	QVBoxLayout *mainLayout = new QVBoxLayout();
	mainLayout->setMargin(1);
	mainLayout->setSpacing(0);
	{
		mainLayout->addWidget(m_viewer, 1);

		QFrame *bottomFrame = new QFrame(this);
		bottomFrame->setObjectName("SchematicBottomFrame");
		QHBoxLayout *horizontalLayout = new QHBoxLayout();
		horizontalLayout->setMargin(0);
		horizontalLayout->setSpacing(0);
		{
			horizontalLayout->addWidget(m_commonToolbar);
			horizontalLayout->addStretch();
			horizontalLayout->addWidget(m_fxToolbar);
			horizontalLayout->addWidget(m_stageToolbar);
			horizontalLayout->addWidget(m_swapToolbar);
		}
		bottomFrame->setLayout(horizontalLayout);

		mainLayout->addWidget(bottomFrame, 0);
	}
	setLayout(mainLayout);

	connect(m_fxScene, SIGNAL(showPreview(TFxP)), this, SIGNAL(showPreview(TFxP)));
	connect(m_fxScene, SIGNAL(doCollapse(const QList<TFxP> &)), this, SIGNAL(doCollapse(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doCollapse(QList<TStageObjectId>)), this, SIGNAL(doCollapse(QList<TStageObjectId>)));
	connect(m_fxScene, SIGNAL(doExplodeChild(const QList<TFxP> &)), this, SIGNAL(doExplodeChild(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doExplodeChild(QList<TStageObjectId>)), this, SIGNAL(doExplodeChild(QList<TStageObjectId>)));
	connect(m_stageScene, SIGNAL(editObject()), this, SIGNAL(editObject()));
	connect(m_fxScene, SIGNAL(editObject()), this, SIGNAL(editObject()));

	m_viewer->setScene(m_stageScene);
	m_fxToolbar->hide();

	setFocusProxy(m_viewer);
}
コード例 #8
0
ファイル: MainWindow.old.cpp プロジェクト: Sangil-Lee/RefCode
void
MainWindow::init()
{
	makeUI();
	createActions();
	createConnects();
	createToolbars();

//	attachAllWidget();

}
コード例 #9
0
MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent)   
{  
  videoFilePath = "";
  
  checkAndGenerateNecessaryFile();
  createActions();
  createMenus();
  createToolbars();
  createSubViewsAndLayoutAndConnection();    
}
コード例 #10
0
ファイル: MainWindow.cpp プロジェクト: areyeslo/marsyas
MainWindow::MainWindow(Grid* grid_) {
    _library = MusicCollection::getInstance();
    _dataGrid = grid_;

    createWindow();
    createActions();
    createMenus();
    createToolbars();

    // _midi = new MidiListener();
    openDefaultiTunes();
    isFullScreenMouse = false;

}
コード例 #11
0
ファイル: MainWindow.cpp プロジェクト: ZeroGroup/project-hpc
MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags)
{
    _sdata = NULL;

    setCentralWidget(_mdiArea = new QMdiArea());

    createActions();
    createMenus();
    createStatusBar();
    createToolbars();

    setMinimumSize(1280, 720);
    resize(1366, 768);
}
コード例 #12
0
ファイル: MainWindow.cpp プロジェクト: Sangil-Lee/RefCode
void
MainWindow::init()
{
	makeUI();
	createActions();
	createConnects();
	createToolbars();
	//setStatusBar(statusBar());
	#if 0
	QMainWindow *qm = new QMainWindow();
	qm = (QMainWindow *) stackedWidget->currentWidget();
	setStatusBar(qm->statusBar());
	#endif
	setStatusBar(((QMainWindow *) stackedWidget->currentWidget())->statusBar());
}
コード例 #13
0
SdiWindow::SdiWindow(QWidget *parent)    
    : QMainWindow(parent)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowTitle(QString(tr("%1[*] - %2")).arg(tr("unnamed")).arg(tr("SDI")));
    docWidget = new QTextEdit(this);
    setCentralWidget(docWidget);

    connect(docWidget->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool)));

    createActions();
    createDocks();
    createMenus();
    createToolbars();
    statusBar()->showMessage(tr("Done"));
}
コード例 #14
0
ファイル: mainwindow.cpp プロジェクト: RayRiver/QBTEditor
MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent)
{
	createActions();
	createToolBox();
	createMenus();
	createToolbars();

	m_scene = new BTEditorScene(this);
	m_scene->setSceneRect(QRectF(0, 0, 5000, 5000));
	connect(m_scene, SIGNAL(itemInserted(BTEditorItem *)), this, SLOT(onItemInserted(BTEditorItem *)));
	connect(m_scene, SIGNAL(itemSelected(QGraphicsItem *)), this, SLOT(onItemInserted(QGraphicsItem *)));
	connect(m_scene, SIGNAL(viewDragged(const QPointF &, const QPointF &)), this, SLOT(onViewDragged(const QPointF &, const QPointF &)));
	connect(m_scene, SIGNAL(updatePropertyView(BTEditorItem *)), this, SLOT(onUpdatePropertyView(BTEditorItem *)));

	m_propertyView = createPropertyView();
	m_preconditionView = new QTreeView;

	QHBoxLayout *layout = new QHBoxLayout;
	layout->addWidget(m_toolBox);
	m_view = new QGraphicsView(m_scene);
	layout->addWidget(m_view);

	QVBoxLayout *sublayout = new QVBoxLayout;
	sublayout->addWidget(m_propertyView);
	sublayout->addWidget(m_preconditionView);
	QWidget *subwidget = new QWidget;
	subwidget->setLayout(sublayout);

	layout->addWidget(subwidget);

	QWidget *widget = new QWidget;
	widget->setLayout(layout);

	setCentralWidget(widget);
	setWindowTitle(tr("Behavior Tree Editor"));
	setUnifiedTitleAndToolBarOnMac(true);
}
コード例 #15
0
ファイル: mainwindow.cpp プロジェクト: haojunliu/OpenFPGA
MainWindow::MainWindow()
{
    createActions();
    createToolBox();
    createMenus();

    scene = new ExplorerScene(itemMenu, this);

    //set the dimensions of the whole scene.
    //will be changed as soon as a file is opened.
    //The container adjusts the dimensions according to circuit size
    scene->setSceneRect(QRectF(0, 0, 50000, 50000));
    connect(scene, SIGNAL(itemInserted(LogicUnit*)),
            this, SLOT(itemInserted(LogicUnit*)));
    connect(scene, SIGNAL(textInserted(QGraphicsTextItem*)),
        this, SLOT(textInserted(QGraphicsTextItem*)));
    connect(scene, SIGNAL(itemSelected(QGraphicsItem*)),
        this, SLOT(itemSelected(QGraphicsItem*)));
    createToolbars();

    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(toolBox);
    view = new QGraphicsView(scene);
    //Refresh mode. Can be changed if refresh errors occur
    view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    layout->addWidget(view);

    QWidget *widget = new QWidget;
    widget->setLayout(layout);

    setCentralWidget(widget);
    setWindowTitle(tr("Circuit Explorer"));
    setWindowIcon(QIcon(":/images/icon.png"));
    setUnifiedTitleAndToolBarOnMac(true);

    myContainer = new Container(scene);
    actSimStep = 0;
}
コード例 #16
0
//! [0]
SimuladorWidget::SimuladorWidget(QWidget *parent):QWidget(parent)
{
    createActions();
    createToolBox();
    createMenus();

    scene = new DiagramScene(menu_Items, this);
    scene->setSceneRect(QRectF(0, 0, 5000, 5000));
    connect(scene, SIGNAL(itemInserted(DiagramItem*)),
            this, SLOT(itemInserted(DiagramItem*)));
    connect(scene, SIGNAL(textInserted(QGraphicsTextItem*)),
        this, SLOT(textInserted(QGraphicsTextItem*)));
    connect(scene, SIGNAL(itemSelected(QGraphicsItem*)),
        this, SLOT(itemSelected(QGraphicsItem*)));

    createToolbars();

    QVBoxLayout *layout = new QVBoxLayout;
    view = new QGraphicsView(scene);
    layout->addWidget(view);
    setLayout(layout);

}
コード例 #17
0
SimpleQt::SimpleQt(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags),
    m_dockInfo(NULL),
    m_dlgInfo(NULL),
    m_viewPixmap(NULL),
    m_viewScene(NULL),
    m_viewWidget(NULL),
    m_hApBase(NULL),
    m_CameraThread(NULL),
    m_DisplayThread(NULL),
    m_bPlaying(false),
    m_nWidth(0),
    m_nHeight(0)
{
    ui.setupUi(this);
    createActions();
    createMenus();
    createToolbars();

    m_viewScene = new QGraphicsScene;
    m_viewWidget = new QGraphicsView(m_viewScene, this);
    //m_viewWidget->setViewport(new QGLWidget);
    setCentralWidget(m_viewWidget);
}
コード例 #18
0
ファイル: mainwindow.cpp プロジェクト: dreamspy/PinConnect
MainWindow::MainWindow()
{
    createActions();
    createMenus();

    scene = new GraphicsScene(itemMenu);
    scene->setSceneRect(QRectF(0, 0, 5000, 5000));
    connect(scene, SIGNAL(itemInserted(Component *)),
            this, SLOT(itemInserted(Component *)));
    connect(scene, SIGNAL(itemSelected(QGraphicsItem *)),
        this, SLOT(itemSelected(QGraphicsItem *)));
    createToolbars();

    QHBoxLayout *layout = new QHBoxLayout;
    view = new QGraphicsView(scene);
    view->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
    layout->addWidget(view);

    QWidget *widget = new QWidget;
    widget->setLayout(layout);

    setCentralWidget(widget);
    setWindowTitle(tr("PinConnect"));
}
コード例 #19
0
ファイル: mainwindow.cpp プロジェクト: Nobu19800/RMC
MainWindow::MainWindow()
{
        tc = QTextCodec::codecForLocale();

	createParamWidget();
	
	
	QTextCodec* tc = QTextCodec::codecForLocale();
	CHECK = false;

	createToolBox();
	
	createActions();
	createMenus();





	QFrame* f = new QFrame;
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

	QFrame* f2 = new QFrame;
    f2->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f2->setLineWidth( 2 );

    c = new GLBox( f, "glbox");

	QHBoxLayout* flayout = new QHBoxLayout(f);
    flayout->setMargin(0);
    flayout->addWidget( c, 0 );

	createSliderWidget();
	createSliderArrowWidget();



	f->resize(1000, 1000);

	f->setMinimumSize(QSize(400, 100));


    scene = new DiagramScene(itemMenu);
	scene->setSceneRect(QRectF(0, 0, 2000, 2000));

    connect(scene, SIGNAL(textInserted(BodyItem *)),
        this, SLOT(textInserted(BodyItem *)));
	
	connect(scene, SIGNAL(actInserted(JointItem *)),
        this, SLOT(actInserted(JointItem *)));

	connect(scene, SIGNAL(senInserted(SensorItem *)),
        this, SLOT(senInserted(SensorItem *)));

	connect(scene, SIGNAL(camInserted(CameraItem *)),
        this, SLOT(camInserted(CameraItem *)));

	connect(scene, SIGNAL(renew()),
        this, SLOT(renew()));
	
	connect(scene, SIGNAL(setRotNum()),
        this, SLOT(setRotNum()));

	connect(scene, SIGNAL(setGeoNum()),
        this, SLOT(setGeoNum()));

	connect(scene, SIGNAL(setSSNum()),
        this, SLOT(setSSNum()));




	createToolbars();

	QHBoxLayout *hlayout = new QHBoxLayout(f2);

    QHBoxLayout *layout = new QHBoxLayout;

	tabWidget = new QTabWidget;
	
	tabWidget->addTab(SliderWidget, tc->toUnicode("パーツ選択ボタン"));
	tabWidget->addTab(SliderArrowWidget, tc->toUnicode("スケール調整(センサ・ジョイントのサイズ)"));
	//QHBoxLayout *layout = new QHBoxLayout;
	//ParamWidget = new QWidget;
	
	//tabWidget->addTab(ParamWidget, tc->toUnicode("パラメータ"));


	layout->addWidget(tabWidget);

    view = new QGraphicsView(scene);
    hlayout->addWidget(view);
	view->setMinimumSize(400, 100);

	layout->addWidget( f2 );

	layout->addWidget( f);
	
	QFrame* f3 = new QFrame;
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

	QHBoxLayout *WLayout = new QHBoxLayout(f3);


	RotSlider = new QSlider(Qt::Vertical, this);
    RotSlider->setMaximum(360);
	RotSlider->setValue(180);
    RotSlider->setPageStep(60);
    RotSlider->setTickPosition( QSlider::TicksRight );
	connect( RotSlider, SIGNAL(valueChanged(int)),c,SLOT(setRotation(int)) );



	WLayout->addWidget(RotSlider);
	layout->addWidget( f3);



	

    QWidget *widget = new QWidget;
    widget->setLayout(layout);


    setCentralWidget(widget);
    setWindowTitle(tc->toUnicode("Robot Model Creator"));
    setUnifiedTitleAndToolBarOnMac(true);


	if (RMC::obj)
	{
		if (RMC::obj->getFileName() != "")
		{
			//std::cout << RMC::obj->getFileName() << std::endl;
			loadFile(RMC::obj->getFileName().c_str());
		}
	}
}