本文整理汇总了C++中TQListViewItem::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ TQListViewItem::setText方法的具体用法?C++ TQListViewItem::setText怎么用?C++ TQListViewItem::setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TQListViewItem
的用法示例。
在下文中一共展示了TQListViewItem::setText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseXmlCommand
void KXmlCommandAdvancedDlg::parseXmlCommand(KXmlCommand *xmlcmd)
{
m_view->clear();
TQListViewItem *root = new TQListViewItem(m_view, xmlcmd->name(), xmlcmd->name());
DrMain *driver = xmlcmd->driver();
root->setPixmap(0, SmallIcon("fileprint"));
root->setOpen(true);
if (driver)
{
DrMain *clone = driver->cloneDriver();
if (!clone->get("text").isEmpty())
root->setText(0, clone->get("text"));
root->setText(1, "__root__");
clone->setName("__root__");
m_opts["__root__"] = clone;
parseGroupItem(clone, root);
clone->flatten();
}
m_command->setText(xmlcmd->command());
m_inputfile->setText(xmlcmd->io(true, false));
m_inputpipe->setText(xmlcmd->io(true, true));
m_outputfile->setText(xmlcmd->io(false, false));
m_outputpipe->setText(xmlcmd->io(false, true));
m_comment->setText( xmlcmd->comment() );
viewItem(0);
}
示例2: slotChange
void ConfFilters::slotChange()
{
TQListViewItem *item = m_filters->currentItem();
if (item)
{
TQString mime(item->text(0)), cmd(item->text(1));
if (FilterDlg::doIt(this, &mime, &cmd))
{
item->setText(0, mime);
item->setText(1, cmd);
}
}
}
示例3: loadSettings
void KDFConfigWidget::loadSettings( void )
{
TDEConfig &config = *kapp->config();
config.setGroup("KDFConfig");
if( GUI )
{
mStd.updateConfiguration();
mScroll->setValue( mStd.updateFrequency() );
mLCD->display( mStd.updateFrequency() );
mPopupFullCheck->setChecked( mStd.popupIfFull() );
mOpenMountCheck->setChecked( mStd.openFileManager() );
mFileManagerEdit->setText( mStd.fileManager() );
TQListViewItem *item = mList->firstChild();
if( item != 0 )
{
for( int i=mList->header()->count(); i>0; i-- )
{
int j = config.readNumEntry( mTabName[i-1]->mRes, 1 );
item->setText( i-1, j==0 ? i18n("hidden") : i18n("visible") );
item->setPixmap( i-1, j==0 ? UserIcon ( "delete" )
: UserIcon ( "tick" ) );
}
}
}
}
示例4: umntCmdChanged
void MntConfigWidget::umntCmdChanged( const TQString &data )
{
TQListViewItem *item = mList->selectedItem();
for(unsigned i=0 ; i < mDiskList.count() ; ++i)
{
if (mDiskLookup[i] == item)
{
DiskEntry *disk = mDiskList.at(i);
if( disk != 0 )
{
disk->setUmountCommand(data);
item->setText( UMNTCMDCOL, data );
}
break;
}
}
}
示例5: defaultsBtnClicked
void KDFConfigWidget::defaultsBtnClicked( void )
{
mStd.setDefault();
mScroll->setValue( mStd.updateFrequency() );
mLCD->display( mStd.updateFrequency() );
mPopupFullCheck->setChecked( mStd.popupIfFull() );
mOpenMountCheck->setChecked( mStd.openFileManager() );
mFileManagerEdit->setText( mStd.fileManager() );
TQListViewItem *item = mList->firstChild();
if( item != 0 )
{
for( int i=mList->header()->count(); i>0; i-- )
{
item->setText( i-1, i18n("visible") );
item->setPixmap( i-1, UserIcon ( "tick" ) );
}
}
}
示例6: slotApplyChanges
void KXmlCommandAdvancedDlg::slotApplyChanges()
{
TQListViewItem *item = m_view->currentItem();
if (item)
{
if (m_name->text().isEmpty() || m_name->text() == "__root__")
{
KMessageBox::error(this, i18n("Invalid identification name. Empty strings and \"__root__\" are not allowed."));
return;
}
m_apply->setEnabled(false);
DrBase *opt = (m_opts.contains(item->text(1)) ? m_opts[item->text(1)] : 0);
m_opts.remove(item->text(1));
delete opt;
// update tree item
item->setText(0, m_desc->text());
item->setText(1, m_name->text());
// recreate option
if (m_type->isEnabled())
{
int type = m_type->currentItem() + DrBase::String;
switch (type)
{
case DrBase::Integer:
case DrBase::Float:
if (type == DrBase::Integer)
opt = new DrIntegerOption;
else
opt = new DrFloatOption;
opt->set("minval", m_edit1->text());
opt->set("maxval", m_edit2->text());
break;
case DrBase::List:
case DrBase::Boolean:
{
if (type == DrBase::List)
opt = new DrListOption;
else
opt = new DrBooleanOption;
DrListOption *lopt = static_cast<DrListOption*>(opt);
TQListViewItem *item = m_values->firstChild();
while (item)
{
DrBase *choice = new DrBase;
choice->setName(item->text(0));
choice->set("text", item->text(1));
lopt->addChoice(choice);
item = item->nextSibling();
}
break;
}
case DrBase::String:
opt = new DrStringOption;
break;
}
opt->set("format", m_format->text());
opt->set("default", m_default->text());
opt->setValueText(opt->get("default"));
}
else
opt = new DrGroup;
opt->setName((m_name->text().isEmpty() ? generateId(m_opts) : m_name->text()));
opt->set("text", m_desc->text());
opt->set( "persistent", m_persistent->isChecked() ? "1" : "0" );
m_opts[opt->name()] = opt;
}
}
示例7: TQWidget
KDFConfigWidget::KDFConfigWidget(TQWidget *parent, const char *name, bool init)
: TQWidget( parent, name)
{
mTabName.resize(8);
mTabName[0] = new CTabName( "Icon", i18n("Icon") );
mTabName[1] = new CTabName( "Device", i18n("Device") );
mTabName[2] = new CTabName( "Type", i18n("Type") );
mTabName[3] = new CTabName( "Size", i18n("Size") );
mTabName[4] = new CTabName( "MountPoint", i18n("Mount Point") );
mTabName[5] = new CTabName( "Free", i18n("Free") );
// xgettext:no-c-format
mTabName[6] = new CTabName( "Full%", i18n("Full %") );
mTabName[7] = new CTabName( "UsageBar", i18n("Usage") );
GUI = !init;
if(GUI)
{
TQString text;
TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint());
mList = new CListView( this, "list", 1 );
mList->setAllColumnsShowFocus(true);
mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken );
mList->header()->setMovingEnabled(false);
for( uint i=0; i < mTabName.size(); i++ )
{
mList->addColumn( mTabName[i]->mName );
}
connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)),
this, TQT_SLOT(toggleListText(TQListViewItem *,const TQPoint &,int)));
connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)),
this, TQT_SLOT(slotChanged()));
topLayout->addWidget( mList );
TQListViewItem *mListItem = new TQListViewItem( mList );
for( uint i=mList->header()->count(); i>0; i-- )
{
mListItem->setText(i-1, i18n("visible") );
mListItem->setPixmap( i-1, UserIcon ( "tick" ) );
}
mList->setSelected( mListItem, true );
TQGridLayout *gl = new TQGridLayout( 2, 2 );
topLayout->addLayout( gl );
gl->setColStretch( 1, 10 );
mScroll = new TQScrollBar( this );
TQ_CHECK_PTR(mScroll);
mScroll->setOrientation( Qt::Horizontal );
mScroll->setSteps(1,20);
mScroll->setRange(0, 180 );
gl->addWidget( mScroll, 1, 1 );
connect(mScroll,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotChanged()));
mLCD = new TQLCDNumber( this );
TQ_CHECK_PTR(mLCD);
mLCD->setNumDigits( 3 );
mLCD->setSegmentStyle(TQLCDNumber::Filled);
connect(mScroll,TQT_SIGNAL(valueChanged(int)),mLCD,TQT_SLOT(display(int)));
gl->addMultiCellWidget( mLCD, 0, 1, 0, 0 );
text = i18n("Update frequency [seconds]. The value 0 disables update" );
TQLabel *label = new TQLabel( text, this );
TQ_CHECK_PTR(label);
gl->addWidget( label, 0, 1 );
label = new TQLabel( i18n("File manager (e.g. konsole -e mc %m):") ,this);
TQ_CHECK_PTR(label);
topLayout->addWidget( label );
mFileManagerEdit = new TQLineEdit( this );
TQ_CHECK_PTR(mFileManagerEdit);
topLayout->addWidget( mFileManagerEdit );
connect(mFileManagerEdit,TQT_SIGNAL(textChanged (const TQString &)),this,TQT_SLOT(slotChanged()));
text = i18n("Open file manager automatically on mount");
mOpenMountCheck = new TQCheckBox(text, this );
TQ_CHECK_PTR(mOpenMountCheck);
topLayout->addWidget( mOpenMountCheck );
connect(mOpenMountCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged()));
text = i18n("Pop up a window when a disk gets critically full");
mPopupFullCheck = new TQCheckBox( text, this );
TQ_CHECK_PTR(mPopupFullCheck);
topLayout->addWidget( mPopupFullCheck );
connect(mPopupFullCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged()));
}
loadSettings();
if( init )
{
applySettings();
}
}