コード例 #1
0
void
DatabaseCommand::emitCommitted()
{
    Q_D( DatabaseCommand );
    emit committed( d->ownRef.toStrongRef() );
    emit committed();
}
コード例 #2
0
ファイル: shellsurface.cpp プロジェクト: giucam/orbital
void ShellSurface::setWorkspace(AbstractWorkspace *ws)
{
    m_workspace = ws;
    m_surface->setWorkspaceMask(ws->mask());
    m_forceMap = true;
    committed(0, 0);
}
コード例 #3
0
ファイル: oauthwizard.cpp プロジェクト: msjoberg/pumpa
bool OAuthSecondPage::validatePage() {
  QString token = field("token").toString();
  QString verifier = field("verifier").toString();

  if (token.isEmpty() || verifier.isEmpty())
    return false;

  emit committed(token, verifier);
  return true;
}
コード例 #4
0
ファイル: oauthwizard.cpp プロジェクト: msjoberg/pumpa
bool OAuthFirstPage::validatePage() {
  QString username, server;
  bool ok = splitAccountId(username, server);

  if (!ok)
    return false;

  emit committed(username, server);
  return true;
}
コード例 #5
0
void SetMarkedObjectPropertyDlg::checkInputAndCommit()
{
    assert(mMarkedObjectTreeRoot);

    //确保类型输入框不为空
    QString markedTypeName = getMarkedTypeName();
    if (markedTypeName.isEmpty())
    {
        QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("输入的标记点类型名称不能为空,请重新输入!"));
        return;
    }

    //确保名称输入框不为空
    QString markedObjectName = getMarkedObjectName();
    if (markedObjectName.isEmpty())
    {
        QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("输入的标记点名称不能为空,请重新输入!"));
        return;
    }

    //保证同一类型下没有重名
    ccHObject *markedType = mMarkedObjectTreeRoot->findDirectChild(markedTypeName);
    if (markedType)
    {
        if (markedType->findDirectChild(markedObjectName))
        {
            QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("输入的标记点名称已存在,请重新输入!"));
            return;
        }
    }

    //保证不同类型的颜色不同
    const QColor markedObjectColor = getMarkedObjectColor();
    for (unsigned i = 0; i < mMarkedObjectTreeRoot->getChildrenNumber(); i++)
    {
        ccHObject *markedType = mMarkedObjectTreeRoot->getChild(i);
        if (markedType->getName() != markedTypeName && markedType->getChildrenNumber() > 0)
        {
            QColor currentTypeColor = static_cast<MarkedObject*>(markedType->getChild(0))->getColor();
            if (currentTypeColor == markedObjectColor)
            {
                QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("选择的颜色已被其他类型占用,请重新选择!"));
                return;
            }
        }
    }

    //保存本次输入状态,以供下次显示
    mMarkedTypeName = getMarkedTypeName();
    mMarkedObjectColor = getMarkedObjectColor();

    emit committed(getMarkedTypeName(), getMarkedObjectName(), getMarkedObjectColor());
    accept();
}
コード例 #6
0
ファイル: shellsurface.cpp プロジェクト: giucam/orbital
void ShellSurface::outputCreated(Output *o)
{
    ShellView *view = viewForOutput(o);

    if (View *v = m_views.begin()->second) {
        view->setInitialPos(v->pos());
    }

    m_forceMap = true;
    committed(0, 0);
}
コード例 #7
0
ファイル: shellsurface.cpp プロジェクト: giucam/orbital
void ShellSurface::restore()
{
    if (!m_minimized) {
        return;
    }

    m_minimized = false;
    m_forceMap = true;
    committed(0, 0);
    emit restored();
}
コード例 #8
0
ファイル: oauthwizard.cpp プロジェクト: msjoberg/pumpa
OAuthWizard::OAuthWizard(QNetworkAccessManager* nam, KQOAuthManager* oam,
                         QWidget* parent) :
  QWizard(parent),
  m_oam(oam),
  m_nam(nam)
{
  setWindowTitle(CLIENT_FANCY_NAME);

  m_oar = new KQOAuthRequest(this);

  p1 = new OAuthFirstPage(this);
  p2 = new OAuthSecondPage(this);

  connect(p1, SIGNAL(committed(QString, QString)),
          this, SLOT(onFirstPageCommitted(QString, QString)));
  connect(p2, SIGNAL(committed(QString, QString)),
          this, SLOT(onSecondPageCommitted(QString, QString)));

  addPage(p1);
  addPage(p2);
}
コード例 #9
0
ファイル: PictureZoneEditor.cpp プロジェクト: DikBSD/STE
PictureZoneEditor::PictureZoneEditor(
	QImage const& image, ImagePixmapUnion const& downscaled_image,
	imageproc::BinaryImage const& picture_mask,
	QTransform const& image_to_virt, QPolygonF const& virt_display_area,
	PageId const& page_id, IntrusivePtr<Settings> const& settings)
:	ImageViewBase(
		image, downscaled_image,
		ImagePresentation(image_to_virt, virt_display_area),
		OutputMargins()
	),
	m_context(*this, m_zones),
	m_dragHandler(*this),
	m_zoomHandler(*this),
	m_origPictureMask(picture_mask),
	m_pictureMaskAnimationPhase(270),
	m_pageId(page_id),
	m_ptrSettings(settings)
{
	m_zones.setDefaultProperties(m_ptrSettings->defaultPictureZoneProperties());

	setMouseTracking(true);

	m_context.setShowPropertiesCommand(
		boost::bind(&PictureZoneEditor::showPropertiesDialog, this, _1)
	);

	connect(&m_zones, SIGNAL(committed()), SLOT(commitZones()));

	makeLastFollower(*m_context.createDefaultInteraction());

	rootInteractionHandler().makeLastFollower(*this);

	// We want these handlers after zone interaction handlers,
	// as some of those have their own drag and zoom handlers,
	// which need to get events before these standard ones.
	rootInteractionHandler().makeLastFollower(m_dragHandler);
	rootInteractionHandler().makeLastFollower(m_zoomHandler);

	connect(&m_pictureMaskAnimateTimer, SIGNAL(timeout()), SLOT(advancePictureMaskAnimation()));
	m_pictureMaskAnimateTimer.setSingleShot(true);
	m_pictureMaskAnimateTimer.setInterval(120);

	connect(&m_pictureMaskRebuildTimer, SIGNAL(timeout()), SLOT(initiateBuildingScreenPictureMask()));
	m_pictureMaskRebuildTimer.setSingleShot(true);
	m_pictureMaskRebuildTimer.setInterval(150);

	BOOST_FOREACH(Zone const& zone, m_ptrSettings->pictureZonesForPage(page_id)) {
		EditableSpline::Ptr spline(new EditableSpline(zone.spline()));
		m_zones.addZone(spline, zone.properties());
	}
}
コード例 #10
0
void CreateMarkedObjectBagDlg::checkInputAndCommit()
{
    assert(mMarkedObjectBagDBTreeParent);

    //确保名称输入框不为空
    if (getMarkedObjectBagName().isEmpty())
    {
        QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("输入的名称不能为空,请重新输入!"));
        return;
    }

    //保证同一父节点下没有重名
    if (mMarkedObjectBagDBTreeParent->findDirectChild(getMarkedObjectBagName()))
    {
        QMessageBox::information(this, QString::fromAscii("警告"), QString::fromAscii("输入的名称已存在,请重新输入!"));
        return;
    }

    mCreatedObjectCount++;
    emit committed(getMarkedObjectBagName(), getMarkedObjectBagType(), getMarkedObjectBagColor());
    accept();
}
コード例 #11
0
ファイル: VolumeViewer.cpp プロジェクト: Acidburn0zzz/OSPRay
void VolumeViewer::initUserInterfaceWidgets()
{
  // Create a toolbar at the top of the window.
  QToolBar *toolbar = addToolBar("toolbar");

  // Add preferences widget and callback.
  PreferencesDialog *preferencesDialog = new PreferencesDialog(this, boundingBox);
  QAction *showPreferencesAction = new QAction("Preferences", this);
  connect(showPreferencesAction, SIGNAL(triggered()), preferencesDialog, SLOT(show()));
  toolbar->addAction(showPreferencesAction);

  // Add the "auto rotate" widget and callback.
  autoRotateAction = new QAction("Auto rotate", this);
  autoRotateAction->setCheckable(true);
  connect(autoRotateAction, SIGNAL(toggled(bool)), this, SLOT(autoRotate(bool)));
  toolbar->addAction(autoRotateAction);

  // Add the "next timestep" widget and callback.
  QAction *nextTimeStepAction = new QAction("Next timestep", this);
  connect(nextTimeStepAction, SIGNAL(triggered()), this, SLOT(nextTimeStep()));
  toolbar->addAction(nextTimeStepAction);

  // Add the "play timesteps" widget and callback.
  QAction *playTimeStepsAction = new QAction("Play timesteps", this);
  playTimeStepsAction->setCheckable(true);
  connect(playTimeStepsAction, SIGNAL(toggled(bool)), this, SLOT(playTimeSteps(bool)));
  toolbar->addAction(playTimeStepsAction);

  // Connect the "play timesteps" timer.
  connect(&playTimeStepsTimer, SIGNAL(timeout()), this, SLOT(nextTimeStep()));

  // Add the "add geometry" widget and callback.
  QAction *addGeometryAction = new QAction("Add geometry", this);
  connect(addGeometryAction, SIGNAL(triggered()), this, SLOT(addGeometry()));
  toolbar->addAction(addGeometryAction);

  // Add the "screenshot" widget and callback.
  QAction *screenshotAction = new QAction("Screenshot", this);
  connect(screenshotAction, SIGNAL(triggered()), this, SLOT(screenshot()));
  toolbar->addAction(screenshotAction);

  // Create the transfer function editor dock widget, this widget modifies the transfer function directly.
  QDockWidget *transferFunctionEditorDockWidget = new QDockWidget("Transfer Function", this);
  transferFunctionEditor = new TransferFunctionEditor(transferFunction);
  transferFunctionEditorDockWidget->setWidget(transferFunctionEditor);
  connect(transferFunctionEditor, SIGNAL(committed()), this, SLOT(commitVolumes()));
  connect(transferFunctionEditor, SIGNAL(committed()), this, SLOT(render()));
  addDockWidget(Qt::LeftDockWidgetArea, transferFunctionEditorDockWidget);

  // Set the transfer function editor widget to its minimum allowed height, to leave room for other dock widgets.
  transferFunctionEditor->setMaximumHeight(transferFunctionEditor->minimumSize().height());

  // Create slice editor dock widget.
  QDockWidget *sliceEditorDockWidget = new QDockWidget("Slices", this);
  sliceEditor = new SliceEditor(boundingBox);
  sliceEditorDockWidget->setWidget(sliceEditor);
  connect(sliceEditor, SIGNAL(slicesChanged(std::vector<SliceParameters>)), this, SLOT(setSlices(std::vector<SliceParameters>)));
  addDockWidget(Qt::LeftDockWidgetArea, sliceEditorDockWidget);

  // Create isosurface editor dock widget.
  QDockWidget *isosurfaceEditorDockWidget = new QDockWidget("Isosurfaces", this);
  isosurfaceEditor = new IsosurfaceEditor();
  isosurfaceEditorDockWidget->setWidget(isosurfaceEditor);
  connect(isosurfaceEditor, SIGNAL(isovaluesChanged(std::vector<float>)), this, SLOT(setIsovalues(std::vector<float>)));
  addDockWidget(Qt::LeftDockWidgetArea, isosurfaceEditorDockWidget);

  // Create the light editor dock widget, this widget modifies the light directly.
  QDockWidget *lightEditorDockWidget = new QDockWidget("Lights", this);
  LightEditor *lightEditor = new LightEditor(ambientLight, directionalLight);
  lightEditorDockWidget->setWidget(lightEditor);
  connect(lightEditor, SIGNAL(lightsChanged()), this, SLOT(render()));
  addDockWidget(Qt::LeftDockWidgetArea, lightEditorDockWidget);

  // Create the probe dock widget.
  QDockWidget *probeDockWidget = new QDockWidget("Probe", this);
  probeWidget = new ProbeWidget(this);
  probeDockWidget->setWidget(probeWidget);
  addDockWidget(Qt::LeftDockWidgetArea, probeDockWidget);

  // Tabify dock widgets.
  tabifyDockWidget(transferFunctionEditorDockWidget, sliceEditorDockWidget);
  tabifyDockWidget(transferFunctionEditorDockWidget, isosurfaceEditorDockWidget);
  tabifyDockWidget(transferFunctionEditorDockWidget, lightEditorDockWidget);
  tabifyDockWidget(transferFunctionEditorDockWidget, probeDockWidget);

  // Tabs on top.
  setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);

  // Default to showing transfer function tab widget.
  transferFunctionEditorDockWidget->raise();

  // Add the current OSPRay object file label to the bottom status bar.
  statusBar()->addWidget(&currentFilenameInfoLabel);
}