Exemple #1
0
void FileNewController::react() {
   qDebug() << "Creating new window";
   EditSubWindow *newEditWindow = new EditSubWindow(&mdiMain);
   BufferRef buffer = bufferPool.getEmptyBuffer();
   newEditWindow->setBuffer(buffer);
   newEditWindow->show();
   QMdiSubWindow *subWindow = mdiMain.addSubWindow(newEditWindow);
   subWindow->setAttribute(Qt::WA_DeleteOnClose);
   subWindow->show();
}
Exemple #2
0
void MainWindow::setFilterDlg()
{
    QMdiSubWindow *wnd = mdi->currentSubWindow();

    if (wnd)
    {
        DB2Window *w = (DB2Window*)wnd->widget();
        w->setFilter();
    }
}
Exemple #3
0
void MainWindow::showFormatString()
{
    QMdiSubWindow *wnd = mdi->currentSubWindow();

    if (wnd)
    {
        DB2Window *w = (DB2Window*)wnd->widget();
        w->showFormatString();
    }
}
ImageWindow* WindowService::getCurrentImageWindow()
{
    QMdiSubWindow* sw = _mdi->currentSubWindow();

    if(sw != NULL) {
        ImageWindow* imw = dynamic_cast<ImageWindow*>(sw->widget());
        return imw;
    }
    else return NULL;
}
void MainWindow::SaveImage()
{
  QMdiSubWindow *win = ui->mdiArea->currentSubWindow();
  if(win != NULL){
    CanvasWidgetContainer *wid = dynamic_cast<CanvasWidgetContainer*>(win->widget());
    if(wid != NULL){
      wid->SaveImage();
    }
  }
}
void RadMainWindow :: initConvDist (void)
{
    RadarImageProc * rdConv = RadarImageProc::getRadarImage();
    if (!rdConv)
        return;
    ConvDistanceWidget * cW = rdConv->getCDistWidget();
    QMdiSubWindow * subCW = m_mdiArea->addSubWindow (cW);
    cW->show();
    subCW->setAttribute (Qt::WA_DeleteOnClose);
}
Exemple #7
0
void MainWindow::showStringsTable()
{
    QMdiSubWindow *wnd = mdi->currentSubWindow();

    if (wnd)
    {
        DB2Window *w = (DB2Window*)wnd->widget();
        w->showStringsList();
    }
}
Workspace::Workspace(PreviewFrame* parent, const char* name)
    : QMdiArea(parent)
{
    previewFrame = parent;
    PreviewWidget *previewWidget = previewFrame->widget();
    setObjectName(QLatin1String(name));
    QMdiSubWindow *frame = addSubWindow(previewWidget, Qt::Window);
    frame->move(10,10);
    frame->show();
}
void CLogisticMainWindow::slotPrioritiesDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Приоритеты");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createPriorities(),
                       "Приоритеты",
                       QIcon(QString("data/picture/sidebar/priority.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotStatusDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Статусы");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createStatus(),
                       "Статусы",
                       QIcon(QString("data/picture/sidebar/status.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotContractorTypesDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Типы контрагентов");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createContractorType(),
                       "Типы контрагентов",
                       QIcon(QString("data/picture/sidebar/contractortype.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotTaskTypesDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Типы задач");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createTaskType(),
                       "Типы задач",
                       QIcon(QString("data/picture/sidebar/tasktype.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotPositionsDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Должности");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createPosition(),
                       "Должности",
                       QIcon(QString("data/picture/sidebar/positions.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotContactsDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Контакты");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createContacts(),
                       "Контакты",
                       QIcon(QString("data/picture/sidebar/contacts.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotSuppliersDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Поставщики");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createSappliers(),
                       "Поставщики",
                       QIcon(QString("data/picture/sidebar/suppliers.ico")));
    } else {
         msw->setFocus();
    }
}
void CLogisticMainWindow::slotCountryCityDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Страны и города");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createCountryCity(),
                       "Страны и города",
                       QIcon(QString("data/picture/sidebar/countryandcity.ico")));
    } else {
         msw->setFocus();
    }
}
Exemple #17
0
void RadMainWindow :: slot3DMod (void)
{
    qDebug () << __PRETTY_FUNCTION__;
    imageCreatorForm * icf = new imageCreatorForm (0);
    connect (icf, SIGNAL (imagesData(generatingDataPlus)), this, SLOT (slotGologramCalc(generatingDataPlus)) );
    QMdiSubWindow * subCW = m_mdiArea->addSubWindow (icf);
    connect (icf, SIGNAL (rejected()), subCW, SLOT (close()) );
    icf->show();
    subCW->setAttribute (Qt::WA_DeleteOnClose);
    //icf->exec();
}
void CLogisticMainWindow::slotCustomerDictionary()
{
    QMdiSubWindow *msw = findMdiWindow("Заказчики");
    if (!msw){
         showMdiWindow(CLogisticApplication::instance()->createCustomer(),
                       "Заказчики",
                       QIcon(QString("data/picture/sidebar/customer.ico")));
    } else {
         msw->setFocus();
    }
}
Exemple #19
0
void PropLov::setTabName(const QModelIndex &index)
{
    QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *> (this->parent());

    QString lovName = modelData(DBLOVXML::LOV, DBLOVXML::NAME,index).toString();
    QString id = this->dataId(index);

    this->setObjectName("PropLov::" + id);
    subWindow->setWindowIcon(qvariant_cast<QIcon>(index.data(Qt::DecorationRole)));
    subWindow->setWindowTitle(lovName);
}
void viewGVpropertieslayout::actionAddGraph_triggered() {

    QCustomPlot * plot = new QCustomPlot;
    setupPlot(plot);

    QMdiSubWindow * mdiSubWin = viewGV->mdiarea->addSubWindow(plot);

    if (mdiSubWin != NULL) {
        mdiSubWin->setVisible(true);
    }
}
Exemple #21
0
void MainWindow::on_actionControlPixmap_triggered()
{
    QAxWidget *container = activeAxWidget();
    if (!container)
        return;

    QLabel *label = new QLabel;
    label->setPixmap(QPixmap::grabWidget(container));
    QMdiSubWindow *subWindow = mdiArea->addSubWindow(label);
    subWindow->setWindowTitle(tr("%1 - Pixmap").arg(container->windowTitle()));
    label->show();
}
Exemple #22
0
QMdiSubWindow *CustomMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags flags) {
    QMdiSubWindow *subwindow = QMdiArea::addSubWindow(widget, flags);

    QPixmap pix(16, 16);
    pix.fill(Qt::transparent);

    subwindow->setWindowIcon(QIcon(pix));
    subwindow->setOption(QMdiSubWindow::RubberBandResize, true);
    subwindow->setOption(QMdiSubWindow::RubberBandMove, true);

    return subwindow;
}
Exemple #23
0
//TODO: debug, this seems circular, maybe not necessary
void CodeArea::selectRevision(Revision *r)
{
    QMdiSubWindow *sub = subWindowMap[r];

    //if we closed the window and it is invisible, make it visible
    if ( sub && !sub->isVisible() )
    {
        sub->show(); sub->widget()->show();
    }

    setActiveSubWindow( sub );
}
Exemple #24
0
void CodeEdit::updateTitle()
{
    QMdiSubWindow *sub = (QMdiSubWindow *)this->parent();

    if ( !rev->textChangedSinceSave ) {

        rev->textChangedSinceSave = true;
        sub->setWindowTitle( rev->getDisplayName() );

        //TODO: also update in shredTree UI
    }
}
Exemple #25
0
void MainWindow::addEditor(Editor *editor)
{
    connect(editor, SIGNAL(copyAvailable(bool)),
            cutAction, SLOT(setEnabled(bool)));
    connect(editor, SIGNAL(copyAvailable(bool)),
            copyAction, SLOT(setEnabled(bool)));

    QMdiSubWindow *subWindow = mdiArea->addSubWindow(editor);
    windowMenu->addAction(editor->windowMenuAction());
    windowActionGroup->addAction(editor->windowMenuAction());
    subWindow->show();
}
void MainWindow::showEncuesta() {
    if (encuesta == 0) {
        encuesta = new EncuestadorForm;
        QMdiSubWindow *subWin = mdiArea->addSubWindow(encuesta, Qt::SubWindow);
        subWin->setAttribute(Qt::WA_DeleteOnClose);
        encuesta->setParent(subWin);
    }
    encuesta->setWindowState(Qt::WindowMaximized);
    encuesta->show();
    encuesta->setFocus(Qt::ActiveWindowFocusReason);
    connect(encuesta, SIGNAL(destroyed()), this, SLOT(hideEncuesta()));
}
void MainWindow::showBarrio() {
    if (barrio == 0) {
        barrio = new BarrioForm;
        QMdiSubWindow *subWin = mdiArea->addSubWindow(barrio, Qt::SubWindow);
        subWin->setAttribute(Qt::WA_DeleteOnClose);
        barrio->setParent(subWin);
    }
    barrio->setWindowState(Qt::WindowMaximized);
    barrio->show();
    barrio->setFocus(Qt::ActiveWindowFocusReason);
    connect(barrio, SIGNAL(destroyed()), this, SLOT(hideBarrio()));
}
void MainWindow::showListado() {
    if (listado == 0) {
        listado = new Listado;
        QMdiSubWindow *subWin = mdiArea->addSubWindow(listado, Qt::SubWindow);
        subWin->setAttribute(Qt::WA_DeleteOnClose);
        listado->setParent(subWin);
    }
    listado->setWindowState(Qt::WindowMaximized);
    listado->show();
    listado->setFocus(Qt::ActiveWindowFocusReason);
    connect(listado, SIGNAL(destroyed()), this, SLOT(hideListado()));
}
Exemple #29
0
void CMainWindow::slotLoad()
{
   // get an image file from a file dialog
   QString filename = QFileDialog::getOpenFileName(this, "Open Image", ".", "Images(*.bmp *.jpg *.png)");
   if (filename.isEmpty())
   {
      return;
   }

   // open the image
   QImage *img = new QImage(filename);
   if (!img->load(filename))
   {
      QMessageBox::warning(this, "Load error", "Could not load file");
      return;
   }

   // create a subwindow
   QFileInfo imgInfo(filename);
   QString mN = imgInfo.baseName();
   int     mW = img->size().width();
   int     mH = img->size().height();

   slotNewDrawBoard(mN, mW, mH);

   // retrieve the subwindow from the central mdi widget
   QMdiSubWindow *activeSubWindow = m_centralWidget->activeSubWindow();
   if (0 == activeSubWindow)
   {
      return;
   }
   CDrawBoardFrame *drawFrame = (CDrawBoardFrame *)activeSubWindow->widget();
   if (0 == drawFrame)
   {
      return;
   }

   // retrieve the drawboard pointer from local map
   QString mName = drawFrame->getName();
   if (!drawBoards.contains(mName))
   {
      return;
   }

   // initialize the draboard with the loaded image
   CDrawBoard *drawBoard = drawBoards.value(drawFrame->getName());
   drawBoard->slotLoad(filename, img);
   drawBoard = 0;
   drawFrame = 0;
   delete img;
   img = 0;
}
Exemple #30
0
/**
\param w
**/
void BlWorkspace::addSubWindow ( QWidget * w )
{
    BL_FUNC_DEBUG
    int tamdispW;
    int tamdispH;
    int tamventanadecoW;
    int tamventanadecoH;
    int tamventanaW;
    int tamventanaH;
    int margen = 10;

    QMdiSubWindow *sw = new QMdiSubWindow;
    sw->setWidget(w);
    connect ( w, SIGNAL(destroyed(QObject *)), sw, SLOT(close()));
    connect ( w, SIGNAL(hided(QObject *)), sw, SLOT(hide()));
//    connect ( w, SIGNAL(hided(QObject *)), this, SIGNAL(deselectDockAll()));
    connect ( w, SIGNAL(showed(QObject *)), sw, SLOT(show()));
    
    QMdiArea::addSubWindow (sw);


    /// Se comprueba el tama&ntilde;o de la ventana que esta dise&ntilde;ada con Designer:
    /// S&oacute;lo si la ventana es m&aacute;s grande que el espacio de representaci&oacute;n
    /// se ajusta para caber dentro.

    /// Captura el tama&ntilde;o disponible. Restamos el margen que dejamos a cada lado (x2).
    tamdispW = this->width() - ( margen * 2 );
    tamdispH = this->height() - ( margen * 2 );

    /// Captura el tama&ntilde;o con decoraci&oacute;n de la ventana a insertar.
    tamventanadecoW = w->parentWidget() ->frameGeometry().width();
    tamventanadecoH = w->parentWidget() ->frameGeometry().height();
    /// Captura el tama&ntilde;o sin decoraci&oacute;n de la ventana a insertar.
    tamventanaW = w->geometry().width();
    tamventanaH = w->geometry().height();

    /// Comprobamos si es necesario cambiar el tama&ntilde;o a la ventana.
    if ( tamventanadecoW > tamdispW )
        tamventanaW = tamdispW - ( tamventanadecoW - tamventanaW );
    if ( tamventanadecoH > tamdispH )
        tamventanaH = tamdispH - ( tamventanadecoH - tamventanaH );

    w->setGeometry ( 0, 0, tamventanaW, tamventanaH );
    w->parentWidget() ->move ( margen, margen );

    /// Crea un QAction para manejar la tecla rapida ESC para cerrar la ventana.
    QAction *accionEsc = new QAction ( w );
    accionEsc->setShortcut ( _ ( "Esc" ) );
    connect ( accionEsc, SIGNAL ( triggered() ), w, SLOT ( close() ) );
    w->addAction ( accionEsc );
    
}