Esempio n. 1
0
TEST_F(DataMapping_test, RenderViewDeletedAfterClose)
{
    QPointer<AbstractRenderView> view = env->mapping.createDefaultRenderViewType();
    ASSERT_TRUE(view);

    view->close();
    QCoreApplication::processEvents();

    ASSERT_FALSE(view);
}
Esempio n. 2
0
void MainWindow::closeEvent(QCloseEvent *e)
{
	if (okToContinue()) {
        qDebug() << "closing";
        m_settings.setValue("mainwindow/geometry", saveGeometry());
        m_settings.setValue("mainwindow/windowState", saveState());
				logBrowser->close();
	    QMainWindow::closeEvent(e);
	}
}
Esempio n. 3
0
/**
 * Show a properties dialog for an ObjectWidget.
 */
void ObjectWidget::showPropertiesDialog()
{
    UMLApp::app()->docWindow()->updateDocumentation(false);
    QPointer<ClassPropertiesDialog> dlg = new ClassPropertiesDialog((QWidget*)UMLApp::app(), this);
    if (dlg->exec()) {
        UMLApp::app()->docWindow()->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
    }
    dlg->close();
    delete dlg;
}
Esempio n. 4
0
TEST_F(DataMapping_test, ClosedRenderViewValidUntilEventLoop)
{
    QPointer<AbstractRenderView> view = env->mapping.createDefaultRenderViewType();
    ASSERT_TRUE(view);

    view->close();
    ASSERT_TRUE(view);
    QCoreApplication::processEvents();

    ASSERT_FALSE(view);
}
Esempio n. 5
0
 /** Closes every previously-open instance of a SliceViewerWindow.
  */
 void WidgetFactory::closeAllSliceViewerWindows()
 {
   std::vector<QPointer<MantidQt::SliceViewer::SliceViewerWindow> >::iterator it;
   for (it = m_windows.begin(); it != m_windows.end(); ++it)
   {
     QPointer<MantidQt::SliceViewer::SliceViewerWindow> window = *it;
     if (window)
       // Close with delete
       window->close(true);
   }
   m_windows.clear();
 }
Esempio n. 6
0
/**
 * Display the properties configuration dialog for the object.
 *
 * @param parent    The parent widget.
 * @return  True for success of this operation.
 */
bool UMLObject::showPropertiesDialog(QWidget *parent)
{
    DocWindow *docwindow = UMLApp::app()->docWindow();
    docwindow->updateDocumentation(false);
    QPointer<ClassPropertiesDialog> dlg = new ClassPropertiesDialog(parent, this, false);
    bool modified = false;
    if (dlg->exec()) {
        docwindow->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
        modified = true;
    }
    dlg->close();
    delete dlg;
    return modified;
}
Esempio n. 7
0
/**
 * This method is called if you wish to see the properties of a
 * UMLObject.  A dialog box will be displayed from which you
 * can change the object's properties.
 *
 * @param page    The page to show.
 * @param assoc   Whether to show association page.
 * @return        True if we modified the object.
 */
bool UMLObject::showPropertiesPagedDialog(int page, bool assoc)
{
    Q_UNUSED(page);
    DocWindow *docwindow = UMLApp::app()->docWindow();
    docwindow->updateDocumentation(false);
    QPointer<ClassPropDlg> dlg = new ClassPropDlg((QWidget*)UMLApp::app(), this, assoc);
    bool modified = false;
    if (dlg->exec()) {
        docwindow->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
        modified = true;
    }
    dlg->close();
    delete dlg;
    return modified;
}
Esempio n. 8
0
TEST_F(DataMapping_test, ViewOwnershipPassedToMainWindow)
{
    QPointer<AbstractRenderView> view = env->mapping.createDefaultRenderViewType();
    ASSERT_TRUE(view);

    QMainWindow mainWindow;

    mainWindow.addDockWidget(Qt::LeftDockWidgetArea, view->dockWidgetParent());
    ASSERT_EQ(view->dockWidgetParent(), view->parent());
    ASSERT_EQ(&mainWindow, view->dockWidgetParent()->parent());
    view->close();

    ASSERT_TRUE(view);

    QCoreApplication::processEvents();

    ASSERT_FALSE(view);
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void AttributeMatrixCreationWidget::on_applyChangesBtn_clicked()
{
  attributeMatrixName->setStyleSheet(QString(""));
  emit parametersChanged();

  QPointer<FaderWidget> faderWidget = new FaderWidget(applyChangesBtn);
  setFaderWidget(faderWidget);

  if (getFaderWidget())
  {
    faderWidget->close();
  }
  faderWidget = new FaderWidget(applyChangesBtn);
  faderWidget->setFadeOut();
  connect(faderWidget, SIGNAL(animationComplete()),
    this, SLOT(hideButton()));
  faderWidget->start();
}