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


C++ QListWidgetItem::text方法代码示例

本文整理汇总了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);
}
开发者ID:pcjpnet,项目名称:qwired-suite,代码行数:12,代码来源:QwmMonitorWindow.cpp

示例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
}
开发者ID:bseelbind,项目名称:hedgewars-accessible,代码行数:19,代码来源:chatwidget.cpp

示例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);
}
开发者ID:KeeganRen,项目名称:qt-creator,代码行数:10,代码来源:directoryfilter.cpp

示例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;
    }
}
开发者ID:impegoraro,项目名称:dplxx,代码行数:10,代码来源:mainwindow.cpp

示例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;
}
开发者ID:Funzinator,项目名称:vonNeumannEmulator,代码行数:43,代码来源:GuiInterface.cpp

示例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;
}
开发者ID:Funzinator,项目名称:vonNeumannEmulator,代码行数:43,代码来源:GuiInterface.cpp

示例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;
}
开发者ID:Funzinator,项目名称:vonNeumannEmulator,代码行数:43,代码来源:GuiInterface.cpp

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

示例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();
}
开发者ID:creepydragon,项目名称:r2,代码行数:10,代码来源:QtDeleteAssetDialog.cpp

示例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());
}
开发者ID:Mesagoppinmypants,项目名称:Tools,代码行数:10,代码来源:lairspawneditor.cpp

示例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());
    }
}
开发者ID:norandom,项目名称:recoll,代码行数:11,代码来源:advsearch_w.cpp

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

示例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;
}
开发者ID:stormbringerdp1,项目名称:WIGTSv3,代码行数:11,代码来源:MReadiness.cpp

示例14: onOpen

void OpenFileWidget::onOpen()
{
    QListWidgetItem * item = m_fileList->currentItem();
    if(item && item->type() == 0)
    {
        QString fileName = item->text();
        emit selected(fileName);
        close();
    }
}
开发者ID:Dongzhixiao,项目名称:C-_study_onQT,代码行数:10,代码来源:openFileWidget.cpp

示例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;
}
开发者ID:gottcode,项目名称:tetzle,代码行数:10,代码来源:new_game_tab.cpp


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