Esempio n. 1
0
void MainWindow::open(std::unique_ptr<Project> project) {
    assert(project);

    project_ = std::move(project);

    imageChanged();
    instructionsChanged();
    treeChanged();

    /* Log messages to the log window. */
    project_->setLogToken(logToken_);

    /* Connect the project to the slots for updating views. */
    connect(project_.get(), SIGNAL(nameChanged()), this, SLOT(updateGuiState()));
    connect(project_.get(), SIGNAL(imageChanged()), this, SLOT(imageChanged()));
    connect(project_.get(), SIGNAL(instructionsChanged()), this, SLOT(instructionsChanged()));
    connect(project_.get(), SIGNAL(treeChanged()), this, SLOT(treeChanged()));

    /* Connect the project to the progress dialog. */
    connect(project_->commandQueue(), SIGNAL(nextCommand()), this, SLOT(updateGuiState()));
    connect(project_->commandQueue(), SIGNAL(idle()), this, SLOT(updateGuiState()));
    connect(progressDialog_, SIGNAL(canceled()), project_.get(), SLOT(cancelAll()));

    /* Delegate "Cancel All" to the project. */
    connect(cancelAllAction_, SIGNAL(triggered()), project_.get(), SLOT(cancelAll()));

    updateGuiState();
}
Esempio n. 2
0
APlayer::APlayer()
{
	old = 0;

	m_fsModel = new QFileSystemModel(this);
	m_fsModel->setRootPath("/");
	m_fsModel->setFilter(QDir::Dirs | QDir::Drives | QDir::NoDotAndDotDot);

	w_fileSystemTree = new QTreeView();
	w_fileSystemTree->setModel(m_fsModel);
	w_fileSystemTree->setSelectionMode(QAbstractItemView::SingleSelection);

	w_folderContents = new QTreeWidget();
	w_folderContents->setHeaderLabels(QStringList() << "Artist" << "Title" << "Album" << "Year");

	w_splitter = new QSplitter();
	w_splitter->setOrientation(Qt::Horizontal);
	w_splitter->addWidget(w_fileSystemTree);
	w_splitter->addWidget(w_folderContents);
	w_splitter->setStretchFactor(0, 40);
	w_splitter->setStretchFactor(1, 60);

	w_playPause = new QPushButton(QIcon::fromTheme("media-playback-start"), tr(""));
	w_stop = new QPushButton(QIcon::fromTheme("media-playback-stop"), tr(""));
	w_sound = new QPushButton(QIcon::fromTheme("player-volume"), tr(""));

	w_progress = new QSlider(Qt::Horizontal);

	m_media = Phonon::createPlayer(Phonon::MusicCategory);
	m_media->setTickInterval(1000);

	la_playerButtons = new QHBoxLayout();
	la_playerButtons->addWidget(w_playPause);
	la_playerButtons->addWidget(w_stop);
	la_playerButtons->addWidget(w_sound);
	la_playerButtons->addWidget(w_progress);

	la_mainWindow = new QVBoxLayout();
	la_mainWindow->addWidget(w_splitter);
	la_mainWindow->addLayout(la_playerButtons);

	QWidget *w = new QWidget();
	w->setLayout(la_mainWindow);
	setCentralWidget(w);


	connect(w_fileSystemTree, SIGNAL(clicked(QModelIndex)), this, SLOT(treeItemClicked(QModelIndex)));

	connect(w_playPause, SIGNAL(clicked()), this, SLOT(playPause()));
	connect(w_stop, SIGNAL(clicked()), this, SLOT(stop()));

	connect(w_fileSystemTree, SIGNAL(collapsed(QModelIndex)), this, SLOT(treeChanged()));
	connect(w_fileSystemTree, SIGNAL(expanded(QModelIndex)), this, SLOT(treeChanged()));

	connect(m_media, SIGNAL(tick(qint64)), this, SLOT(setPlaybackState(qint64)));
	connect(m_media, SIGNAL(totalTimeChanged(qint64)), this, SLOT(setPlaybackMax(qint64)));

	connect(w_folderContents, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(fileDoubleClicked(QTreeWidgetItem*,int)));
}
PropEditorWidget::PropEditorWidget(ObjTreeQtModel* aObjTreeMdl, QWidget * parent, Qt::WindowFlags flags) :
                                   QDockWidget(parent, flags),
                                   Ui::RKPropEditorWidget(),
                                   mdl(aObjTreeMdl->get_object_graph(),aObjTreeMdl->get_root_node()),
                                   delegate(&mdl)
{
  setupUi(this);
  this->tableView->setModel(&mdl);
  this->tableView->setRootIndex(QModelIndex());
  this->tableView->setItemDelegate(&delegate);
  this->tableTab->setAttribute(Qt::WA_AlwaysShowToolTips, true);
  this->sourceTab->setAttribute(Qt::WA_AlwaysShowToolTips, true);
  
  connect(aObjTreeMdl, SIGNAL(objectNodeSelected(serialization::object_node_desc)), &mdl, SLOT(selectObject(serialization::object_node_desc)));
  connect(&mdl, SIGNAL(objectTreeChanged()), aObjTreeMdl, SLOT(treeChanged()));

  connect(&mdl, SIGNAL(objectNameChanged(std::string)), this, SLOT(objNameChanged(std::string)));
  connect(&mdl, SIGNAL(sourceDataChanged()), this, SLOT(xmlSrcChanged()));
  connect(this, SIGNAL(editedXMLSrc(std::string)), &mdl, SLOT(sourceDataEdited(std::string)));
  
  connect(this->applyButton, SIGNAL(clicked()), this, SLOT(applyButtonClick()));
  connect(this->cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClick()));
  
  connect(this->textEdit, SIGNAL(textChanged()), this, SLOT(onTextChanged()));
};
Esempio n. 4
0
void XmlTreeReaderNode::updateTree()
{
	m_xmltree->Update();
	m_Tree = m_xmltree->GetOutput();

	VTKTreeParameter * outParameter = dynamic_cast<VTKTreeParameter*>(getParameter(m_outputVTKTreeName));
	outParameter->setVTKGraph(m_Tree);
	outParameter->propagateDirty(0);
//	setValue(m_outputVTKTableName, QVariant::fromValue<vtkTable *>(m_Tree), true);

	emit treeChanged(m_Tree);
}