当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckListItem::setOn方法代码示例

本文整理汇总了C++中QCheckListItem::setOn方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckListItem::setOn方法的具体用法?C++ QCheckListItem::setOn怎么用?C++ QCheckListItem::setOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCheckListItem的用法示例。


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

示例1: 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);
  }
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:10,代码来源:sensorsconfig.cpp

示例2: loadSettings

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;
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:31,代码来源:resourcekabcconfig.cpp

示例3: 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);
            }
        }
开发者ID:tmarques,项目名称:waheela,代码行数:25,代码来源:playlistselection.cpp

示例4: fillChannelList

//
// 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);
	}
    }
}
开发者ID:speakman,项目名称:qlc,代码行数:59,代码来源:vcdocksliderproperties.cpp

示例5: setChecked

void CheckedListView::setChecked( const QStringList &checked )
{
    // iterate over all items
    bool showingChecked = FALSE;
    for ( QCheckListItem *i = (QCheckListItem *) firstChild();
	  i; i = (QCheckListItem *)i->nextSibling() )
	// see if the item should be checked by searching the
	// checked list
	if ( checked.find( i->text( 0 ) ) != checked.end() ) {
	   i->setOn( TRUE );
	   // make sure it is showing at least one checked item
	   if ( !showingChecked ) {
	       ensureItemVisible( i );
	       showingChecked = TRUE;
	   }
	}
       else
	   i->setOn( FALSE );
}
开发者ID:opieproject,项目名称:opie,代码行数:19,代码来源:categories.cpp

示例6: levelSelectChannelsByGroup

void VCSliderProperties::levelSelectChannelsByGroup(QString group)
{
	QCheckListItem* fxiNode = NULL;
	QCheckListItem* chNode = NULL;

	for (fxiNode = static_cast<QCheckListItem*> (m_levelList->firstChild());
	     fxiNode != NULL;
	     fxiNode = static_cast<QCheckListItem*> (fxiNode->nextSibling()))
	{
		for (chNode = static_cast<QCheckListItem*> (fxiNode->firstChild());
		     chNode != NULL;
		     chNode = static_cast<QCheckListItem*> (chNode->nextSibling()))
		{
			if (chNode->text(KColumnType) == group)
				chNode->setOn(true);
			else
				chNode->setOn(false);
		}
	}
}
开发者ID:speakman,项目名称:qlc,代码行数:20,代码来源:vcsliderproperties.cpp

示例7: addCheckItem

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 );
}
开发者ID:NgoHuy,项目名称:uim,代码行数:12,代码来源:customwidgets.cpp

示例8: 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() );
}
开发者ID:zoltanp,项目名称:ktechlab-0.3,代码行数:53,代码来源:projectdlgs.cpp

示例9: slotClicked

void EvaQunMemberPicker::slotClicked(QListViewItem *item)
{
	if(!item) return;
	QCheckListItem *chkItem = dynamic_cast<QCheckListItem *>(item);
	if(!chkItem) return;
	unsigned int id;
	QString txt;
	QString strID;
	bool ok;
	QString nick;
	QPixmap face;
	
	QCheckListItem *child = dynamic_cast<QCheckListItem *>(chkItem->firstChild());
	if(!child){
		txt = chkItem->text(0);
		int index = txt.findRev("(");
		nick = txt.left( index );
		strID = txt.mid(index+1, txt.length() - index - 1 - 1);
		id = strID.toUInt(&ok);
		if(!ok) return;
		
		face = *(chkItem->pixmap(0));
		
		emit memberClicked(id, chkItem->isOn());
	}
	while(child){
		child->setOn(chkItem->isOn());
		
		txt = child->text(0);
		int index = txt.findRev("(");
		nick = txt.left( index );
		strID = txt.mid(index+1, txt.length() - index - 1 - 1);
		id = strID.toUInt(&ok);
		if(!ok) return;
		
		face = *(child->pixmap(0));
		
		emit memberClicked(id, child->isOn());
		child = dynamic_cast<QCheckListItem *>(child->nextSibling());
	}
}
开发者ID:evareborn,项目名称:eva-nirvana,代码行数:41,代码来源:evaqunmemberpicker.cpp

示例10: main_tab


//.........这里部分代码省略.........
    // No save for now...
    SaveButton->setEnabled(false);

    QObject::connect(&QuitButton, SIGNAL(clicked()), &my_dialogs, SLOT(CheckSaved()));
    QObject::connect(&AboutButton, SIGNAL(clicked()), &my_dialogs, SLOT(ShowAbout()));
    QObject::connect(&AddButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoAdd()));
    QObject::connect(SaveButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoSave()));

    // We're now using human readable data, handle the migration
    // transparently for the user.
    homedir = getenv("HOME");

    if (homedir != NULL) {

        snprintf(temp, FILENAME_MAX, "%s/%s", homedir, ".thefishrc");
        fd = open(temp, O_RDONLY, 0);

        if (fd != -1 ) {

            i = lseek(fd, 0, SEEK_END);
            lseek(fd, 0, SEEK_SET);

            if (i == sizeof(oldsize)) {

                read(fd, &oldsize[0], sizeof(oldsize));
                close(fd);

            } else {

                fp = fdopen(fd, "r");
                fscanf(fp, "geometry=%i,%i", &oldsize[0], &oldsize[1]);
                fclose(fp);

            }

        } else  {
            // Set some default values
            oldsize[0] = 400;
            oldsize[1] = 480;

        }

    }

    // Build the table

    knobs_table->setColumnWidthMode (1, QListView::Maximum);
    knobs_table->setRootIsDecorated(false);

    for (i = my_rc->knobs_size - 1; i >= 0; i--) {

        // No user comments yet
        (my_rc->knobs_ptr+i)->user_comment = 0;

        foo = new QCheckListItem( knobs_table, (my_rc->knobs_ptr+i)->name, QCheckListItem::CheckBox);

        if ((my_rc->knobs_ptr+i)->knob_val == KNOB_IS_NO) {

            foo->setOn(FALSE);

        } else {

            foo->setOn(TRUE);

        }

    }

    for (i = my_rc->string_size - 1; i >= 0; i--) {

        // No user comments yet
        (my_rc->string_ptr+i)->user_comment = 0;

        element = new QListViewItem(strings_table,
                                    (my_rc->string_ptr+i)->name,
                                    (my_rc->string_ptr+i)->value);
        element->setRenameEnabled(0, FALSE);
        element->setRenameEnabled(1, TRUE);

    }

    // Set the app icon
    QPixmap my_icon((const char **) fish64_xpm);

    mw->setIcon((const QPixmap ) my_icon);

    mw->setCaption("The Fish " THE_FISH_VERSION);
    mw->setCentralWidget( vbox );
    thefish->setMainWidget(mw);
    mw->show();
    mw->resize(oldsize[0], oldsize[1]);

    dirty = 0;

    my_status_bar = mw->statusBar();
    my_status_bar->message("Ready");

    return thefish->exec();

}
开发者ID:BackupTheBerlios,项目名称:thefish-svn,代码行数:101,代码来源:qt_ui.C

示例11: QDialog


//.........这里部分代码省略.........
                QMessageBox::critical(0, "The Fish",
                                      "Value must begin and end with \".");

                delete(my_add_dialog);
                return;

            }

            // It's a knob set to YES
            if (strncasecmp(new_value, KNOB_YES, 255) == 0) {

                (my_rc_knobs+my_num_knobs)->user_comment = 0;
                (my_rc_knobs+my_num_knobs)->user_added = USER_ADDED_YES;
                (my_rc_knobs+my_num_knobs)->knob_val = KNOB_IS_YES;
                (my_rc_knobs+my_num_knobs)->knob_orig = KNOB_IS_YES;
                (my_rc_knobs+my_num_knobs)->modified = MODIFIED_YES;

                strncpy((my_rc_knobs+my_num_knobs)->name, new_name, 255);


                if (new_comment != NULL) {

                    if (strlen(new_comment) > 1) {

                        strncpy((my_rc_knobs+my_num_knobs)->comment, new_comment, 255);
                        (my_rc_knobs+my_num_knobs)->user_comment = 1;

                    }

                }

                foo = new QCheckListItem(knobs_table, (my_rc_knobs+my_num_knobs)->name,
                                         QCheckListItem::CheckBox);
                foo->setOn(TRUE);

                my_num_knobs++;
                dirty++;
                SaveButton->setEnabled(TRUE);

                // It's a knob set to NO
            } else if (strncasecmp(new_value, KNOB_NO, 255) == 0) {

                (my_rc_knobs+my_num_knobs)->user_comment = 0;
                (my_rc_knobs+my_num_knobs)->user_added = USER_ADDED_YES;
                (my_rc_knobs+my_num_knobs)->knob_val = KNOB_IS_NO;
                (my_rc_knobs+my_num_knobs)->knob_orig = KNOB_IS_NO;
                (my_rc_knobs+my_num_knobs)->modified = MODIFIED_YES;

                strncpy((my_rc_knobs+my_num_knobs)->name, new_name, 255);


                if (new_comment != NULL) {

                    if (strlen(new_comment) > 1) {

                        strncpy((my_rc_knobs+my_num_knobs)->comment, new_comment, 255);
                        (my_rc_knobs+my_num_knobs)->user_comment = 1;

                    }

                }

                foo = new QCheckListItem(knobs_table, (my_rc_knobs+my_num_knobs)->name,
                                         QCheckListItem::CheckBox);
                foo->setOn(FALSE);
开发者ID:BackupTheBerlios,项目名称:thefish-svn,代码行数:66,代码来源:qt_ui.C


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