本文整理汇总了C++中QTreeWidgetItem::text方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidgetItem::text方法的具体用法?C++ QTreeWidgetItem::text怎么用?C++ QTreeWidgetItem::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeWidgetItem
的用法示例。
在下文中一共展示了QTreeWidgetItem::text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseSiItem
bool SessionManager::parseSiItem(QTreeWidgetItem *item, QString fromJid)
{
int count = item->childCount();
QMap<QString,QString> siAtt = getAttrList(item);
QString sid = siAtt["id"];
for(int i=0; i<count; i++)
{
QTreeWidgetItem *child = item->child(i);
if(child->text(0)=="file")
{
QMap<QString, QString> attrs = getAttrList(child);
QString fileName = attrs["name"];
QString size = attrs["size"];
status = READYRECEIVE;
emit readyReceiveFile(fromJid, fileName, size.toInt(), sid);
return true;
}
}
status = READYSENT;
emit readySentFile();
return true;
}
示例2: selSwatch
void CMYKChoose::selSwatch()
{
QTreeWidgetItem *c = Swatches->currentItem();
if (c == hsvSelector)
TabStack->setCurrentIndex(0);
else
{
CurrSwatch.clear();
QString pfadC2 = "";
QString txt = c->data(0, Qt::UserRole).toString() + "/" + c->text(0);
if (!customColSet.contains(txt))
pfadC2 = csm.paletteFileFromName(txt);
else
pfadC2 = csm.userPaletteFileFromName(txt);
if (importColorsFromFile(pfadC2, CurrSwatch))
{
CurrSwatch.insert("White", ScColor(0, 0, 0, 0));
CurrSwatch.insert("Black", ScColor(0, 0, 0, 255));
}
else
{
CurrSwatch.insert("White", ScColor(0, 0, 0, 0));
CurrSwatch.insert("Black", ScColor(0, 0, 0, 255));
ScColor cc = ScColor(255, 255, 255, 255);
cc.setRegistrationColor(true);
CurrSwatch.insert("Registration", cc);
CurrSwatch.insert("Blue", ScColor(255, 255, 0, 0));
CurrSwatch.insert("Cyan", ScColor(255, 0, 0, 0));
CurrSwatch.insert("Green", ScColor(255, 0, 255, 0));
CurrSwatch.insert("Red", ScColor(0, 255, 255, 0));
CurrSwatch.insert("Yellow", ScColor(0, 0, 255, 0));
CurrSwatch.insert("Magenta", ScColor(0, 255, 0, 0));
}
ColorSwatch->clear();
ColorSwatch->insertFancyPixmapItems(CurrSwatch);
ColorSwatch->setCurrentRow( 0 );
TabStack->setCurrentIndex(1);
}
}
示例3: disableSlot
void ServiceManager::disableSlot()
{
QTreeWidgetItem *item = listServices->currentItem();
if (!item)
return;
workingTreeWidgetItem = item;
// Disable the buttons until we are done
setButtonsAllEnabled(false);
QStringList rcList;
QString tag = item->text(1);
// Disable the buttons until we are done
setButtonsAllEnabled(false);
pcbsd::Utils::setConfFileValue( wDir + "/etc/rc.conf", tag, tag + "=\"NO\"", -1);
// Set the service as enabled
item->setText(4, tr("Disabled"));
listSelectionChanged();
}
示例4: chatIdentity
void IdDialog::chatIdentity()
{
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
if (!item)
{
std::cerr << "IdDialog::editIdentity() Invalid item";
std::cerr << std::endl;
return;
}
std::string keyId = item->text(RSID_COL_KEYID).toStdString();
QAction *action = qobject_cast<QAction *>(QObject::sender());
if (!action)
return ;
RsGxsId from_gxs_id(action->data().toString().toStdString());
uint32_t error_code ;
if(!rsMsgs->initiateDistantChatConnexion(RsGxsId(keyId), from_gxs_id, error_code))
QMessageBox::information(NULL, tr("Distant chat cannot work"), QString("%1 %2: %3").arg(tr("Distant chat refused with this person.")).arg(tr("Error code")).arg(error_code)) ;
}
示例5: displayCurrent
bool DisassembleWidget::displayCurrent()
{
if(address_ < lower_ || address_ > upper_) return false;
bool bFound=false;
for (int line=0; line < m_treeWidget->topLevelItemCount(); line++)
{
QTreeWidgetItem* item = m_treeWidget->topLevelItem(line);
unsigned long address = strtoul(item->text(Address).toLatin1(), 0, 0);
if (address == address_)
{
// put cursor at start of line and highlight the line
m_treeWidget->setCurrentItem(item);
item->setIcon(Icon, icon_);
bFound = true; // need to process all items to clear icons
}
else if(!item->icon(Icon).isNull()) item->setIcon(Icon, QIcon());
}
return bFound;
}
示例6: slotPrev
void KateBuildView::slotPrev()
{
const int itemCount = m_buildUi.errTreeWidget->topLevelItemCount();
if (itemCount == 0) {
return;
}
QTreeWidgetItem *item = m_buildUi.errTreeWidget->currentItem();
if (item && item->isHidden()) item = 0;
int i = (item == 0) ? itemCount : m_buildUi.errTreeWidget->indexOfTopLevelItem(item);
while (--i >= 0) {
item = m_buildUi.errTreeWidget->topLevelItem(i);
if (!item->text(1).isEmpty() && !item->isHidden()) {
m_buildUi.errTreeWidget->setCurrentItem(item);
m_buildUi.errTreeWidget->scrollToItem(item);
slotErrorSelected(item);
return;
}
}
}
示例7: sendMsg
void IdDialog::sendMsg()
{
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
if (!item)
{
return;
}
MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
std::string keyId = item->text(RSID_COL_KEYID).toStdString();
nMsgDialog->addRecipient(MessageComposer::TO, RsGxsId(keyId));
nMsgDialog->show();
nMsgDialog->activateWindow();
/* window will destroy itself! */
}
示例8: getColumn
int ShapeFileOptionsWidget::getColumn(const QString& strField) const
{
if (strField.isEmpty())
{
return -1;
}
QTreeWidgetItem* pHeaderItem = mpFeatureTree->headerItem();
if (pHeaderItem != NULL)
{
for (int i = 0; i < pHeaderItem->columnCount(); i++)
{
QString strColumn = pHeaderItem->text(i);
if (strColumn == strField)
{
return i;
}
}
}
return -1;
}
示例9: editGroup
void RegisteredUsersDialog::editGroup(KviRegisteredUserGroup * group)
{
bool ok;
QString text = QInputDialog::getText(this, "Change Group Name - KVIrc",
__tr2qs_ctx("Group name:", "register"), QLineEdit::Normal, group->name(), &ok);
if(ok && !text.isEmpty())
{
QString szOldGroup = group->name();
g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(false);
g_pLocalRegisteredUserDataBase->groupDict()->remove(szOldGroup);
g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(true);
group->setName(text);
g_pLocalRegisteredUserDataBase->groupDict()->insert(text, group);
KviPointerHashTable<QString, KviRegisteredUser> * d = g_pLocalRegisteredUserDataBase->userDict();
for(KviRegisteredUser * u = d->first(); u; u = d->next())
{
if(u->group() == szOldGroup)
u->setGroup(text);
}
fillList();
// select the last edited item
for(int c = 0; c < m_pListView->topLevelItemCount(); c++)
{
QTreeWidgetItem * pGroup = m_pListView->topLevelItem(c);
if(KviQString::equalCI(pGroup->text(0), text))
{
pGroup->setSelected(true);
m_pListView->setCurrentItem(pGroup);
break;
}
}
}
}
示例10: FindNode
QTreeWidgetItem *EventBrowser::FindNode(QTreeWidgetItem *parent, QString filter, uint32_t after)
{
for(int i = 0; i < parent->childCount(); i++)
{
QTreeWidgetItem *n = parent->child(i);
uint eid = n->data(COL_EID, Qt::UserRole).toUInt();
if(eid > after && n->text(COL_NAME).contains(filter, Qt::CaseInsensitive))
return n;
if(n->childCount() > 0)
{
QTreeWidgetItem *found = FindNode(n, filter, after);
if(found != NULL)
return found;
}
}
return NULL;
}
示例11: showRemoteInterfaces
void ManageInterfacesDialog::showRemoteInterfaces()
{
guint i;
interface_t device;
QTreeWidgetItem *item = NULL;
// We assume that remote interfaces are grouped by host.
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
QTreeWidgetItem *child;
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device.local) {
if (!item || item->text(col_r_host_dev_).compare(device.remote_opts.remote_host_opts.remote_host) != 0) {
item = new QTreeWidgetItem(ui->remoteList);
item->setText(col_r_host_dev_, device.remote_opts.remote_host_opts.remote_host);
item->setExpanded(true);
}
child = new QTreeWidgetItem(item);
child->setCheckState(col_r_show_, device.hidden ? Qt::Unchecked : Qt::Checked);
child->setText(col_r_host_dev_, QString(device.name));
}
}
}
示例12: removeIdentity
void IdDialog::removeIdentity()
{
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
if (!item)
{
#ifdef ID_DEBUG
std::cerr << "IdDialog::editIdentity() Invalid item";
std::cerr << std::endl;
#endif
return;
}
if ((QMessageBox::question(this, tr("Really delete?"), tr("Do you really want to delete this identity?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No))== QMessageBox::Yes)
{
std::string keyId = item->text(RSID_COL_KEYID).toStdString();
uint32_t dummyToken = 0;
RsGxsIdGroup group;
group.mMeta.mGroupId=RsGxsGroupId(keyId);
rsIdentity->deleteIdentity(dummyToken, group);
}
}
示例13: onResAvailable
/*! \brief Called when a resource became avaible
\param which
*/
void ApplicationViewWidget::onResAvailable(int which)
{
QTreeWidgetItem *it = ui->resourcesList->topLevelItem(which);
if(it){
it->setText(3,"available");
if(it->text(2) == "computer"){
it->setIcon(0,QIcon(":/images/computer_ico.png"));
it->setTextColor(3,QColor("#008C00"));
}else{
it->setIcon(0,QIcon(":/images/port_avail_ico.png"));
it->setTextColor(3,QColor("#008C00"));
}
/*if(row[m_resColumns.m_col_type] == Glib::ustring("computer"))
row.set_value(0, m_refPixAvailable);
else
row.set_value(0, m_refPixPortAvaibable);*/
}
reportErrors();
}
示例14: on_remoteSettings_clicked
void ManageInterfacesDialog::on_remoteSettings_clicked()
{
guint i = 0;
interface_t device;
QTreeWidgetItem* item = ui->remoteList->currentItem();
if (!item) {
return;
}
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device.local) {
if (item->text(col_r_host_dev_).compare(device.name)) {
continue;
} else {
RemoteSettingsDialog *dlg = new RemoteSettingsDialog(this, &device);
dlg->show();
break;
}
}
}
}
示例15: saveChannel
void StaffTextProperties::saveChannel(int channel)
{
QList<ChannelActions>* ca = _staffText->channelActions();
int n = ca->size();
for (int i = 0; i < n; ++i) {
ChannelActions* a = &(*ca)[i];
if (a->channel == channel) {
ca->removeAt(i);
break;
}
}
ChannelActions a;
a.channel = channel;
for (int i = 0; i < actionList->topLevelItemCount(); ++i) {
QTreeWidgetItem* item = actionList->topLevelItem(i);
if (item->isSelected())
a.midiActionNames.append(item->text(0));
}
ca->append(a);
}