本文整理汇总了C++中TQString函数的典型用法代码示例。如果您正苦于以下问题:C++ TQString函数的具体用法?C++ TQString怎么用?C++ TQString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TQString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TQString
TQString EvaChatView::wrapFontAttributes(TQColor color, TQ_UINT8 size,
bool underline, bool italic, bool bold,
TQString contents)
{
TQString fontHead = "<span style=\"";
TQString fontSize = "font-size: "+TQString::number((size<=MIN_FONT_SIZE)?MIN_FONT_SIZE:((size>MAX_FONT_SIZE)?MAX_FONT_SIZE:size))+"pt; ";
TQString fontColor = TQString("color: ") + color.name() + TQString("\" >");
TQString fontStye = "", fontStyeEnd="";
if(bold) {
fontStye+="<b>";
fontStyeEnd+="</b>";
}
if(italic) {
fontStye+="<i>";
fontStyeEnd="</i>" + fontStyeEnd;
}
if(underline) {
fontStye+="<u>";
fontStyeEnd="</u>" + fontStyeEnd;
}
TQString fontEnd = "</span>";
TQString ret = fontHead + fontSize + fontColor + fontStye + contents + fontStyeEnd + fontEnd;
return ret;
}
示例2: TQString
void SaverConfig::add()
{
KURL::List files = KFileDialog::getOpenURLs( TQString(), TQString(),
this, i18n("Select Media Files") );
for( unsigned int n=0; n<files.count(); n++ )
m_files->insertItem( files[n].prettyURL(), -1 );
}
示例3: getQunWindow
void EvaChatWindowManager::slotQunJoinEvent(const unsigned int qunID,
const short imType,
const unsigned int sender,
const unsigned int commander)
{
EvaQunChatWindow *win = getQunWindow(qunID);
if(win ) {
TQString info;
switch(imType){
case TQQ_RECV_IM_APPROVE_JOIN_QUN:
info = TQString(i18n("%1 has joined this Qun approved by %2."))
.arg(sender).arg(commander);
break;
case TQQ_RECV_IM_ADDED_TO_QUN:
info = TQString(i18n("%1 has joined this Qun added by %2."))
.arg(sender).arg(commander);
break;
case TQQ_RECV_IM_DELETED_FROM_QUN:
info = TQString(i18n("%1 has quit this Qun.")
.arg(sender));
break;
default:
info = TQString(i18n("%1 has done some unknown action on %2."))
.arg(commander).arg(sender);
}
win->slotAddInformation(info);
}
}
示例4: kdDebug
void KfindWindow::beginSearch(const KURL& baseUrl)
{
kdDebug()<<TQString(TQString("beginSearch in: %1").arg(baseUrl.path()))<<endl;
m_baseDir=baseUrl.path(+1);
haveSelection = false;
clear();
}
示例5: data
/*!
Restores legacy session management data (i.e. restart applications)
*/
void KSMServer::restoreLegacySession( TDEConfig* config )
{
if( config->hasGroup( "Legacy" + sessionGroup )) {
TDEConfigGroupSaver saver( config, "Legacy" + sessionGroup );
restoreLegacySessionInternal( config );
} else if( wm == "twin" ) { // backwards comp. - get it from twinrc
TDEConfigGroupSaver saver( config, sessionGroup );
int count = config->readNumEntry( "count", 0 );
for ( int i = 1; i <= count; i++ ) {
TQString n = TQString::number(i);
if ( config->readEntry( TQString("program")+n ) != wm )
continue;
TQStringList restartCommand =
config->readListEntry( TQString("restartCommand")+n );
for( TQStringList::ConstIterator it = restartCommand.begin();
it != restartCommand.end();
++it ) {
if( (*it) == "-session" ) {
++it;
if( it != restartCommand.end()) {
TDEConfig cfg( "session/" + wm + "_" + (*it), true );
cfg.setGroup( "LegacySession" );
restoreLegacySessionInternal( &cfg, ' ' );
}
}
}
}
}
}
示例6: prefix
bool ObjKsTheme::loadThemeRc( const TQString& activeTheme, bool force )
{
//kdDebug() << "ObjKsTheme::loadThemeRc: " << activeTheme << endl;
TQString prefix("Themes/");
TQString themeFile;
TDEConfig *cf = 0L;
// Try our best to find a theme file.
themeFile = locate( "appdata", prefix + activeTheme + "/" + TQString("Theme.rc") );
themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+TQString("Theme.RC")):themeFile;
themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+TQString("theme.rc")):themeFile;
themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+activeTheme+TQString(".rc")):themeFile;
if( !themeFile.isEmpty() )
cf = new TDEConfig( themeFile );
if( cf )
{
mActiveTheme = activeTheme;
mThemeDir = prefix + activeTheme+"/";
if( loadTDEConfig( cf, activeTheme, force ) )
{
mThemeConfig = cf;
return true;
}
else
delete cf;
}
return false;
}
示例7: getLastShellOutput
void TarArch::slotListingDone(TDEProcess *_kp)
{
const TQString list = getLastShellOutput();
FileListView *flv = m_gui->fileList();
if (flv!=NULL && flv->totalFiles()>0)
{
const TQString firstfile = ((FileLVI *) flv->firstChild())->fileName();
if (list.find(TQRegExp(TQString("\\s\\./%1[/\\n]").arg(firstfile)))>=0)
{
m_dotslash = true;
kdDebug(1601) << k_funcinfo << "archive has dot-slash" << endl;
}
else
{
if (list.find(TQRegExp(TQString("\\s%1[/\\n]").arg(firstfile)))>=0)
{
// archive doesn't have dot-slash
m_dotslash = false;
}
else
{
kdDebug(1601) << k_funcinfo << "cannot match '" << firstfile << "' in listing!" << endl;
}
}
}
delete _kp;
_kp = m_currentProcess = NULL;
}
示例8: either
/**
Preconditions:
+ button is an array of length MAX_NUM_BUTTONS
Postconditions:
+ Title bar and buttons have been initialized and laid out
+ for all i in 0..(MAX_NUM_BUTTONS-1), button[i] points to
either (1) a valid NextButton instance, if the corresponding
button is selected in the current button scheme, or (2) null
otherwise.
*/
void NextClient::initializeButtonsAndTitlebar(TQBoxLayout* titleLayout)
{
// Null the buttons to begin with (they are not guaranteed to be null).
for (int i=0; i<MAX_NUM_BUTTONS; i++) {
button[i] = NULL;
}
// The default button positions for other styles do not match the
// behavior of older versions of KStep, so we have to set these
// manually when customButtonPositions isn't enabled.
TQString left, right;
if (options()->customButtonPositions()) {
left = options()->titleButtonsLeft();
right = options()->titleButtonsRight();
} else {
left = TQString("I");
right = TQString("SX");
}
// Do actual creation and addition to titleLayout
addButtons(titleLayout, left);
titlebar = new TQSpacerItem(10, titleHeight, TQSizePolicy::Expanding,
TQSizePolicy::Minimum );
titleLayout->addItem(titlebar);
addButtons(titleLayout, right);
// Finally, activate all live buttons
for ( int i = 0; i < MAX_NUM_BUTTONS; i++) {
if (button[i]) {
button[i]->setMouseTracking( TRUE );
}
}
}
示例9: f
void KgpgApp::slotFileSaveAs()
{
//KURL url=KFileDialog::getSaveURL(TQDir::currentDirPath(),i18n("*|All Files"), this, i18n("Save As"));
KEncodingFileDialog::Result saveResult;
saveResult=KEncodingFileDialog::getSaveURLAndEncoding (TQString(),TQString(),TQString(),this);
KURL url=saveResult.URLs.first();
TQString selectedEncoding=saveResult.encoding;
if(!url.isEmpty()) {
if (url.isLocalFile())
{
TQString filn=url.path();
TQFile f(filn);
if (f.exists()) {
TQString message=i18n("Overwrite existing file %1?").arg(url.fileName());
int result=KMessageBox::warningContinueCancel(this,TQString(message),i18n("Warning"),i18n("Overwrite"));
if (result==KMessageBox::Cancel)
return;
}
f.close();
}
else if (TDEIO::NetAccess::exists(url,false,this))
{
TQString message=i18n("Overwrite existing file %1?").arg(url.fileName());
int result=KMessageBox::warningContinueCancel(this,TQString(message),i18n("Warning"),i18n("Overwrite"));
if (result==KMessageBox::Cancel)
return;
}
Docname=url;
textEncoding=selectedEncoding;
slotFileSave();
}
}
示例10: inherited
TDMConfShutdown::TDMConfShutdown( int _uid, dpySpec *sess, int type, const char *os,
TQWidget *_parent )
: inherited( _uid, _parent )
{
#ifdef HAVE_VTS
if (type == SHUT_CONSOLE)
willShut = false;
#endif
box->addWidget( new TQLabel( TQString( "<qt><center><b><nobr>"
"%1%2"
"</nobr></b></center><br></qt>" )
.arg( (type == SHUT_HALT) ?
i18n("Turn Off Computer") :
#ifdef HAVE_VTS
(type == SHUT_CONSOLE) ?
i18n("Switch to Console") :
#endif
i18n("Restart Computer") )
.arg( os ?
i18n("<br>(Next boot: %1)")
.arg( TQString::fromLocal8Bit( os ) ) :
TQString() ),
this ) );
if (sess) {
if (willShut && _scheduledSd != SHUT_NEVER)
maySched = true;
mayNuke = doesNuke = true;
if (_allowNuke == SHUT_NONE)
mayOk = false;
TQLabel *lab = new TQLabel( mayOk ?
i18n("Abort active sessions:") :
i18n("No permission to abort active sessions:"),
this );
box->addWidget( lab );
TQListView *lv = new TQListView( this );
lv->setSelectionMode( TQListView::NoSelection );
lv->setAllColumnsShowFocus( true );
lv->header()->setResizeEnabled( false );
lv->addColumn( i18n("Session") );
lv->addColumn( i18n("Location") );
TQListViewItem *itm;
int ns = 0;
TQString user, loc;
do {
decodeSess( sess, user, loc );
itm = new TQListViewItem( lv, user, loc );
sess = sess->next, ns++;
} while (sess);
int fw = lv->frameWidth() * 2;
lv->setFixedHeight( fw + lv->header()->height() +
itm->height() * (ns < 3 ? 3 : ns > 10 ? 10 : ns) );
box->addWidget( lv );
complete( lv );
} else
complete( 0 );
}
示例11: i18n
void KgpgApp::slotFilePreDec()
{
KURL url=KFileDialog::getOpenURL(TQString(),
i18n("*|All Files"), this, i18n("Open File to Decode"));
if (url.isEmpty())
return;
TQString oldname=url.fileName();
TQString newname;
if (oldname.endsWith(".gpg") || oldname.endsWith(".asc") || oldname.endsWith(".pgp"))
oldname.truncate(oldname.length()-4);
else
oldname.append(".clear");
oldname.prepend(url.directory(0,0));
KDialogBase *popn=new KDialogBase( KDialogBase::Swallow, i18n("Decrypt File To"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, this, "file_decrypt",true);
SrcSelect *page=new SrcSelect();
popn->setMainWidget(page);
page->newFilename->setURL(oldname);
page->newFilename->setMode(KFile::File);
page->newFilename->setCaption(i18n("Save File"));
page->checkClipboard->setText(i18n("Editor"));
page->resize(page->minimumSize());
popn->resize(popn->minimumSize());
if (popn->exec()==TQDialog::Accepted) {
if (page->checkFile->isChecked())
newname=page->newFilename->url();
} else {
delete popn;
return;
}
delete popn;
if (!newname.isEmpty()) {
TQFile fgpg(newname);
if (fgpg.exists()) {
TDEIO::RenameDlg *over=new TDEIO::RenameDlg(0,i18n("File Already Exists"),TQString(),newname,TDEIO::M_OVERWRITE);
if (over->exec()==TQDialog::Rejected)
{
delete over;
return;
}
newname=over->newDestURL().path();
delete over;
}
KgpgLibrary *lib=new KgpgLibrary(this);
lib->slotFileDec(url,KURL(newname), customDecrypt);
connect(lib,TQT_SIGNAL(importOver(TQStringList)),this,TQT_SIGNAL(refreshImported(TQStringList)));
} else
openEncryptedDocumentFile(url);
}
示例12: TQString
TQString KMountPoint::devNameFromOptions(const TQStringList &options)
{
// Search options to find the device name
for ( TQStringList::ConstIterator it = options.begin(); it != options.end(); ++it)
{
if( (*it).startsWith("dev="))
return TQString(*it).remove("dev=");
}
return TQString("none");
}
示例13: kdDebug
void KJavaApplet::resizeAppletWidget( int width, int height )
{
kdDebug(6100) << "KJavaApplet, id = " << id << ", ::resizeAppletWidget to " << width << ", " << height << endl;
TQStringList sl;
sl.push_back( TQString::number( 0 ) ); // applet itself has id 0
sl.push_back( TQString( "eval" ) ); // evaluate next script
sl.push_back( TQString::number( KParts::LiveConnectExtension::TypeString ) );
sl.push_back( TQString( "this.setAttribute('WIDTH',%1);this.setAttribute('HEIGHT',%2)" ).arg( width ).arg( height ) );
jsData( sl );
}
示例14: setCaption
void KgpgApp::slotFileNew()
{
////// delete all text from editor
view->editor->setText(TQString());
editRedo->setEnabled(false);
editUndo->setEnabled(false);
setCaption(i18n("Untitled"), false);
fileSave->setEnabled(false);
Docname=TQString();
slotResetEncoding(false);
}
示例15: switch
TQString KfFileLVI::key(int column, bool) const
{
switch (column) {
case 2:
// Returns size in bytes. Used for sorting
return TQString().sprintf("%010d", fileInfo->size());
case 3:
// Returns time in secs from 1/1/1970. Used for sorting
return TQString().sprintf("%010ld", fileitem.time(TDEIO::UDS_MODIFICATION_TIME));
}
return text(column);
}