Example #1
0
/* Widgets */
Widgets::Widgets(QWidget* parent)
    : QMainWindow(parent)
{
    m_officeStyle = Q_NULL;
    setWindowTitle(tr("Qtitan Widgets Sample"));

    m_styleName = qApp->style()->objectName();

    m_mdiArea = new QMdiArea;
    m_mdiArea->setViewMode(QMdiArea::TabbedView);
    m_mdiArea->setLineWidth(3);
    m_mdiArea->setFrameShape(QFrame::Panel);
    m_mdiArea->setFrameShadow(QFrame::Sunken);

    setCentralWidget(m_mdiArea);

    setIconSize(QSize(16, 16));

    createActions();
    createDockWindows();
    createMenubar();
    createToolbar();
    statusBar();

    createMdiChild();

    QRect geom = QApplication::desktop()->availableGeometry();
    resize(2 * geom.width() / 3, 2 * geom.height() / 3);

    updateStyle(m_actOffice2007Style);
    updateTheme(m_actBlueTheme);

    readSettings();
}
XFormWidget* MainWindow::newImageWindow(const QString &name)
{
	XFormWidget* w = createMdiChild();
	//qDebug()<<" allWindowList: "<<allWindowList(); //here is VERY STRANGE, workspace->addWindow(child) DOESNOT update the workspace->windowList()
	if (w)
	{
		//w->show();
		w->setCurrentFileName(name);
		qDebug()<<"MainWindow newImageWindow: "<< w->userFriendlyCurrentFile();
	}
	return w;
}
Example #3
0
void MainWidget::newFromCurrentImageMdi()
{
    OpenCVGLWidget* current = ActiveMdiChild();

    if(current != 0)
    {
        cv::Mat currentImage = current->MOrigianlImage();
        cv::Mat image = currentImage;
        OpenCVGLWidget *openCVGLWidget = createMdiChild();
        openCVGLWidget->SetMOrigianlImage(image);
        openCVGLWidget->showImage(image);
        openCVGLWidget->show();
    }

}
Example #4
0
void MainWidget::createNewImageMdi()
{
    QString path = QFileDialog::getOpenFileName(
                this,
                tr("Pick a File"),
                "/home",
                tr("Images ( * .png * .jpg)"));

    if(path.isEmpty())
        return;

    cv::Mat image = cv::imread(path.toStdString());

    OpenCVGLWidget *openCVGLWidget = createMdiChild();
    openCVGLWidget->SetMOrigianlImage(image);
    openCVGLWidget->showImage(image);
    openCVGLWidget->show();
}
Example #5
0
int ImportDiagram::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3MainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: createMdiChild(); break;
        case 1: timerEvent(); break;
        case 2: showTable(); break;
        case 3: showSelector(); break;
        case 4: screenshort(); break;
        case 5: refresh(); break;
        case 6: backcolor(); break;
        case 7: legendIsClicked((*reinterpret_cast< QwtPlotItem*(*)>(_a[1]))); break;
        case 8: onAutoscale((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
Example #6
0
void Widgets::createActions()
{
    // Group File
    m_actNew = new QAction(QIcon(":/res/new.png"), tr("&New"), this);
    m_actNew->setStatusTip(tr("Create a new document"));
    m_actNew->setPriority(QAction::LowPriority);
    m_actNew->setShortcut(QKeySequence::New);
    connect(m_actNew, SIGNAL(triggered()), this, SLOT(createMdiChild()));

    m_actOpen = new QAction(QIcon(":/res/open.png"), tr("&Open..."), this);
    m_actOpen->setStatusTip(tr("Open an existing document"));
    m_actOpen->setShortcut(QKeySequence::Open);

    m_actSave = new QAction(QIcon(":/res/save.png"), tr("&Save"), this);
    m_actSave->setStatusTip(tr("Save the active document"));
    m_actSave->setShortcut(QKeySequence::Save);

    m_actClose = new QAction(tr("&Close"), this);
    m_actClose->setStatusTip(tr("Close the active document"));

    m_actSaveAs = new QAction(tr("Save &As..."), this);
    m_actSaveAs->setPriority(QAction::LowPriority);
    m_actSaveAs->setStatusTip(tr("Save the active document with a new name"));

#ifndef QT_NO_PRINTER
    m_actPrint = new QAction(QIcon(":/res/print.png"),tr("&Print..."), this);
    m_actPrint->setPriority(QAction::LowPriority);    
    m_actPrint->setShortcut(QKeySequence::Print);
    m_actPrint->setStatusTip(tr("Print the active document"));

    m_actPrintPreview = new QAction(QIcon(":/res/printpreview.png"),tr("Print Preview..."), this);
    m_actPrintPreview->setStatusTip(tr("Display full pages"));
#endif
    m_actExit = new QAction(tr("E&xit"), this);
    m_actExit->setStatusTip(tr("Quit the application; prompts to save documents"));
    connect(m_actExit, SIGNAL(triggered()), this, SLOT(close()));
    // Group styles
    QActionGroup* groupActions = new QActionGroup(this);
    connect(groupActions, SIGNAL(triggered(QAction*)), this, SLOT(triggeredStyles(QAction*)));

    m_actDefaultStyle = new QAction(tr("Default"), this);
    m_actDefaultStyle->setStatusTip(tr("Default Style"));
    m_actDefaultStyle->setCheckable(true);
    groupActions->addAction(m_actDefaultStyle);

    m_actOffice2007Style = new QAction(tr("Office2007"), this);
    m_actOffice2007Style->setStatusTip(tr("Office2007 Style"));
    m_actOffice2007Style->setCheckable(true);
    groupActions->addAction(m_actOffice2007Style);

    m_actRibbonStyle = new QAction(tr("Ribbon"), this);
    m_actRibbonStyle->setStatusTip(tr("Ribbon Style"));
    m_actRibbonStyle->setCheckable(true);
    groupActions->addAction(m_actRibbonStyle);

    // Group themes
    m_actToggleThemes = new QAction(tr("Themes"), this);
    m_groupThemesActions = new QActionGroup(this);
    connect(m_groupThemesActions, SIGNAL(triggered(QAction*)), this, SLOT(triggeredThemes(QAction*)));

    m_actBlueTheme = new QAction(tr("Office 2007 Blue"), this);
    m_actBlueTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_actBlueTheme);

    m_actBlackTheme = new QAction(tr("Office 2007 Black"), this);
    m_actBlackTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_actBlackTheme);

    m_actSilverTheme = new QAction(tr("Office 2007 Silver"), this);
    m_actSilverTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_actSilverTheme);

    m_actAquaTheme = new QAction(tr("Office 2007 Aqua"), this);
    m_actAquaTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_actAquaTheme);

    m_actScenicTheme = new QAction(tr("Windows 7 Scenic"), this);
    m_actScenicTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_actScenicTheme);

    m_actBlue2010Theme = new QAction(tr("Office 2010 Blue"), this);
    m_actBlue2010Theme->setCheckable(true);
    m_groupThemesActions->addAction(m_actBlue2010Theme);

    m_actSilver2010Theme = new QAction(tr("Office 2010 Silver"), this);
    m_actSilver2010Theme->setCheckable(true);
    m_groupThemesActions->addAction(m_actSilver2010Theme);

    m_actBlack2010Theme = new QAction(tr("Office 2010 Black"), this);
    m_actBlack2010Theme->setCheckable(true);
    m_groupThemesActions->addAction(m_actBlack2010Theme);

    m_act2013WhiteTheme = new QAction(tr("Office 2013 White"), this);
    m_act2013WhiteTheme->setCheckable(true);
    m_groupThemesActions->addAction(m_act2013WhiteTheme);

    // Group help
    m_actHelp = new QAction(QIcon(":/shared/res/about.png"), tr("&About Custom Styles Sample..."), this);
    m_actHelp->setStatusTip(tr("Display program information, version number and copyright"));
    connect(m_actHelp, SIGNAL(triggered()), this, SLOT(about()));
}
Example #7
0
void MainWidget::createNewCameraMdi()
{
    OpenCVGLWidget *openCVGLWidget =  createMdiChild();
    openCVGLWidget->show();
    openCVGLWidget->initializeVideoCapure();
}