本文整理汇总了C++中QListWidgetItem::text方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidgetItem::text方法的具体用法?C++ QListWidgetItem::text怎么用?C++ QListWidgetItem::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem::text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleTrackersChanged
/*! Generate a new list of tracker URLs.
*/
void QwmMonitorWindow::handleTrackersChanged()
{
QStringList trackerUrls;
for (int i = 0; i < configurationTrackersList->count(); i++) {
QListWidgetItem *item = configurationTrackersList->item(i);
if (!item) { continue; }
trackerUrls << item->text();
}
emit updatedTrackerList(trackerUrls);
}
示例2: onFriend
void HWChatWidget::onFriend()
{
QListWidgetItem * curritem = chatNicks->currentItem();
if(!curritem)
return;
if(friendsList.contains(curritem->text(), Qt::CaseInsensitive)) // already on list - remove him
{
friendsList.removeAll(curritem->text().toLower());
onChatString(HWChatWidget::tr("%1 *** %2 has been removed from your friends list").arg('\x03').arg(curritem->text()));
}
else // not on list - add
{
friendsList << curritem->text().toLower();
onChatString(HWChatWidget::tr("%1 *** %2 has been added to your friends list").arg('\x03').arg(curritem->text()));
}
updateIcon(curritem); // update icon
chatNickSelected(0); // update context menu
}
示例3: editDirectory
void DirectoryFilter::editDirectory()
{
if (m_ui.directoryList->selectedItems().count() < 1)
return;
QListWidgetItem *currentItem = m_ui.directoryList->selectedItems().at(0);
QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Select Directory"),
currentItem->text());
if (!dir.isEmpty())
currentItem->setText(dir);
}
示例4: listOut
void MainWindow::listOut(int inode, const QString& str)
{
QListWidgetItem* item;
for(int i = 0; i < ui->listFiles->count(); ++i) {
item = ui->listFiles->item(i);
if(item->text() == str)
delete item;
}
}
示例5: receiveFloat
double GuiInterface::receiveFloat()
{
double res = 0;
if (this->listWidgetInput->count())
{
if (!this->regExpFloat)
{
this->regExpFloat = new QRegExp("[-+]?([0-9]*\\.?[0-9]*)");
}
QListWidgetItem *item = this->listWidgetInput->takeItem(0);
if (this->regExpFloat->exactMatch(item->text()))
{
res = item->text().toDouble();
delete item;
}
else
{
delete item;
this->sendSignal(CommunicationInterface::HLT, "input error: invalid double value");
}
}
else
{
DialogInputFloat dialog("Eingabe", QString::fromUtf8("Doublewert:"), this->MainWindow);
this->MainWindow->setEnabled(false);
if (dialog.exec())
{
res = dialog.lineEditInput->text().toDouble();
}
else
{
this->sendSignal(CommunicationInterface::HLT, "input error: no input");
}
this->MainWindow->setEnabled(true);
}
return res;
}
示例6: receiveInteger
int GuiInterface::receiveInteger()
{
int res = 0;
if (this->listWidgetInput->count())
{
if (!this->regExpInteger)
{
this->regExpInteger = new QRegExp("[-+]?[0-9]+");
}
QListWidgetItem *item = this->listWidgetInput->takeItem(0);
if (this->regExpInteger->exactMatch(item->text()))
{
res = item->text().toInt();
delete item;
}
else
{
delete item;
this->sendSignal(CommunicationInterface::HLT, "input error: invalid integer value");
}
}
else
{
DialogInputInteger dialog("Eingabe", QString::fromUtf8("Integerwert:"), this->MainWindow);
this->MainWindow->setEnabled(false);
if (dialog.exec())
{
res = dialog.lineEditInput->text().toInt();
}
else
{
this->sendSignal(CommunicationInterface::HLT, "input error: no input");
}
this->MainWindow->setEnabled(true);
}
return res;
}
示例7: receiveBinary
QString GuiInterface::receiveBinary()
{
QString res;
if (this->listWidgetInput->count())
{
if (!this->regExpBinary)
{
this->regExpBinary = new QRegExp("[01]+");
}
QListWidgetItem *item = this->listWidgetInput->takeItem(0);
if (this->regExpBinary->exactMatch(item->text()))
{
res = item->text();
delete item;
}
else
{
delete item;
this->sendSignal(CommunicationInterface::HLT, "input error: invalid binary value");
}
}
else
{
DialogInputBinary dialog("Eingabe", QString::fromUtf8("Binärwert:"), this->MainWindow);
this->MainWindow->setEnabled(false);
if (dialog.exec())
{
res = dialog.lineEditInput->text();
}
else
{
this->sendSignal(CommunicationInterface::HLT, "input error: no input");
}
this->MainWindow->setEnabled(true);
}
return res;
}
示例8: on_colorChanged
void CurveColorPick::on_colorChanged(QColor color)
{
QListWidgetItem *item = ui->listWidget->currentItem();
if( color != item->foreground().color())
{
_any_modified = true;
item->setForeground( color );
emit changeColor( item->text(), color );
}
}
示例9: on_deletePushButton_clicked
void QtDeleteAssetDialog::on_deletePushButton_clicked()
{
for(int row = 0; row < ui->assetsListWidget->count(); row++)
{
QListWidgetItem* item = ui->assetsListWidget->item(row);
emit deleteAsset(item->text());
}
close();
}
示例10: removeLairType
void LairSpawnEditor::removeLairType() {
QListWidgetItem* item = ui->listWidget_lairs->currentItem();
if (item == NULL)
return;
group->removeSpawnEntry(item->text());
delete ui->listWidget_lairs->takeItem(ui->listWidget_lairs->currentRow());
}
示例11: guiListsToIgnTypes
// Compute list of ignored mime type from widget lists
void AdvSearch::guiListsToIgnTypes()
{
yesFiltypsLB->sortItems();
noFiltypsLB->sortItems();
m_ignTypes.clear();
for (int i = 0; i < noFiltypsLB->count();i++) {
QListWidgetItem *item = noFiltypsLB->item(i);
m_ignTypes.append(item->text());
}
}
示例12: listerRemove
void BaseForm::listerRemove(const QString& caption)
{
qint32 i = m_cnlist->count();
while (i--)
{
QListWidgetItem* itm = m_cnlist->item(i);
if (itm && itm->text()==caption)
delete m_cnlist->takeItem(i);
}
}
示例13: GetListWidgetItem
//--------------------------------------------------------------------------------------------
QListWidgetItem* MReadiness::GetListWidgetItem(QListWidget* pListWidget, QString nameItem)
{
QListWidgetItem* pItem;
int count = pListWidget->count();
for(int i = 0; i < count; i++) {
pItem = pListWidget->item(i);
if(pItem->text() == nameItem) return pItem;
}
return NULL;
}
示例14: onOpen
void OpenFileWidget::onOpen()
{
QListWidgetItem * item = m_fileList->currentItem();
if(item && item->type() == 0)
{
QString fileName = item->text();
emit selected(fileName);
close();
}
}
示例15: createItem
QListWidgetItem* NewGameTab::createItem(const QString& image, const QSettings& details)
{
const qreal pixelratio = devicePixelRatioF();
QListWidgetItem* item = ThumbnailLoader::createItem(Path::image(image), details.value(image + "/Name", tr("Untitled")).toString(), m_images, pixelratio);
item->setData(ImageRole, image);
item->setData(NameRole, item->text());
item->setData(TagsRole, m_image_tags->tags(image));
updateToolTip(item);
return item;
}