本文整理汇总了C++中QCheckListItem类的典型用法代码示例。如果您正苦于以下问题:C++ QCheckListItem类的具体用法?C++ QCheckListItem怎么用?C++ QCheckListItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QCheckListItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: it
//
// Get selected channels from channel list view and set them
// to the slider's channel list. Used for both level & submaster modes.
//
void VCDockSliderProperties::extractChannels()
{
QCheckListItem* item = NULL;
t_channel ch = 0;
//
// Clear channel list
//
m_slider->channels()->clear();
//
// Then, add the new submaster channels
//
QListViewItemIterator it(m_channelList);
while (it.current())
{
item = static_cast<QCheckListItem*> (it.current());
ch = static_cast<t_channel>
(item->text(KColumnDMXChannel).toInt() - 1);
if (item->isOn() &&
m_slider->channels()->find(ch) == m_slider->channels()->end())
{
m_slider->channels()->append(ch);
}
++it;
}
}
示例2: editDynamicPlaylist
void editDynamicPlaylist( QWidget* parent, DynamicMode* mode )
{
DEBUG_BLOCK
KDialogBase* dialog = basicDialog( parent );
NewDynamic* nd = static_cast<NewDynamic*>(dialog->mainWidget());
nd->m_name->setText( mode->title() );
nd->m_cycleTracks->setChecked( mode->cycleTracks() );
nd->m_markHistory->setChecked( mode->markHistory() );
nd->m_upcomingIntSpinBox->setValue( mode->upcomingCount() );
nd->m_previousIntSpinBox->setValue( mode->previousCount() );
nd->m_appendCountIntSpinBox->setValue( mode->appendCount() );
if( mode->appendType() == DynamicMode::CUSTOM )
{
//check items in the custom playlist
nd->m_mixLabel->setText( i18n("Edit Dynamic Playlist") );
QStringList items = mode->items();
foreach( items )
{
QCheckListItem* current = static_cast<QCheckListItem*>( nd->selectPlaylist->findItem((*it),0) );
if( current )
current->setOn(true);
}
}
示例3: it
void ResourceKABCConfig::loadSettings(KRES::Resource *resource)
{
ResourceKABC *res = static_cast<ResourceKABC *>(resource);
if(res)
{
mAlarm->setChecked(res->alarm());
QString days;
mAlarmTimeEdit->setText(days.setNum(res->alarmDays()));
mAlarmTimeEdit->setEnabled(res->alarm());
mALabel->setEnabled(res->alarm());
const QStringList categories = res->categories();
QListViewItemIterator it(mCategoryView);
while(it.current())
{
if(categories.contains(it.current()->text(0)))
{
QCheckListItem *item = static_cast<QCheckListItem *>(it.current());
item->setOn(true);
}
++it;
}
mUseCategories->setChecked(res->useCategories());
}
else
{
kdDebug(5700) << "ERROR: ResourceKABCConfig::loadSettings(): no ResourceKABC, cast failed" << endl;
}
}
示例4: killAllJobs
void KMail::ManageSieveScriptsDialog::slotRefresh()
{
killAllJobs();
mUrls.clear();
mListView->clear();
KMail::AccountManager *am = kmkernel->acctMgr();
assert(am);
QCheckListItem *last = 0;
for(KMAccount *a = am->first() ; a ; a = am->next())
{
last = new QCheckListItem(mListView, last, a->name(), QCheckListItem::Controller);
last->setPixmap(0, SmallIcon("server"));
if(ImapAccountBase *iab = dynamic_cast<ImapAccountBase *>(a))
{
const KURL u = ::findUrlForAccount(iab);
if(u.isEmpty())
continue;
SieveJob *job = SieveJob::list(u);
connect(job, SIGNAL(item(KMail::SieveJob *, const QString &, bool)),
this, SLOT(slotItem(KMail::SieveJob *, const QString &, bool)));
connect(job, SIGNAL(result(KMail::SieveJob *, bool, const QString &, bool)),
this, SLOT(slotResult(KMail::SieveJob *, bool, const QString &, bool)));
mJobs.insert(job, last);
mUrls.insert(last, u);
}
else
{
QListViewItem *item = new QListViewItem(last, i18n("No Sieve URL configured"));
item->setEnabled(false);
last->setOpen(true);
}
}
示例5: QCheckListItem
void MainWindow::loadPackageList( OPackageList *packages, bool clearList )
{
if ( clearList )
m_packageList.clear();
if ( packages )
{
for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(),
QCheckListItem::CheckBox );
m_packageList.insertItem( item );
// If a different version of package is available, show update available icon
// Otherwise, show installed icon
if ( !package->versionInstalled().isNull() )
{
if ( m_packman.compareVersions( package->version(), package->versionInstalled() ) == 1 )
item->setPixmap( 0, m_iconUpdated );
else
item->setPixmap( 0, m_iconInstalled );
}
else
item->setPixmap( 0, m_iconNull );
}
}
}
示例6: isStudyLanguageSelectionValid
bool PreferencesDialog::isStudyLanguageSelectionValid() const {
int checkedLangCount = 0;
for( QCheckListItem* item = (QCheckListItem*)studyLanguagesListView->firstChild(); item; item = (QCheckListItem*)item->nextSibling() ) {
if( item->isOn() )
checkedLangCount++;
}
return( checkedLangCount >= 2 );
}
示例7: checked
QStringList CheckedListView::checked() const
{
QStringList strs;
for ( QCheckListItem *i = (QCheckListItem *) firstChild();
i; i = (QCheckListItem *)i->nextSibling() )
if ( i->isOn() )
strs += i->text( 0 );
return strs;
}
示例8: QCheckListItem
//
// Initialize the channel list view for level & submaster modes
//
void VCDockSliderProperties::fillChannelList()
{
QString s;
t_channel ch;
t_channel channels;
QCheckListItem* item = NULL;
//
// Fill the list view with available channels. Put only
// those channels that are occupied by existing devices.
//
for (t_device_id i = 0; i < KDeviceArraySize; i++)
{
Device* d = _app->doc()->device(i);
if (!d)
{
continue;
}
else
{
channels = (t_channel) d->deviceClass()->channels()->count();
for (ch = 0; ch < channels; ch++)
{
// DMX Channel
s.sprintf("%.3d", d->address() + ch + 1);
item = new QCheckListItem(m_channelList, s,
QCheckListItem::CheckBox);
// Device name
item->setText(KColumnDevice, d->name());
// Device channel
s.sprintf("%.3d:" +
d->deviceClass()->channels()->at(ch)->name(), ch + 1);
item->setText(KColumnDeviceChannel, s);
}
}
}
//
// Check those channels that are found from slider's channel list
//
QValueList <t_channel>::iterator it;
for (it = m_slider->channels()->begin();
it != m_slider->channels()->end(); ++it)
{
s.sprintf("%.3d", (*it) + 1);
item = static_cast<QCheckListItem*> (m_channelList
->findItem(s, KColumnDMXChannel));
if (item)
{
item->setOn(true);
}
}
}
示例9: invertSelect
void SensorsConfig::invertSelect()
{
for (QListViewItemIterator it(m_sensorView); it.current(); ++it) {
QCheckListItem *item = static_cast<QCheckListItem *>(it.current());
if (item->isOn())
item->setOn(false);
else
item->setOn(true);
}
}
示例10: QCheckListItem
void OListEditForm::addCheckItem( bool isActive, const QString &str )
{
QCheckListItem *item = NULL;
QListViewItem *lastItem = m_listView->lastItem();
if( lastItem )
item = new QCheckListItem( m_listView, lastItem, str, QCheckListItem::CheckBox );
else
item = new QCheckListItem( m_listView, str, QCheckListItem::CheckBox );
if( item )
item->setOn( isActive );
}
示例11: KDialogBase
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
: KDialogBase( parent, "Linker Options Dialog", true, "Linker Options", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
{
m_pLinkerOptions = linkingOptions;
m_pWidget = new LinkerOptionsWidget(this);
ProjectInfo * pi = ProjectManager::self()->currentProject();
assert(pi);
//BEGIN Update gplink options
m_pWidget->m_pHexFormat->setCurrentItem( m_pLinkerOptions->hexFormat() );
m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
//END Update gplink options
//BEGIN Update library widgets
const KURL::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
KURL::List::const_iterator end = availableInternal.end();
for ( KURL::List::const_iterator it = availableInternal.begin(); it != end; ++it )
{
QString relativeURL = KURL::relativeURL( pi->url(), *it );
QCheckListItem * item = new QCheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, QCheckListItem::CheckBox );
item->setOn( linkedInternal.contains(relativeURL) );
}
m_pExternalLibraryRequester = new KURLRequester( 0l );
m_pExternalLibraryRequester->fileDialog()->setURL( "/usr/share/sdcc/lib" );
delete m_pWidget->m_pExternalLibraries;
m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
(dynamic_cast<QGridLayout*>(m_pWidget->layout()))->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 );
#if defined(KDE_MAKE_VERSION)
# if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
# endif
#endif
m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
//END Update library widgets
setMainWidget( m_pWidget );
setInitialSize( m_pWidget->rect().size() );
}
示例12: levelFixtureNode
QCheckListItem* VCSliderProperties::levelFixtureNode(t_fixture_id id)
{
QCheckListItem* item = NULL;
for (item = static_cast<QCheckListItem*> (m_levelList->firstChild());
item != NULL;
item = static_cast<QCheckListItem*> (item->nextSibling()))
{
if (item->text(KColumnID).toInt() == id)
return item;
}
return NULL;
}
示例13: activeItemLabels
QStringList OListEditForm::activeItemLabels() const
{
QStringList activeItemLabelList;
for( QCheckListItem *item = (QCheckListItem*)m_listView->firstChild();
item;
item = (QCheckListItem*)item->nextSibling() )
{
if( item->isOn() )
{
activeItemLabelList << item->text( 0 );
}
}
return activeItemLabelList;
}
示例14: levelChannelNode
QCheckListItem* VCSliderProperties::levelChannelNode(QCheckListItem* parent,
t_channel ch)
{
QCheckListItem* item = NULL;
for (item = static_cast<QCheckListItem*> (parent->firstChild());
item != NULL;
item = static_cast<QCheckListItem*> (item->nextSibling()))
{
if (item->text(KColumnID).toInt() == ch)
return item;
}
return NULL;
}
示例15: slotDownload
void MainWindow::slotDownload()
{
// Retrieve list of packages selected for download (if any)
QStringList workingPackages;
for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild());
item != 0 ;
item = static_cast<QCheckListItem *>(item->nextSibling()) )
{
if ( item->isOn() )
workingPackages.append( item->text() );
}
if ( workingPackages.isEmpty() )
{
QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) );
return;
}
else
{
// Download selected packages
m_config.setGroup( "settings" );
QString workingDir = m_config.readEntry( "DownloadDir", "/tmp" );
bool ok = false;
QString text = EntryDlg::getText( tr( "Download" ), tr( "Enter path to download package to:" ), workingDir, &ok, this );
if ( ok && !text.isEmpty() )
workingDir = text; // user entered something and pressed ok
else
return; // user entered nothing or pressed cancel
// Store download directory in config file
m_config.writeEntry( "DownloadDir", workingDir );
// Get starting directory
QDir::setCurrent( workingDir );
// Create package manager output widget
InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ),
OPackage::Download, workingPackages );
connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
m_widgetStack.addWidget( dlg, 3 );
m_widgetStack.raiseWidget( dlg );
}
}