コード例 #1
0
void FileSelectorWidget::on_FileView_doubleClicked(const QModelIndex& index)
{
	// If the target is a directory, change to that directory.
	// Otherwise, adjust the selectedFilenames_ list and emit the selectionMade() signal.
	if (fileSystemModel_.isDir(index))
	{
		setCurrentDirectory(fileSystemModel_.filePath(index));

		// Need to clear the current files list, since it will no longer be valid
		selectedFilenames_.clear();
		emit(selectionValid(false));

		return;
	}

	// Not a dir, so adjust the filenames list and emit the signal
	QItemSelectionModel* selectionModel = ui.FileView->selectionModel();
	QModelIndexList selectedRows = selectionModel->selectedRows();
	selectedFilenames_.clear();
	for (int n=0; n<selectedRows.count(); ++n)
	{
		if (fileSystemModel_.isDir(selectedRows.at(n))) continue;
		selectedFilenames_ << fileSystemModel_.fileName(selectedRows.at(n));
	}

	emit(selectionValid(selectedFilenames_.count() > 0));

	updateWidgets();

	emit(selectionMade(false));
}
コード例 #2
0
ファイル: geMaterial.cpp プロジェクト: ileben/GameEngine
 void MultiMaterial::end ()
 {
   if( selectionValid() )
     subMaterials[ selectedID ]->end();
   else
     Material::EndDefault();
 }
コード例 #3
0
ファイル: geMaterial.cpp プロジェクト: ileben/GameEngine
 void MultiMaterial::begin()
 {
   if( selectionValid() )
     subMaterials[ selectedID ]->begin();
   else
     Material::BeginDefault();
 }
コード例 #4
0
void FileSelectorWidget::on_FileView_clicked(const QModelIndex& index)
{
	// Get current model selection and reconstruct selected files list
	QItemSelectionModel* selectionModel = ui.FileView->selectionModel();
	QModelIndexList selectedRows = selectionModel->selectedRows();
	selectedFilenames_.clear();
	for (int n=0; n<selectedRows.count(); ++n)
	{
		if (fileSystemModel_.isDir(selectedRows.at(n))) continue;
		selectedFilenames_ << fileSystemModel_.fileName(selectedRows.at(n));
	}

	emit(selectionValid(selectedFilenames_.count() > 0));

	updateWidgets();
}
コード例 #5
0
void FileSelectorWidget::on_FilesEdit_textChanged(QString textChanged)
{
	if (refreshing_) return;

	// Split current string into separate arguments
	LineParser parser;
	parser.getArgsDelim(Parser::UseQuotes, ui.FilesEdit->text());

	selectedFilenames_.clear();
	for (int n = 0; n < parser.nArgs(); ++n) selectedFilenames_ << parser.argc(n);

	// If we are updating filter/plugin based on the name, do it here
	bool formatOk = true;
	if (updatePluginFromFilename_ && (selectedFilenames_.count() > 0)) formatOk = updatePluginFromCurrentFilename() != NULL;
	
	emit(selectionValid((selectedFilenames_.count() > 0) && formatOk));
}
コード例 #6
0
ファイル: geMaterial.cpp プロジェクト: ileben/GameEngine
 bool MultiMaterial::selectSubMaterial( MaterialID id )
 {
   selectedID = id;
   return selectionValid();
 }