本文整理汇总了C++中TQListViewItem类的典型用法代码示例。如果您正苦于以下问题:C++ TQListViewItem类的具体用法?C++ TQListViewItem怎么用?C++ TQListViewItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TQListViewItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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" ) );
}
}
}
}
示例2: recreateGroup
void KXmlCommandAdvancedDlg::recreateGroup(TQListViewItem *item, DrGroup *grp)
{
if (!item)
return;
TQListViewItem *child = item->firstChild();
while (child)
{
DrBase *opt = (m_opts.contains(child->text(1)) ? m_opts[child->text(1)] : 0);
if (opt)
{
if (opt->type() == DrBase::Group)
{
DrGroup *childGroup = static_cast<DrGroup*>(opt);
recreateGroup(child, childGroup);
grp->addGroup(childGroup);
}
else
{
opt->setName("_kde-"+m_xmlcmd->name()+"-"+opt->name());
grp->addOption(opt);
}
m_opts.remove(child->text(1));
}
child = child->nextSibling();
}
}
示例3: GetInfo_Sound
bool GetInfo_Sound (TQListView *lbox)
{
lbox->setSorting(false);
if (!GetDmesgInfo(lbox, "audio", NULL))
new TQListViewItem(lbox, i18n("No audio devices found."));
// append information for each audio devices found
TQListViewItem *lvitem = lbox->firstChild();
for(; lvitem; lvitem = lvitem->nextSibling()) {
TQString s;
int pos, len;
const char *start;
char *dev;
s = lvitem->text(0);
// The autoconf message is in form 'audio0 at auvia0: ...'
if (s.find("audio") == 0 && (pos = s.find(" at ")) > 0) {
pos += 4; // skip " at "
start = s.ascii() + pos;
len = (int) strcspn(start, ":\n\t ");
dev = (char *) malloc(1 + len + 1);
sprintf(dev, "^%.*s", len, start); /* safe */
GetDmesgInfo(lbox, dev, NULL);
free(dev);
}
}
return true;
}
示例4: i18n
void MntConfigWidget::iconChanged(const TQString &iconName)
{
if( iconName.findRev('_') == 0 ||
(iconName.right(iconName.length()-iconName.findRev('_'))!="_mount" &&
iconName.right(iconName.length()-iconName.findRev('_'))!="_unmount"))
{
TQString msg = i18n(""
"This filename is not valid: %1\n"
"It must end with "
"\"_mount\" or \"_unmount\".").arg(iconName);
KMessageBox::sorry( this, msg );
return;
}
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->setIconName(iconName);
mIconLineEdit->setText(iconName);
TDEIconLoader &loader = *TDEGlobal::iconLoader();
item->setPixmap( ICONCOL, loader.loadIcon( iconName, TDEIcon::Small));
}
break;
}
}
}
示例5: TQString
// add a group
void CustomSmileyManager::slotAddGroupClicked( )
{
TQString name = TQString(i18n("Group%1")).arg(m_Config->numGroups());
TQString path = EvaMain::user->getSetting()->getCustomSmileyDir() + "/";
TQDir dir(path + name);
if(!dir.exists()){ // if the dest dir doesn't exist,
if(dir.mkdir( path + name )) // create the dir
m_IsChanged = true;
else{ // create failed
KMessageBox::error( this, i18n( "Cannot create the directory \"%1\". " ).arg( dir.path() ), i18n( "Add Group" ) );
return;
}
} else { // the directory exists, the group name should be used already
KMessageBox::error( this, i18n( "A directory named \"%1\" already exists. " ).arg( dir.path() ), i18n( "Directory Exists!" ) );
return;
}
TQListViewItem *item = new TQListViewItem(lvGroups, lvGroups->lastItem(), name);
m_Config->addGroup( name );
m_IsChanged = true;
m_Config->saveXML();
lvGroups->setSelected( item, true);
d->m_Action = GroupActionPrivate::GEdit;
d->m_Item = item;
d->m_OldName = name;
item->setRenameEnabled( 0, true);
item->startRename( 0 );
}
示例6: updatePrinter
void KMWLocal::updatePrinter(KMPrinter *printer)
{
TQListViewItem *item = m_ports->selectedItem();
if ( item && item->depth() == 3 )
printer->setOption( "kde-autodetect", item->text( 0 ) );
printer->setDevice(m_localuri->text());
}
示例7: save
void IconThemesConfig::save()
{
if (!m_bChanged)
return;
TQListViewItem *selected = m_iconThemes->selectedItem();
if (!selected)
return;
KSimpleConfig *config = new KSimpleConfig("kdeglobals", false);
config->setGroup("Icons");
config->writeEntry("Theme", m_themeNames[selected->text(0)]);
delete config;
TDEIconTheme::reconfigure();
emit changed(false);
for (int i=0; i<TDEIcon::LastGroup; i++)
{
KIPC::sendMessageAll(KIPC::IconChanged, i);
}
KService::rebuildKSycoca(this);
m_bChanged = false;
m_removeButton->setEnabled(false);
}
示例8: TQListViewItem
void KXmlCommandDlg::slotAddReq()
{
TQListViewItem *item = new TQListViewItem(m_requirements, m_requirements->lastItem(), i18n("exec:/"));
item->setRenameEnabled(0, true);
m_requirements->ensureItemVisible(item);
item->startRename(0);
}
示例9: slotSelected
void KMConfigFonts::slotSelected()
{
TQListViewItem *item = m_fontpath->selectedItem();
m_remove->setEnabled(item);
m_up->setEnabled(item && item->itemAbove());
m_down->setEnabled(item && item->itemBelow());
}
示例10: applySettings
void KDFConfigWidget::applySettings( void )
{
TDEConfig &config = *kapp->config();
config.setGroup("KDFConfig");
if( GUI )
{
//config.writeEntry( "Width", width() );
//config.writeEntry( "Height", height() );
mStd.setFileManager( mFileManagerEdit->text() );
mStd.setUpdateFrequency( mScroll->value() );
mStd.setPopupIfFull( mPopupFullCheck->isChecked() );
mStd.setOpenFileManager( mOpenMountCheck->isChecked() );
mStd.writeConfiguration();
TQListViewItem *item = mList->firstChild();
if( item != 0 )
{
for( int i=mList->header()->count(); i>0; i-- )
{
bool state = item->text(i-1) == i18n("visible") ? true : false;
config.writeEntry( mTabName[i-1]->mRes, state );
}
}
}
else
{
mStd.writeDefaultFileManager();
}
config.sync();
}
示例11: slotFaceValueChanged
void CustomSmileyManager::slotFaceValueChanged( int row, int col )
{
if(!m_Config) return;
TQListViewItem *item = lvGroups->selectedItem();
if(item){
int gId = m_Config->groupIndex( item->text( 0 ) );
if(gId < 0) return;
TQString text = tblFaceList->text(row, col);
switch(col){
case 1: // tip
m_Config->updateFaceTip(gId, row, tblFaceList->text(row, col));
m_Config->saveXML();
m_IsChanged = true;
break;
case 2: // shortcut
m_Config->updateFaceShortcut(gId, row, tblFaceList->text(row, col));
m_Config->saveXML();
m_IsChanged = true;
break;
default: // anything else, ignore
break;
}
}
}
示例12:
TQListViewItem *IconThemesConfig::iconThemeItem(const TQString &name)
{
TQListViewItem *item;
for ( item=m_iconThemes->firstChild(); item ; item=item->nextSibling() )
if (m_themeNames[item->text(0)]==name) return item;
return 0L;
}
示例13: 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 );
}
示例14: TQListViewItem
void KMConfigFonts::slotDown()
{
TQListViewItem *citem = m_fontpath->selectedItem(), *nitem = 0;
if (!citem || !citem->itemBelow())
return;
nitem = new TQListViewItem(m_fontpath, citem->itemBelow(), citem->text(0));
delete citem;
m_fontpath->setSelected(nitem, true);
}
示例15: slotDown
void ConfFilters::slotDown()
{
TQListViewItem *item = m_filters->currentItem();
if (item && item->itemBelow())
{
m_filters->moveItem(item, 0, item->itemBelow());
m_filters->setCurrentItem(item);
updateButton();
}
}