• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QVariant函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QVariant函数的典型用法代码示例。如果您正苦于以下问题:C++ QVariant函数的具体用法?C++ QVariant怎么用?C++ QVariant使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: QVariant

/**
 * Default constructor
 */
CRotationSensorSym::CRotationSensorSym(QSensor *sensor):CSensorBackendSym(sensor)
        {
        setReading<QRotationReading>(&iReading);
        iBackendData.iSensorType = KSensrvChannelTypeIdRotationData;
        sensor->setProperty("hasZ", QVariant(FALSE));
        }
开发者ID:Koi-foo,项目名称:qt-mobility,代码行数:9,代码来源:rotationsensorsym.cpp


示例2: unblockContact

void MoodBoxServer::unblockContact(Callback callback, qint32 contactUserId)
{
    unblockContact(callback, QVariant(), contactUserId);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例3: advancedSearchContacts

void MoodBoxServer::advancedSearchContacts(Callback callback, qint32 pageNumber, qint32 recordsPerPage, QString value, QLocale::Country country, QString city, Sex::SexEnum sex, qint32 minAge, qint32 maxAge)
{
    advancedSearchContacts(callback, QVariant(), pageNumber, recordsPerPage, value, country, city, sex, minAge, maxAge);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例4: processAuthorizationRequest

void MoodBoxServer::processAuthorizationRequest(Callback callback, qint32 recipientId, QString authorizationMessage)
{
    processAuthorizationRequest(callback, QVariant(), recipientId, authorizationMessage);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例5: processAuthorizationResponse

void MoodBoxServer::processAuthorizationResponse(Callback callback, qint32 recipientId, bool isAccepted)
{
    processAuthorizationResponse(callback, QVariant(), recipientId, isAccepted);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例6: getContacts

void MoodBoxServer::getContacts(Callback callback)
{
    getContacts(callback, QVariant());
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例7: getStatus

void MoodBoxServer::getStatus(Callback callback, qint32 userId)
{
    getStatus(callback, QVariant(), userId);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例8: getServerInfo

void MoodBoxServer::getServerInfo(Callback callback)
{
    getServerInfo(callback, QVariant());
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例9: getCommands

void MoodBoxServer::getCommands(Callback callback, qint32 previousPackageId)
{
    getCommands(callback, QVariant(), previousPackageId);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例10: QDialog

OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
    QDialog(parent),
    ui(new Ui::OptionsDialog),
    model(0),
    mapper(0),
    fProxyIpValid(true)
{
    ui->setupUi(this);
    GUIUtil::restoreWindowGeometry("nOptionsDialogWindow", this->size(), this);

    /* Main elements init */
    ui->databaseCache->setMinimum(nMinDbCache);
    ui->databaseCache->setMaximum(nMaxDbCache);
    ui->threadsScriptVerif->setMinimum(-(int)boost::thread::hardware_concurrency());
    ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);

    /* Network elements init */
#ifndef USE_UPNP
    ui->mapPortUpnp->setEnabled(false);
#endif

    ui->proxyIp->setEnabled(false);
    ui->proxyPort->setEnabled(false);
    ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));

    connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));
    connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));

    ui->proxyIp->installEventFilter(this);

    /* Window elements init */
#ifdef Q_OS_MAC
    /* remove Window tab on Mac */
    ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));
#endif

    /* remove Wallet tab in case of -disablewallet */
    if (!enableWallet) {
        ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));
    }

    /* Display elements init */
    QDir translations(":translations");
    ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
    foreach(const QString &langStr, translations.entryList())
    {
        QLocale locale(langStr);

        /** check if the locale name consists of 2 parts (language_country) */
        if(langStr.contains("_"))
        {
#if QT_VERSION >= 0x040800
            /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
            ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
            /** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */
            ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
        }
        else
        {
#if QT_VERSION >= 0x040800
            /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
            ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
            /** display language strings as "language (locale name)", e.g. "German (de)" */
            ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
        }
    }
#if QT_VERSION >= 0x040700
    ui->thirdPartyTxUrls->setPlaceholderText("https://example.com/tx/%s");
#endif

    ui->unit->setModel(new HivemindUnits(this));

    /* Widget-to-option mapper */
    mapper = new QDataWidgetMapper(this);
    mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
    mapper->setOrientation(Qt::Vertical);

    /* setup/change UI elements when proxy IP is invalid/valid */
    connect(this, SIGNAL(proxyIpChecks(QValidatedLineEdit *, int)), this, SLOT(doProxyIpChecks(QValidatedLineEdit *, int)));
}
开发者ID:timelf123,项目名称:hivemind,代码行数:84,代码来源:optionsdialog.cpp


示例11: QVariant

/**
 * Read a char from the byte stream.
 * @return a Character
 */
QVariant OSCByteArrayToMsgConverter::readChar()
{
    return QVariant(iBytes->at(iStreamPosition++));
}
开发者ID:dodata3,项目名称:reroot,代码行数:8,代码来源:OSCByteArrayToMsgConverter.cpp


示例12: QVariant

QVariant ObjectSet::data(const QModelIndex &index, int role) const
{
    if (!index.isValid())
        return QVariant();

    Node *node = static_cast<Node *>(index.internalPointer());

    if (role == Qt::DisplayRole && index.column() == 0)
        return node->displayString();

    if (role == Qt::ForegroundRole && index.column() == 0)
    {
        ComponentType type;
        if (node->type() == NT_COMPONENTS)
            type = static_cast<Components *>(node)->cType();
        else if (node->type() == NT_COMPONENT)
            type = static_cast<Components *>(node->parent())->cType();
        else
            return QVariant();

        return QBrush(QColor(modeMatch(_selectionMode, type) ? "black" : "silver"));
    }

    if (role == Qt::CheckStateRole && index.column() == 2)
    {
        switch (node->type())
        {
        case NT_FILE:
        {
            bool foundUnselected = false, foundSelected = false;
            for (auto n : node->children())
            {
                DisplayObject *obj = static_cast<Patch *>(n)->obj();

                foundUnselected |= !obj->fullSelection(_selectionMode);
                foundSelected |= obj->hasSelection();

                if (foundUnselected && foundSelected)
                    return Qt::PartiallyChecked;
            }

            return foundSelected ? Qt::Checked : Qt::Unchecked;
        }
        case NT_PATCH:
        {
            DisplayObject *obj = static_cast<Patch *>(node)->obj();
            return QVariant(obj->fullSelection(_selectionMode) ? Qt::Checked :
                            (obj->hasSelection() ? Qt::PartiallyChecked : Qt::Unchecked));
        }
        case NT_COMPONENT:
            if (modeMatch(_selectionMode, static_cast<Components *>(node->parent())->cType()))
                return static_cast<Component *>(node)->isSelected() ? Qt::Checked : Qt::Unchecked;
            return QVariant();
        }
    }

    if (role == Qt::DecorationRole && index.column() == 1)
    {
        if (node->type() == NT_PATCH)
        {
            DisplayObject *obj = static_cast<Patch *>(node)->obj();
            QString base = ":/icons/%1_%2.png";

            switch (obj->type())
            {
            case OT_VOLUME: base = base.arg("volume"); break;
            case OT_SURFACE: base = base.arg("surface"); break;
            case OT_CURVE: base = base.arg("curve"); break;
            }

            base = base.arg(obj->isFullyVisible(false) ? "full" :
                            (obj->isInvisible(false) ? "hidden" : "partial"));
            return QIcon(base);
        }
        else if (node->type() == NT_FILE)
        {
            bool allInvisible = true, allVisible = true;
            for (auto n : node->children())
            {
                DisplayObject *obj = static_cast<Patch *>(n)->obj();

                allInvisible &= obj->isInvisible(false);
                allVisible &= obj->isFullyVisible(false);

                if (!allInvisible && !allVisible)
                    return QIcon(":/icons/file_partial.png");
            }
            
            return QIcon(allVisible ? ":/icons/file_full.png" : ":/icons/file_hidden.png");
        }
    }

    return QVariant();
}
开发者ID:akva2,项目名称:BSGUI,代码行数:94,代码来源:ObjectSet.cpp


示例13: CCoinControlWidgetItem

void CoinControlDialog::updateView()
{
    if (!model || !model->getOptionsModel() || !model->getAddressTableModel())
        return;

    bool treeMode = ui->radioTreeMode->isChecked();

    ui->treeWidget->clear();
    ui->treeWidget->setEnabled(false); // performance, otherwise updateLabels would be called for every checked checkbox
    ui->treeWidget->setAlternatingRowColors(!treeMode);
    QFlags<Qt::ItemFlag> flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
    QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;

    int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();

    std::map<QString, std::vector<COutput> > mapCoins;
    model->listCoins(mapCoins);

    for (const std::pair<QString, std::vector<COutput>>& coins : mapCoins) {
        CCoinControlWidgetItem *itemWalletAddress = new CCoinControlWidgetItem();
        itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
        QString sWalletAddress = coins.first;
        QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
        if (sWalletLabel.isEmpty())
            sWalletLabel = tr("(no label)");

        if (treeMode)
        {
            // wallet address
            ui->treeWidget->addTopLevelItem(itemWalletAddress);

            itemWalletAddress->setFlags(flgTristate);
            itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);

            // label
            itemWalletAddress->setText(COLUMN_LABEL, sWalletLabel);

            // address
            itemWalletAddress->setText(COLUMN_ADDRESS, sWalletAddress);
        }

        CAmount nSum = 0;
        int nChildren = 0;
        for (const COutput& out : coins.second) {
            nSum += out.tx->tx->vout[out.i].nValue;
            nChildren++;

            CCoinControlWidgetItem *itemOutput;
            if (treeMode)    itemOutput = new CCoinControlWidgetItem(itemWalletAddress);
            else             itemOutput = new CCoinControlWidgetItem(ui->treeWidget);
            itemOutput->setFlags(flgCheckbox);
            itemOutput->setCheckState(COLUMN_CHECKBOX,Qt::Unchecked);

            // address
            CTxDestination outputAddress;
            QString sAddress = "";
            if(ExtractDestination(out.tx->tx->vout[out.i].scriptPubKey, outputAddress))
            {
                sAddress = QString::fromStdString(EncodeDestination(outputAddress));

                // if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs
                if (!treeMode || (!(sAddress == sWalletAddress)))
                    itemOutput->setText(COLUMN_ADDRESS, sAddress);
            }

            // label
            if (!(sAddress == sWalletAddress)) // change
            {
                // tooltip from where the change comes from
                itemOutput->setToolTip(COLUMN_LABEL, tr("change from %1 (%2)").arg(sWalletLabel).arg(sWalletAddress));
                itemOutput->setText(COLUMN_LABEL, tr("(change)"));
            }
            else if (!treeMode)
            {
                QString sLabel = model->getAddressTableModel()->labelForAddress(sAddress);
                if (sLabel.isEmpty())
                    sLabel = tr("(no label)");
                itemOutput->setText(COLUMN_LABEL, sLabel);
            }

            // amount
            itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->tx->vout[out.i].nValue));
            itemOutput->setData(COLUMN_AMOUNT, Qt::UserRole, QVariant((qlonglong)out.tx->tx->vout[out.i].nValue)); // padding so that sorting works correctly

            // date
            itemOutput->setText(COLUMN_DATE, GUIUtil::dateTimeStr(out.tx->GetTxTime()));
            itemOutput->setData(COLUMN_DATE, Qt::UserRole, QVariant((qlonglong)out.tx->GetTxTime()));

            // confirmations
            itemOutput->setText(COLUMN_CONFIRMATIONS, QString::number(out.nDepth));
            itemOutput->setData(COLUMN_CONFIRMATIONS, Qt::UserRole, QVariant((qlonglong)out.nDepth));

            // transaction hash
            uint256 txhash = out.tx->GetHash();
            itemOutput->setText(COLUMN_TXHASH, QString::fromStdString(txhash.GetHex()));

            // vout index
            itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i));

             // disable locked coins
//.........这里部分代码省略.........
开发者ID:admxjx,项目名称:bitcoin,代码行数:101,代码来源:coincontroldialog.cpp


示例14: switch

QVariant ServerItem::data(int column, int role) const {
	if (bParent) {
		if (column == 0) {
			switch (role) {
				case Qt::DisplayRole:
					return qsName;
				case Qt::DecorationRole:
					if (itType == FavoriteType)
						return loadIcon(QLatin1String("skin:emblems/emblem-favorite.svg"));
					else if (itType == LANType)
						return loadIcon(QLatin1String("skin:places/network-workgroup.svg"));
					else if (! qsCountryCode.isEmpty())
						return loadIcon(QString::fromLatin1(":/flags/%1.png").arg(qsCountryCode));
					else
						return loadIcon(QLatin1String("skin:categories/applications-internet.svg"));
			}
		}
	} else {
		if (role == Qt::DisplayRole) {
			switch (column) {
				case 0:
					return qsName;
				case 1:
					return (dPing > 0.0) ? QString::number(uiPing) : QVariant();
				case 2:
					return uiUsers ? QString::fromLatin1("%1/%2").arg(uiUsers).arg(uiMaxUsers) : QVariant();
			}
		} else if (role == Qt::ToolTipRole) {
			QStringList qsl;
			foreach(const QHostAddress &qha, qlAddresses)
				qsl << Qt::escape(qha.toString());

			double ploss = 100.0;

			if (uiSent > 0)
				ploss = (uiSent - qMin(uiRecv, uiSent)) * 100. / uiSent;

			QString qs;
			qs +=
			    QLatin1String("<table>") +
			    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Servername"), Qt::escape(qsName)) +
			    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Hostname"), Qt::escape(qsHostname));

			if (! qsBonjourHost.isEmpty())
				qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Bonjour name"), Qt::escape(qsBonjourHost));

			qs +=
			    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Port")).arg(usPort) +
			    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Addresses"), qsl.join(QLatin1String(", ")));

			if (! qsUrl.isEmpty())
				qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Website"), Qt::escape(qsUrl));

			if (uiSent > 0) {
				qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Packet loss"), QString::fromLatin1("%1% (%2/%3)").arg(ploss, 0, 'f', 1).arg(uiRecv).arg(uiSent));
				if (uiRecv > 0) {
					qs +=
					    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Ping (80%)"), ConnectDialog::tr("%1 ms").
					            arg(boost::accumulators::extended_p_square(* asQuantile)[1] / 1000., 0, 'f', 2)) +
					    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Ping (95%)"), ConnectDialog::tr("%1 ms").
					            arg(boost::accumulators::extended_p_square(* asQuantile)[2] / 1000., 0, 'f', 2)) +
					    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Bandwidth"), ConnectDialog::tr("%1 kbit/s").arg(uiBandwidth / 1000)) +
					    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Users"), QString::fromLatin1("%1/%2").arg(uiUsers).arg(uiMaxUsers)) +
					    QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>").arg(ConnectDialog::tr("Version")).arg(MumbleVersion::toString(uiVersion));
				}
			}
			qs += QLatin1String("</table>");
			return qs;
		} else if (role == Qt::BackgroundRole) {
开发者ID:qwestduck,项目名称:mumble,代码行数:69,代码来源:ConnectDialog.cpp


示例15: updatePassword

void MoodBoxServer::updatePassword(Callback callback, QString newPassword, QString oldPassword)
{
    updatePassword(callback, QVariant(), newPassword, oldPassword);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例16: getAuthTicket

void MoodBoxServer::getAuthTicket(Callback callback, QString login, QString password)
{
    getAuthTicket(callback, QVariant(), login, password);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例17: resetPassword

void MoodBoxServer::resetPassword(Callback callback, QString login)
{
    resetPassword(callback, QVariant(), login);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例18: createAccount

void MoodBoxServer::createAccount(Callback callback, UserAccount userAccount, QString inviteCode)
{
    createAccount(callback, QVariant(), userAccount, inviteCode);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例19: getContact

void MoodBoxServer::getContact(Callback callback, qint32 userId)
{
    getContact(callback, QVariant(), userId);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp


示例20: getUserInfo

void MoodBoxServer::getUserInfo(Callback callback, qint32 userId)
{
    getUserInfo(callback, QVariant(), userId);
}
开发者ID:ildus,项目名称:moodbox_aka_risovaska,代码行数:4,代码来源:moodboxserver.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QVariantList函数代码示例发布时间:2022-05-30
下一篇:
C++ QVERIFY2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap