• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ currentText函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中currentText函数的典型用法代码示例。如果您正苦于以下问题:C++ currentText函数的具体用法?C++ currentText怎么用?C++ currentText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了currentText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: currentText

QTime KTimeEdit::getTime() const
{
    //kdDebug(5300) << "KTimeEdit::getTime(), currentText() = " << currentText() << endl;
    // TODO use KLocale::WithoutSeconds in HEAD
    bool ok = false;
    QTime time = KGlobal::locale()->readTime(currentText(), KLocale::WithoutSeconds, &ok);
    if(!ok)
    {
        // Also try to accept times in "military format", i.e. no delimiter, like 1200
        int tm = currentText().toInt(&ok);
        if((0 <= tm) && (tm < 2400) && (tm % 100 < 60) && ok)
        {
            time.setHMS(tm / 100, tm % 100, 0);
        }
        else
        {
            ok = false;
        }
    }
    kdDebug(5300) << "KTimeEdit::getTime(): " << time.toString() << endl;
    return time;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:22,代码来源:ktimeedit.cpp


示例2: slotPatternChanged

/**
 * Called when the pattern has changed. This method 
 * sets the current pattern to the value chosen.
 */
void QG_PatternBox::slotPatternChanged(int index) {

    RS_DEBUG->print("QG_PatternBox::slotPatternChanged %d\n", index);

    currentPattern = RS_PATTERNLIST->requestPattern(currentText());

    if (currentPattern!=NULL) {
        RS_DEBUG->print("Current pattern is (%d): %s\n",
                        index, currentPattern->getFileName().toLatin1().data());
    }

    emit patternChanged(currentPattern);
}
开发者ID:0825732889,项目名称:LibreCAD,代码行数:17,代码来源:qg_patternbox.cpp


示例3: currentText

QString QgsFieldExpressionWidget::currentField( bool *isExpression, bool *isValid ) const
{
  QString text = currentText();
  if ( isValid )
  {
    *isValid = isValidExpression();
  }
  if ( isExpression )
  {
    *isExpression = this->isExpression();
  }
  return text;
}
开发者ID:Br1ndavoine,项目名称:QGIS,代码行数:13,代码来源:qgsfieldexpressionwidget.cpp


示例4: currentText

GeocoordType GeocoordTypeComboBox::getGeocoordType() const
{
   if (currentIndex() != -1)
   {
      std::string typeText = currentText().toStdString();
      if (typeText.empty() == false)
      {
         return StringUtilities::fromDisplayString<GeocoordType>(typeText);
      }
   }

   return GeocoordType();
}
开发者ID:Tom-VdE,项目名称:opticks,代码行数:13,代码来源:GeocoordTypeComboBox.cpp


示例5: currentText

bool CommandComboBox::event(QEvent *e)
{
    if (e->type() == QEvent::ToolTip) {
        const QString text = currentText();
        if (const Core::Command *cmd = command(text)) {
            const QString tooltip = tr("Activate %1 Pane").arg(text);
            setToolTip(cmd->stringWithAppendedShortcut(tooltip));
        } else {
            setToolTip(text);
        }
    }
    return QComboBox::event(e);
}
开发者ID:pcacjr,项目名称:qt-creator,代码行数:13,代码来源:navigationsubwidget.cpp


示例6: setUpdatesEnabled

void KonqCombo::removeURL( const QString& url )
{
    setUpdatesEnabled( false );
    lineEdit()->setUpdatesEnabled( false );

    removeFromHistory( url );
    applyPermanent();
    setTemporary( currentText() );

    setUpdatesEnabled( true );
    lineEdit()->setUpdatesEnabled( true );
    update();
}
开发者ID:theunbelievablerepo,项目名称:dolphin2.1,代码行数:13,代码来源:konqcombo.cpp


示例7: currentText

QgsVectorColorRampV2* QgsColorRampComboBox::currentColorRamp()
{
  QString rampName = currentText();

  if ( rampName == tr( "Random colors" ) )
  {
    return new QgsRandomColorsV2();
  }
  else if ( rampName == "[source]" && mSourceColorRamp )
    return mSourceColorRamp->clone();
  else
    return mStyle->colorRamp( rampName );
}
开发者ID:GiordanoPezzola,项目名称:QGIS,代码行数:13,代码来源:qgscolorrampcombobox.cpp


示例8: currentText

ModisUtilities::RasterConversionType RasterConversionTypeComboBox::getRasterConversion() const
{
   if (currentIndex() != -1)
   {
      std::string typeText = currentText().toStdString();
      if (typeText.empty() == false)
      {
         return StringUtilities::fromDisplayString<ModisUtilities::RasterConversionType>(typeText);
      }
   }

   return ModisUtilities::RasterConversionType();
}
开发者ID:Tom-VdE,项目名称:opticks,代码行数:13,代码来源:RasterConversionTypeComboBox.cpp


示例9: currentText

bool ClassNameValidatingComboBox::isValid() const
{
    const QString baseClass = currentText().trimmed();
    if (!baseClass.isEmpty())
    {
        if (!d->m_validator.validate(baseClass)) {
            d->m_errorMessage = tr("Invalid base class name");
            return false;
        }
    }
    d->m_errorMessage.clear();
    return true;
}
开发者ID:sergey-shambir,项目名称:sergey-shambir-sandbox,代码行数:13,代码来源:classnamevalidatingcombobox.cpp


示例10: Assert

void
VBoxDbgConsoleInput::returnPressed()
{
    Assert(m_hGUIThread == RTThreadNativeSelf());

    QString strCommand = currentText();
    /** @todo trim whitespace? */
    if (strCommand.isEmpty())
        return;

    /* deal with the current command. */
    emit commandSubmitted(strCommand);


    /*
     * Add current command to history.
     */
    bool fNeedsAppending = true;

    /* invariant: empty line at the end */
    int iLastItem = count() - 1;
    Assert(itemText(iLastItem).isEmpty());

    /* have previous command? check duplicate. */
    if (iLastItem > 0)
    {
        const QString strPrevCommand(itemText(iLastItem - 1));
        if (strCommand == strPrevCommand)
            fNeedsAppending = false;
    }

    if (fNeedsAppending)
    {
        /* history full? drop the oldest command. */
        if (count() == maxCount())
        {
            removeItem(0);
            --iLastItem;
        }

        /* insert before the empty line. */
        insertItem(iLastItem, strCommand);
    }

    /* invariant: empty line at the end */
    int iNewLastItem = count() - 1;
    Assert(itemText(iNewLastItem).isEmpty());

    /* select empty line to present "new" command line to the user */
    setCurrentIndex(iNewLastItem);
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:51,代码来源:VBoxDbgConsole.cpp


示例11: switch

void RComboBox::keyPressEvent(QKeyEvent *e)
{
    timer->stop();
    if (completer && completer->popup()->isVisible())
    {
        // The following keys are forwarded by the completer to the widget
        switch (e->key())
        {
        case Qt::Key_Enter:
        case Qt::Key_Return:
        case Qt::Key_Escape:
        case Qt::Key_Tab:
        case Qt::Key_Backtab:
            e->ignore();
            return; // Let the completer do default behavior
        }
    }

    if (e->text().length() > 0 && e->text().at(0).isPrint()){
        if(this->lineEdit()->selectedText().size() > 0)
            this->lineEdit()->del();
        QString cur = currentText();
        int pos = this->lineEdit()->cursorPosition();
        cur = cur.left(pos)
                .append(e->text())
                .append(cur.right(cur.length()-pos));
        setEditText(cur);
        this->lineEdit()->setCursorPosition(pos+1);
        //CustomComboBox::keyPressEvent(e);
    }
    else CustomComboBox::keyPressEvent(e);

    if(currentText().length() < min_chars && completer->popup()->isVisible())
        completer->popup()->close();
    this->lineEdit()->deselect();

    timer->start(timeout);
}
开发者ID:qks1,项目名称:erk,代码行数:38,代码来源:rcombobox.cpp


示例12: currentText

void hashBox::setupHashes(QList<int> nids)
{
	QString md = currentText();
	if (!wanted_md.isEmpty())
		md = wanted_md;
	clear();
	for (unsigned i=0; i<ARRAY_SIZE(hashalgos); i++) {
		if (nids.contains(hashalgos[i].md->type)) {
			addItem(QString(hashalgos[i].name));
		}
	}
	setDefaultHash();
	setCurrentString(md);
}
开发者ID:J-Javan,项目名称:xca,代码行数:14,代码来源:hashBox.cpp


示例13: currentText

//! Slot called when QComboBox has changed
void QgsScaleComboBox::fixupScale()
{
  QStringList txtList = currentText().split( ':' );
  bool userSetScale = txtList.size() != 2;

  bool ok;
  double newScale = toDouble( currentText(), &ok );

  // Valid string representation
  if ( ok )
  {
    // if a user types scale = 2345, we transform to 1:2345
    if ( userSetScale && newScale >= 1.0 )
    {
      newScale = 1 / newScale;
    }
    setScale( newScale );
  }
  else
  {
    setScale( mScale );
  }
}
开发者ID:Antoviscomi,项目名称:QGIS,代码行数:24,代码来源:qgsscalecombobox.cpp


示例14: setCurrentByDictionaryName

void DictionaryComboBox::setCurrentByDictionaryName( const QString & name )
{
    if ( name.isEmpty() || name == currentText() )
        return;

    int idx = findText( name );
    if ( idx == -1 ) {
        kDebug() << "name not found" << name;
        return;
    }

    setCurrentIndex( idx );
    d->slotDictionaryChanged( idx );
}
开发者ID:vasi,项目名称:kdelibs,代码行数:14,代码来源:dictionarycombobox.cpp


示例15: currentItem

void OCompletionBox::down()
{
    int i = currentItem();

    if ( i == 0 && d->down_workaround ) {
        d->down_workaround = false;
        setCurrentItem( 0 );
        setSelected( 0, true );
        emit highlighted( currentText() );
    }

    else if ( i < (int) count() - 1 )
        setCurrentItem( i + 1 );
}
开发者ID:opieproject,项目名称:opie,代码行数:14,代码来源:ocompletionbox.cpp


示例16: currentText

QString QgsFieldExpressionWidget::currentField( bool *isExpression, bool *isValid ) const
{
  QString text = currentText();
  bool valueIsExpression = this->isExpression();
  if ( isValid )
  {
    // valid if not an expression (ie, set to a field), or set to an expression and expression is valid
    *isValid = !valueIsExpression || isValidExpression();
  }
  if ( isExpression )
  {
    *isExpression = valueIsExpression;
  }
  return text;
}
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:15,代码来源:qgsfieldexpressionwidget.cpp


示例17: currentText

QString MyComboBox::getComboText() const
{
    QString text = currentText();
    if (!text.isEmpty())
    {
        int index = currentIndex();
        if ((index == -1) || (itemText(index) != text))
        {
            MyStringListModel* m = qobject_cast<MyStringListModel*>(model());
            if (m)
                m->checkString(text);
        }
    }
    return text;
}
开发者ID:koboveb,项目名称:SVID.TERMINAL,代码行数:15,代码来源:MyComboBox.cpp


示例18: editingFinished

void ValueSlider::
        editingFinished()
{
    QString text = currentText();
    if (text == valueAsString(true))
        return;

    bool ok = false;
    qreal v = text.toDouble(&ok);

    if (!ok)
        v = value();

    setValue( v );
}
开发者ID:aveminus,项目名称:freq,代码行数:15,代码来源:valueslider.cpp


示例19: onExportData

void MainWindow::onExportData()
{
	// 判断有无导出路径;
	auto comboBox_exportPaths = this->findChild<QComboBox *>(tr("comboBox_exportPaths"));
	const auto &exportPath = comboBox_exportPaths->currentText();
	if (exportPath.isEmpty())
	{
		QMessageBox::information(NULL, "information", "Please set export path first!", QMessageBox::Yes, QMessageBox::Yes);
		return;
	}

	DataTree *tree = this->findChild<DataTree *>(tr("treeWidget"));
	tree->exportData(exportPath);

	QMessageBox::information(NULL, "information", "export done", QMessageBox::Yes, QMessageBox::Yes);
}
开发者ID:wgq168668,项目名称:misc,代码行数:16,代码来源:mainwindow.cpp


示例20: switch

const EVP_MD *hashBox::currentHash()
{
	switch(key_type) {
	case EVP_PKEY_DSA:
		return EVP_dss1();
	case EVP_PKEY_EC:
		return EVP_ecdsa();
	default:
		QString hash = currentText();
		for (unsigned i=0; i<ARRAY_SIZE(hashalgos); i++) {
			if (hash == hashalgos[i].name)
				return hashalgos[i].md;
		}
	}
	return hashalgos[1].md; /* SHA1 as fallback */
}
开发者ID:J-Javan,项目名称:xca,代码行数:16,代码来源:hashBox.cpp



注:本文中的currentText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ currentTextChanged函数代码示例发布时间:2022-05-30
下一篇:
C++ currentTab函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap