示例#1
0
文件: window.cpp 项目: Jinxiaohai/QT
//! [3]
void Window::find() {
  filesTable->setRowCount(0);

  QString fileName = fileComboBox->currentText();
  QString text = textComboBox->currentText();
  QString path = QDir::cleanPath(directoryComboBox->currentText());
  currentDir = QDir(path);
  //! [3]

  updateComboBox(fileComboBox);
  updateComboBox(textComboBox);
  updateComboBox(directoryComboBox);

  //! [4]
  QStringList filter;
  if (!fileName.isEmpty()) filter << fileName;
  QDirIterator it(path, filter,
                  QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot,
                  QDirIterator::Subdirectories);
  QStringList files;
  while (it.hasNext()) files << it.next();
  if (!text.isEmpty()) files = findFiles(files, text);
  files.sort();
  showFiles(files);
}
示例#2
0
//! [3]
void Window::find()
{
    filesTable->setRowCount(0);

    QString fileName = fileComboBox->currentText();
    QString text = textComboBox->currentText();
    QString path = directoryComboBox->currentText();
//! [3]

    updateComboBox(fileComboBox);
    updateComboBox(textComboBox);
    updateComboBox(directoryComboBox);

//! [4]
    currentDir = QDir(path);
    QStringList files;
    if (fileName.isEmpty())
        fileName = "*";
    files = currentDir.entryList(QStringList(fileName),
                                 QDir::Files | QDir::NoSymLinks);

    if (!text.isEmpty())
        files = findFiles(files, text);
    showFiles(files);
}
void QMathMLFileViewer::fileFind()
{
	filesTable->setRowCount(0);

	QString fileName = fileComboBox->currentText();
	QString path = directoryComboBox->currentText();
	updateComboBox(fileComboBox);
	updateComboBox(directoryComboBox);
	m_currentDir = QDir(path);
	if( fileName.isEmpty() ) fileName = DEFAULT_MASK;

	//QApplication::setOverrideCursor( Qt::WaitCursor );

	QStringList files;
	if( isRecursive() )
	{
		QProgressDialog progress("Searching files...", "Abort Search", 0, 100, this);
		progress.setWindowModality(Qt::WindowModal);
		progress.setMinimumDuration( 500 );
		progress.setValue( 0 );
		fileFind( files, m_currentDir, QStringList(fileName), &progress );
		//progress.setValue( 100 + files.size() );
		progress.setValue( progress.maximum() );
	}
	else
	{
		//QStringList newFiles = m_currentDir.entryList(QStringList(fileName), QDir::Files | QDir::NoSymLinks);
		//for( QStringList::const_iterator item = newFiles.constBegin(); item != newFiles.constEnd(); item++ )
		//	files.append(m_currentDir.absoluteFilePath(*item));
		files = m_currentDir.entryList(QStringList(fileName), QDir::Files | QDir::NoSymLinks);
	}

	if(files.size() > 0)
	{
		filesTable->show();
		showFiles(files);
		filesTable->resizeRowsToContents();
		filesTable->resizeColumnsToContents();
		foundMessage->setText(QString(tr("%1 file(s) shown of %2 found").arg(filesTable->rowCount()).arg(files.size())));
		emit hasFound( true );
	}
	else
	{
		filesTable->hide();
		foundMessage->setText(QString(tr("No files found to match %1")).arg(fileName));
		emit hasFound( false );
	}

	//QApplication::restoreOverrideCursor();
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void DynamicChoiceWidget::setupGui()
{

  // Catch when the filter is about to execute the preflight
  connect(getFilter(), SIGNAL(preflightAboutToExecute()),
          this, SLOT(beforePreflight()));

  // Catch when the filter is finished running the preflight
  connect(getFilter(), SIGNAL(preflightExecuted()),
          this, SLOT(afterPreflight()));

  // Catch when the filter wants its values updated
  connect(getFilter(), SIGNAL(updateFilterParameters(AbstractFilter*)),
          this, SLOT(filterNeedsInputParameters(AbstractFilter*)));

  connect(value, SIGNAL(currentIndexChanged(int)),
          this, SLOT(widgetChanged(int) ) );

  if (m_FilterParameter != NULL)
  {
    QString units = m_FilterParameter->getUnits();
    if(units.isEmpty() == false)
    {
      label->setText(m_FilterParameter->getHumanLabel() + " (" + units + ")");
    }
    else
    {
      label->setText(m_FilterParameter->getHumanLabel() );
    }
    updateComboBox();
  }
}
示例#5
0
void stompbox_dd::updateSignal()
{
    updateKnob1("06", "00", "0B");
    updateKnob2("06", "00", "0A");
    updateComboBox("06", "00", "06");
    updateSwitch("06", "00", "05");
}
示例#6
0
void stompbox_amp::updateSignal()
{
    updateKnob1("07", "00", "02");
    updateKnob2("07", "00", "03");
    updateComboBox("07", "00", "01");
    updateSwitch("07", "00", "00");
}
示例#7
0
void stompbox_cs::updateSignal()
{
	updateKnob1("00", "00", "42");
	updateKnob2("00", "00", "47");
	updateComboBox("00", "00", "41");
	updateButton("00", "00", "40");
};
示例#8
0
void GrepWidget::find()
{
    output->clear();
    QString text = textComboBox->currentText();
    updateComboBox(textComboBox);
    QStringList files;
    currentDir = m_mainWindow->m_projectWidget->rootDir;
    files = m_mainWindow->m_projectWidget->GetScriptFiles();
    if (!text.isEmpty())
        files = findFiles(files, text);
    showFiles(files);
/*








    currentDir = QDir(path);
    QStringList files;
    if (fileName.isEmpty())
        fileName = "*";
    files = currentDir.entryList(QStringList(fileName),
                                 QDir::Files | QDir::NoSymLinks);

    if (!text.isEmpty())
        files = findFiles(files, text);
    showFiles(files);
*/
}
void CMakeKitConfigWidget::cmakeToolAdded(const Core::Id &id)
{
    const CMakeTool *tool = CMakeToolManager::findById(id);
    QTC_ASSERT(tool, return);

    m_comboBox->addItem(tool->displayName(), tool->id().toSetting());
    updateComboBox();
    refresh();
}
示例#10
0
void stompbox_eq::updateSignal()
{
    updateSlider1("06", "00", "13");
    updateSlider2("06", "00", "16");
    updateSlider3("06", "00", "19");
    updateSlider4("06", "00", "1B");
    updateSlider5("06", "00", "1C");
    updateComboBox("06", "00", "1D");
    updateSwitch("06", "00", "11");
}
示例#11
0
bbTrack::bbTrack( TrackContainer* tc ) :
	track( BBTrack, tc )
{
	int bbNum = s_infoMap.size();
	s_infoMap[this] = bbNum;

	setName( tr( "Beat/Bassline %1" ).arg( bbNum ) );
	engine::getBBTrackContainer()->setCurrentBB( bbNum );
	engine::getBBTrackContainer()->updateComboBox();

	connect( this, SIGNAL( nameChanged() ),
		engine::getBBTrackContainer(), SLOT( updateComboBox() ) );
}
示例#12
0
void KColorCombo2::setColor(const QColor &color)
{
	// Do nothing if the color should be set to the default one and there is no such default color allowed:
	if (!color.isValid() && !m_defaultColor.isValid()) {
		// kdebug << this::FUNCTION << "Trying to assign the default color (an invalid one) whereas no such default color is allowed";
		return;
	}

	if (m_color != color) {
		m_color = color;
		updateComboBox();
		emit changed(color);
	}
}
示例#13
0
void CMakeKitConfigWidget::cmakeToolRemoved(const Core::Id &id)
{
    const int pos = indexOf(id);
    QTC_ASSERT(pos >= 0, return);

    // do not handle the current index changed signal
    m_removingItem = true;
    m_comboBox->removeItem(pos);
    m_removingItem = false;

    // update the checkbox and set the current index
    updateComboBox();
    refresh();
}
QWidget *ArchiveDelegate::createEditor(QWidget *AParent, const QStyleOptionViewItem &AOption, const QModelIndex &AIndex) const
{
	Q_UNUSED(AOption);
	switch (AIndex.column())
	{
	case COL_SAVE:
	case COL_OTR:
	case COL_EXACT:
		{
			QComboBox *comboBox = new QComboBox(AParent);
			updateComboBox(AIndex.column(),comboBox);
			return comboBox;
		}
	case COL_EXPIRE:
		{
			QComboBox *comboBox = new QComboBox(AParent);
			updateComboBox(AIndex.column(),comboBox);
			connect(comboBox,SIGNAL(currentIndexChanged(int)),SLOT(onExpireIndexChanged(int)));
			return comboBox;
		}
	}
	return NULL;
}
示例#15
0
void AddJobDialog::restoreOptions(const OptionsModel *options)
{
	//Ignore config changes while restoring template!
	m_monitorConfigChanges = false;

	ui->cbxEncoderType    ->setCurrentIndex(options->encType());
	ui->cbxEncoderArch    ->setCurrentIndex(options->encArch());
	ui->cbxEncoderVariant ->setCurrentIndex(options->encVariant());
	ui->cbxRateControlMode->setCurrentIndex(options->rcMode());

	ui->spinQuantizer->setValue(options->quantizer());
	ui->spinBitrate  ->setValue(options->bitrate());

	updateComboBox(ui->cbxPreset,  options->preset());
	updateComboBox(ui->cbxTuning,  options->tune());
	updateComboBox(ui->cbxProfile, options->profile());

	ui->editCustomX264Params   ->setText(options->customEncParams());
	ui->editCustomAvs2YUVParams->setText(options->customAvs2YUV());

	//Make sure we will monitor config changes again!
	m_monitorConfigChanges = true;
}
示例#16
0
void EditMediaDialog::setTagsInfo() {
    QString mediaName = indexList_.at(selectionPos_ - originPos_).data().toString();
    int mediaId = DatabaseManager::getInstance()->getMediaId(mediaName);
    QStringList tagList = DatabaseManager::getInstance()->getMediaTagList(mediaId);
    ui_->tagsLabel->setText(tagList.join(", "));

    // set the local lists
    tagsSet_->clear();
    tagsSet_->append(tagList);

    tagsUnset_->clear();
    QStringList allTagList = DatabaseManager::getInstance()->getTagList();
    for(int i=0; i<allTagList.count(); ++i)
        if(!tagsSet_->contains(allTagList.at(i)))
            tagsUnset_->append(allTagList.at(i));

    updateComboBox();
}
示例#17
0
void KColorCombo2::init()
{
	m_discardNextMousePress = false;
	m_colorArray            = 0;
	d                       = new KColorCombo2Private();

	setDefaultColor(m_defaultColor);
	insertItem("", /*index=*/0);
	updateComboBox(); // It need an item of index 0 to exists, so we created it.
	setAcceptDrops(true);

	m_popup = new KColorPopup(this);
	m_popup->installEventFilter(this);

	// By default, the array is filled with setRainbowPreset().
	// But we allocate it on demand (the later as possible) to avoid performances issues if the developer set another array.
	// However, to keep columnCount() rowCount() const, we define theme here:
	m_columnCount = 13;
	m_rowCount    = 9;
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void DynamicChoiceWidget::afterPreflight()
{
  updateComboBox();
}
示例#19
0
void stompbox_mod::updateSignal()
{
    updateComboBox("07", "00", "16");
    updateKnob1("07", "00", "17");
    updateSwitch("07", "00", "15");
}
示例#20
0
void VNotebookSelector::update()
{
    updateComboBox();
}
示例#21
0
void stompbox_mfx::updateSignal()
{
    updateComboBox("03", "00", "05");
    updateSwitch("03", "00", "04");
    updateKnob1("03", "00", "06");
}
void AddSignalHandlerDialog::setSignals(const QStringList &_signals)
{
    m_signals = _signals;
    updateComboBox();
}
示例#23
0
void GrepWidget::SetText(QString text)
{
textComboBox->setEditText(text);
updateComboBox(textComboBox);
find();
}
示例#24
0
void KColorCombo2::fontChange(const QFont &oldFont)
{
	// Since the color-rectangle is the same height of the text, we should resize it if the font change:
	updateComboBox();
	QComboBox::fontChange(oldFont); // To update geometry.
}