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

C++ TQString类代码示例

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

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



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

示例1: showAbout

void CpuPlugin::showAbout()
{
  TQString version = kapp->aboutData()->version();

  TDEAboutData aboutData(instanceName(),
     I18N_NOOP("KSim CPU Plugin"), version.latin1(),
     I18N_NOOP("A cpu monitor plugin for KSim"),
     TDEAboutData::License_GPL, "(C) 2001 Robbie Ward");

  aboutData.addAuthor("Robbie Ward", I18N_NOOP("Author"),
     "[email protected]");

  TDEAboutApplication(&aboutData).exec();
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:14,代码来源:ksimcpu.cpp


示例2: strncpy

TQString ArkUtils::getTimeStamp(const TQString &_month,
                            const TQString &_day,
                            const TQString &_yearOrTime)
{
  // Make the date format sortable.
  // Month is in _month, day is in _day.
  // In _yearOrTime is either a year or a time.
  // If it's March, we'll see the year for all dates up to October 1999.
  // (five months' difference - e.g., if it's Apr, then get years up to Nov)

  char month[4];
  strncpy(month, _month.ascii(), 3);
  month[3] = '\0';
  int nMonth = getMonth(month);
  int nDay = _day.toInt();

  kdDebug(1601) << "Month is " << nMonth << ", Day is " << nDay << endl;

  time_t t = time(0);
  if (t == -1)
    exit(1);
  struct tm *now = localtime(&t);
  int thisYear = now->tm_year + 1900;
  int thisMonth = now->tm_mon + 1;

  TQString year, timestamp;

  if (_yearOrTime.contains(":"))
    // it has a timestamp so we have to figure out the year
    {
      year.sprintf("%d", ArkUtils::getYear(nMonth, thisYear, thisMonth));
      timestamp = _yearOrTime;
    }
  else
    {
      year = _yearOrTime;
      if (year.right(1) == " ")
        year = year.left(4);
      if (year.left(1) == " ")
        year = year.right(4);

      timestamp = "??:??";
    }

  TQString retval;
  retval.sprintf("%s-%.2d-%.2d %s",
                 year.utf8().data(), nMonth, nDay,
                 timestamp.utf8().data());
  return retval;
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:50,代码来源:arkutils.cpp


示例3: aboutData

void I8KPlugin::showAbout()
{
  TQString version = kapp->aboutData()->version();

  TDEAboutData aboutData(instanceName(),
     I18N_NOOP("KSim I8K Plugin"), version.latin1(),
     I18N_NOOP("Dell I8K Hardware Monitor plugin"),
     TDEAboutData::License_GPL, "(C) 2003 Nadeem Hasan");

  aboutData.addAuthor("Nadeem Hasan", I18N_NOOP("Author"),
     "[email protected]");

  TDEAboutApplication(&aboutData).exec();
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:14,代码来源:ksimi8k.cpp


示例4: if

KMimeType * KServiceTypeFactory::findFromPattern(const TQString &_filename, TQString *match)
{
   // Assume we're NOT building a database
   if (!m_str) return 0;

   // Get stream to the header
   TQDataStream *str = m_str;

   str->device()->at( m_fastPatternOffset );

   TQ_INT32 nrOfEntries;
   (*str) >> nrOfEntries;
   TQ_INT32 entrySize;
   (*str) >> entrySize;

   TQ_INT32 fastOffset =  str->device()->at( );

   TQ_INT32 matchingOffset = 0;

   // Let's go for a binary search in the "fast" pattern index
   TQ_INT32 left = 0;
   TQ_INT32 right = nrOfEntries - 1;
   TQ_INT32 middle;
   // Extract extension
   int lastDot = _filename.findRev('.');
   int ext_len = _filename.length() - lastDot - 1;
   if (lastDot != -1 && ext_len <= 4) // if no '.', skip the extension lookup
   {
      TQString extension = _filename.right( ext_len );
      extension = extension.leftJustify(4);

      TQString pattern;
      while (left <= right) {
         middle = (left + right) / 2;
         // read pattern at position "middle"
         str->device()->at( middle * entrySize + fastOffset );
         KSycocaEntry::read(*str, pattern);
         int cmp = pattern.compare( extension );
         if (cmp < 0)
            left = middle + 1;
         else if (cmp == 0) // found
         {
            (*str) >> matchingOffset;
            // don't return newServiceType - there may be an "other" pattern that
            // matches best this file, like *.tar.bz
            if (match)
                *match = "*."+pattern.stripWhiteSpace();
            break; // but get out of the fast patterns
         }
         else
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:50,代码来源:kservicetypefactory.cpp


示例5: text

TQString AddresseeItem::key( int column, bool ) const
{
  if (column == Email) {
    TQString value = text(Email);
    TQRegExp emailRe("<\\S*>");
    int match = emailRe.search(value);
    if (match > -1)
      value = value.mid(match + 1, emailRe.matchedLength() - 2);

    return value.lower();
  }

  return text(column).lower();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:14,代码来源:addresseedialog.cpp


示例6: i18n

void IconThemesConfig::installNewTheme()
{
  KURL themeURL = KURLRequesterDlg::getURL(TQString::null, this,
                                           i18n("Drag or Type Theme URL"));
  kdDebug() << themeURL.prettyURL() << endl;

  if (themeURL.url().isEmpty()) return;

  TQString themeTmpFile;
  // themeTmpFile contains the name of the downloaded file

  if (!TDEIO::NetAccess::download(themeURL, themeTmpFile, this)) {
    TQString sorryText;
    if (themeURL.isLocalFile())
       sorryText = i18n("Unable to find the icon theme archive %1.");
    else
       sorryText = i18n("Unable to download the icon theme archive;\n"
                        "please check that address %1 is correct.");
    KMessageBox::sorry(this, sorryText.arg(themeURL.prettyURL()));
    return;
  }

  TQStringList themesNames = findThemeDirs(themeTmpFile);
  if (themesNames.isEmpty()) {
    TQString invalidArch(i18n("The file is not a valid icon theme archive."));
    KMessageBox::error(this, invalidArch);

    TDEIO::NetAccess::removeTempFile(themeTmpFile);
    return;
  }

  if (!installThemes(themesNames, themeTmpFile)) {
    //FIXME: make me able to know what is wrong....
    // TQStringList instead of bool?
    TQString somethingWrong =
        i18n("A problem occurred during the installation process; "
             "however, most of the themes in the archive have been installed");
    KMessageBox::error(this, somethingWrong);
  }

  TDEIO::NetAccess::removeTempFile(themeTmpFile);

  TDEGlobal::instance()->newIconLoader();
  loadThemes();

  TQListViewItem *item=iconThemeItem(TDEIconTheme::current());
  m_iconThemes->setSelected(item, true);
  updateRemoveButton();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:49,代码来源:iconthemes.cpp


示例7: closeURL

bool KPartSaver::openURL( KURL url )
{
    closeURL();

    // find mime type
    TQString mime = KMimeType::findByURL( url )->name();

    // find fitting kparts
    KTrader::OfferList offers;
    offers = KTrader::self()->query( mime, "'KParts/ReadOnlyPart' in ServiceTypes" );
    if( offers.count()==0 ) {
        kdDebug() << "Can't find proper kpart for " << mime << endl;
        return false;
    }

    // load kpart library
    TQString lib = offers.first()->library();
    KLibFactory *factory = KLibLoader::self()->factory( lib.latin1() );
    if( !factory ) {
        kdDebug() << "Library " << lib << " not found." << endl;
        return false;
    }

    // create kpart
    m_part = (KParts::ReadOnlyPart *)factory->create( TQT_TQOBJECT(this), "kpart", "KParts::ReadOnlyPart" );
    if( !m_part ) {
        kdDebug() << "Part for " << url.url() << " can't be constructed" << endl;
        return false;
    } else
        embed( m_part->widget() );

    // show kpart
    delete m_back;
    m_back = 0;

    show();
    m_part->widget()->show();

    // load url
    if( !m_part->openURL( url ) ) {
        kdDebug() << "Can't load " << url.url() << endl;
        closeURL();
        return false;
    }



    return true;
}
开发者ID:Fat-Zer,项目名称:kdeartwork,代码行数:49,代码来源:kpartsaver.cpp


示例8: m_newStartup

AutoStart::AutoStart( bool new_startup )
  : m_newStartup( new_startup ), m_phase( new_startup ? -1 : 0), m_phasedone(false)
{
  m_startList = new AutoStartList;
  m_startList->setAutoDelete(true);
  TDEGlobal::dirs()->addResourceType("autostart", "share/autostart");
  TQString xdgdirs = getenv("XDG_CONFIG_DIRS");
  if (xdgdirs.isEmpty())
        xdgdirs = "/etc/xdg";

  TQStringList xdgdirslist = TQStringList::split( ':', xdgdirs );
  for ( TQStringList::Iterator itr = xdgdirslist.begin(); itr != xdgdirslist.end(); ++itr ) {
	TDEGlobal::dirs()->addResourceDir("autostart", (*itr) +"/autostart");
  }
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:15,代码来源:autostart.cpp


示例9: encodeShort

void KDecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const
{
  unsigned char C;
  if( (C = Char / 100) )
  {
    Digits.at(Pos++) = '0'+C;
    Char -= C * 100;
  }
  if( (C = Char / 10) )
  {
    Digits.at(Pos++) = '0'+C;
    Char -= C * 10;
  }
  Digits.at(Pos) = '0'+Char;
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:15,代码来源:kdecimalbytecodec.cpp


示例10: TQObject

KCheckAccelerators::KCheckAccelerators( TQObject* parent )
    : TQObject( parent, "kapp_accel_filter" ), key(0), block( false ), drklash(0)
{
    parent->installEventFilter( this );
    TDEConfigGroupSaver saver( TDEGlobal::config(), "Development" );
    TQString sKey = TDEGlobal::config()->readEntry( "CheckAccelerators" ).stripWhiteSpace();
    if( !sKey.isEmpty() ) {
      TDEShortcut cuts( sKey );
      if( cuts.count() > 0 )
        key = int(cuts.seq(0).qt());
    }
    alwaysShow = TDEGlobal::config()->readBoolEntry( "AlwaysShowCheckAccelerators", false );
    autoCheck = TDEGlobal::config()->readBoolEntry( "AutoCheckAccelerators", true );
    connect( &autoCheckTimer, TQT_SIGNAL( timeout()), TQT_SLOT( autoCheckSlot()));
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:15,代码来源:kcheckaccelerators.cpp


示例11: it

void ZoneClockPanel::save(TDEConfig *config)
{
  config->writeEntry("Clocks", _clocks.count());

  TQPtrListIterator<ZoneClock> it(_clocks);
  int cnt=0;
  for ( ; it.current(); ++it)
    {
      TQString n = it.current()->name();
      n = n.left(n.length()-1);
      config->writeEntry(TQString("Clock_%1_Name").arg(cnt), n);
      config->writeEntry(TQString("Clock_%1_Zone").arg(cnt), it.current()->zone());
      cnt++;
    }
}
开发者ID:Fat-Zer,项目名称:tdetoys,代码行数:15,代码来源:zoneclock.cpp


示例12: parsePythonRange

TQString KStringHandler::remrange( const TQString &text , const char *range )
{
    // Format in: START:END
    // Note index starts a 0 (zero)
    //
    // 0:        first word to end
    // 1:3        second to fourth words
    TQStringList list = TQStringList::split( " ", text , true );
    TQString tmp = "";
    TQString r = range;

    if ( text.isEmpty() )
        return tmp;

    uint pos = 0, cnt = list.count();
    parsePythonRange( range, pos, cnt );

    //
    // Remove that range of words
    //
    int wordsToDelete = cnt-pos+1;
    TQStringList::Iterator it = list.at( pos);

    while ( (it != list.end()) && (wordsToDelete-- > 0))
       it = list.remove( it );

    return list.join( " " );
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:28,代码来源:kstringhandler.cpp


示例13: klock_config

void kSpaceSaver::readSettings()
{
	KConfig *config = klock_config();
	config->setGroup( "Settings" );

	TQString str;

	str = config->readEntry( "Speed" );
	if ( !str.isNull() )
		speed = MAXSPEED - str.toInt();
	else
		speed = DEFSPEED;

	warpinterval = config->readNumEntry( "WarpInterval", 15 );
	delete config;
}
开发者ID:Fat-Zer,项目名称:kdeartwork,代码行数:16,代码来源:space.cpp


示例14: initScript

TQVariant KJSProxyImpl::evaluate(TQString filename, int baseLine,
                                const TQString&str, const DOM::Node &n, Completion *completion) {
  // evaluate code. Returns the JS return value or an invalid QVariant
  // if there was none, an error occurred or the type couldn't be converted.

  initScript();
  // inlineCode is true for <a href="javascript:doSomething()">
  // and false for <script>doSomething()</script>. Check if it has the
  // expected value in all cases.
  // See smart window.open policy for where this is used.
  bool inlineCode = filename.isNull();
  //kdDebug(6070) << "KJSProxyImpl::evaluate inlineCode=" << inlineCode << endl;

#ifdef KJS_DEBUGGER
  if (inlineCode)
    filename = "(unknown file)";
  if (KJSDebugWin::debugWindow()) {
    KJSDebugWin::debugWindow()->attach(m_script);
    KJSDebugWin::debugWindow()->setNextSourceInfo(filename,baseLine);
  //    KJSDebugWin::debugWindow()->setMode(KJSDebugWin::Step);
  }
#else
  Q_UNUSED(baseLine);
#endif

  m_script->setInlineCode(inlineCode);
  Window* window = Window::retrieveWindow( m_frame->m_part );
  KJS::Value thisNode = n.isNull() ? Window::retrieve( m_frame->m_part ) : getDOMNode(m_script->globalExec(),n);

  UString code( str );

  KJSCPUGuard guard;
  guard.start();
  Completion comp = m_script->evaluate(code, thisNode);
  guard.stop();

  bool success = ( comp.complType() == Normal ) || ( comp.complType() == ReturnValue );

  if (completion)
    *completion = comp;

#ifdef KJS_DEBUGGER
    //    KJSDebugWin::debugWindow()->setCode(TQString::null);
#endif

  window->afterScriptExecution();

  // let's try to convert the return value
  if (success && comp.value().isValid())
    return ValueToVariant( m_script->globalExec(), comp.value());
  else
  {
    if ( comp.complType() == Throw )
    {
        UString msg = comp.value().toString(m_script->globalExec());
        kdDebug(6070) << "WARNING: Script threw exception: " << msg.qstring() << endl;
    }
    return TQVariant();
  }
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:60,代码来源:kjs_proxy.cpp


示例15: writeIfNotEmpty

void HostConfig::writeIfNotEmpty( TDEConfigBase &config, const TQString &name, const TQString &value )
{
    if ( value.isEmpty() )
        return;

    config.writeEntry( name, value );
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:7,代码来源:hostconfig.cpp


示例16: addCompletionItem

void AddresseeDialog::addCompletionItem( const TQString &str, TQListViewItem *item )
{
  if ( str.isEmpty() ) return;

  mItemDict.insert( str, item );
  mAddresseeEdit->completionObject()->addItem( str );
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:7,代码来源:addresseedialog.cpp


示例17: showColor

// show but don't set into selColor, nor emit colorSelected
void KColorDialog::showColor( const KColor &color, const TQString &name )
{
  d->bRecursion = true;

  if (name.isEmpty())
     d->colorName->setText( i18n("-unnamed-"));
  else
     d->colorName->setText( name );

  d->patch->setColor( color );

  setRgbEdit( color );
  setHsvEdit( color );
  setHtmlEdit( color );

  int h, s, v;
  color.hsv( &h, &s, &v );
  d->hsSelector->setValues( h, s );
  d->valuePal->blockSignals(true);
  d->valuePal->setHue( h );
  d->valuePal->setSaturation( s );
  d->valuePal->setValue( v );
  d->valuePal->updateContents();
  d->valuePal->blockSignals(false);
  d->valuePal->repaint( false );
  d->bRecursion = false;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:28,代码来源:kcolordialog.cpp


示例18: cacheAddHost

bool KSSLD::cacheAddHost(KSSLCertificate cert, TQString host) {
KSSLCNode *node;

	if (host.isEmpty())
		return true;

	for (node = certList.first(); node; node = certList.next()) {
		if (cert == *(node->cert)) {
			if (!node->permanent && node->expires <
				       	TQDateTime::currentDateTime()) {
				certList.remove(node);
				cfg->deleteGroup(node->cert->getMD5Digest());
				searchRemoveCert(node->cert);
				delete node;
				cacheSaveToDisk();
				return false;
			}

			if (!node->hosts.contains(host)) {
				node->hosts << host;
			}

			certList.remove(node);
			certList.prepend(node);
			cacheSaveToDisk();
			return true;
		}
	}

return false;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:31,代码来源:kssld.cpp


示例19: updatetxt

void KgpgView::updatetxt(TQString newtxt)
{
        if (!newtxt.isEmpty())
                editor->setText(newtxt);
        else
                KMessageBox::sorry(this,i18n("Encryption failed."));
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:7,代码来源:kgpgview.cpp


示例20: setUserTitle

void TESession::setUserTitle( int what, const TQString &caption )
{
    // (btw: what=0 changes title and icon, what=1 only icon, what=2 only title
    if ((what == 0) || (what == 2))
       userTitle = caption;
    if ((what == 0) || (what == 1))
       iconText = caption;
    if (what == 11) {
      TQString colorString = caption.section(';',0,0);
      TQColor backColor = TQColor(colorString);
      if (backColor.isValid()){// change color via \033]11;Color\007
	if (backColor != modifiedBackground) {
	    modifiedBackground = backColor;
	    te->setDefaultBackColor(backColor);
	}
      }
    }
    if (what == 30)
       renameSession(caption);
    if (what == 31) {
       cwd=caption;
       cwd=cwd.replace( TQRegExp("^~"), TQDir::homeDirPath() );
       emit openURLRequest(cwd);
    }    
    if (what == 32) { // change icon via \033]32;Icon\007
       iconName = caption;
       te->update();
    }

    emit updateTitle(this);
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:31,代码来源:session.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TQStringList类代码示例发布时间:2022-05-31
下一篇:
C++ TQListViewItem类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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