本文整理汇总了C++中QCheckListItem::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckListItem::setText方法的具体用法?C++ QCheckListItem::setText怎么用?C++ QCheckListItem::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckListItem
的用法示例。
在下文中一共展示了QCheckListItem::setText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
示例2: levelUpdateFixtureNode
void VCSliderProperties::levelUpdateFixtureNode(t_fixture_id id)
{
Fixture* fxi = NULL;
QCheckListItem* item = NULL;
QString str;
fxi = _app->doc()->fixture(id);
Q_ASSERT(fxi != NULL);
item = levelFixtureNode(id);
if (item == NULL)
item = new QCheckListItem(m_levelList, fxi->name(),
QCheckListItem::CheckBoxController);
item->setText(KColumnType, fxi->type());
str.setNum(id);
item->setText(KColumnID, str);
levelUpdateChannels(item, fxi);
}
示例3: levelUpdateChannelNode
void VCSliderProperties::levelUpdateChannelNode(QCheckListItem* parent,
Fixture* fxi,
t_channel ch)
{
QCheckListItem* item = NULL;
QLCChannel* channel = NULL;
QString str;
Q_ASSERT(parent != NULL);
channel = fxi->channel(ch);
Q_ASSERT(channel != NULL);
item = levelChannelNode(parent, ch);
if (item == NULL)
item = new QCheckListItem(parent, channel->name(),
QCheckListItem::CheckBox);
item->setText(KColumnType, channel->group());
str.setNum(ch);
item->setText(KColumnID, str);
levelUpdateCapabilities(item, channel);
}
示例4: initPage
//=====================================
// XKeyboard init page with infos...
//-------------------------------------
void XKeyboard::initPage (void) {
// log (L_INFO,"XKeyboard::initPage() called\n");
// ...
// this function is called after the page was created.
// It must only be used to init the widgets contents
// with the data available for selections and other stuff
// like that
// ---
XWrapPointer< QDict<char> > mText (mTextPtr);
mLayoutHash = mRules.getLayouts();
mModelHash = mRules.getModels();
mOptionHash = mRules.getOptions();
//================================================
// include available layouts
//------------------------------------------------
QDictIterator<char> itLayout (mLayoutHash);
QListBox* layoutBox = new QListBox();
for (; itLayout.current(); ++itLayout) {
layoutBox -> insertItem ( QString::fromLocal8Bit (itLayout.current()) );
QCheckListItem* item = new QCheckListItem (
mAddView,"",QCheckListItem::CheckBox
);
item->setText ( 1, QString::fromLocal8Bit (itLayout.current()) );
item->setText ( 2, itLayout.currentKey() );
}
layoutBox -> sort ( true );
mLayout -> setListBox ( layoutBox );
//================================================
// include available models
//------------------------------------------------
QDictIterator<char> itModel (mModelHash);
QListBox* typeBox = new QListBox();
for (; itModel.current(); ++itModel) {
typeBox -> insertItem ( QString::fromLocal8Bit (itModel.current()) );
}
typeBox -> sort ( true );
mType -> setListBox ( typeBox );
mAddView -> setSorting (1);
//================================================
// include available options
//------------------------------------------------
QString* xkbDefault = new QString (
mText["Default"]
);
mXkbOption[0]->insertItem (*xkbDefault);
mXkbOption[1]->insertItem (*xkbDefault);
mXkbOption[6]->insertItem (*xkbDefault);
QDictIterator<char> itOption (mOptionHash);
for (; itOption.current(); ++itOption) {
XStringList completeOption (itOption.currentKey());
completeOption.setSeperator (":");
QString optkey = completeOption.getList().getFirst();
if (optkey == "grp") {
mXkbOption[0] -> insertItem (
QString::fromLocal8Bit (itOption.current())
);
}
else if (optkey == "ctrl") {
mXkbOption[1] -> insertItem (
QString::fromLocal8Bit (itOption.current())
);
}
else {
mXkbOption[6] -> insertItem (
QString::fromLocal8Bit (itOption.current())
);
}
}
for (int i=2;i<6;i++) {
mXkbOption[i]->insertItem (*xkbDefault);
mXkbOption[i]->insertItem ("Meta");
mXkbOption[i]->insertItem ("Compose");
mXkbOption[i]->insertItem ("ModeShift");
mXkbOption[i]->insertItem ("ModeLock");
mXkbOption[i]->insertItem ("ScrollLock");
mXkbOption[i]->insertItem ("Control");
}
//================================================
// set defaults
//------------------------------------------------
mCurrentDelay = XKBDDELAY_DEFAULT;
mCurrentKrate = XKBDRATE_DEFAULT;
}