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


C++ QVariant::toULongLong方法代码示例

本文整理汇总了C++中QVariant::toULongLong方法的典型用法代码示例。如果您正苦于以下问题:C++ QVariant::toULongLong方法的具体用法?C++ QVariant::toULongLong怎么用?C++ QVariant::toULongLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QVariant的用法示例。


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

示例1: formatFromUnsignedInteger

/*
    Format a variant value as a string representation of an unsigned integer.
    This method was written to convert a QVariant of type ULongLong, but should cope with a variant of any type.
    First convert the variant value to an unsigned long. It may or may not be a ulonglong type variant. If it is - good,
    there will be no conversion problems.
    Then format it as a string using the formatting information stored in this class.
*/
void QEStringFormatting::formatFromUnsignedInteger( const QVariant &value ) {
    // Extract the value as an unsigned long using whatever conversion the QVariant uses.
    //
    // Note, this will not pick up if the QVariant type is not one of the types used to represent CA data.
    // This is OK as it is not absolutely nessesary to do this sort of check at this point. Also the code is more robust as it will
    // work if the range of QVariant types used expands.
    // Note, this does not give us the freedom to specify what conversions should fail or succeed. For example, does QVariant::toULongLong()
    // work if the value it holds is the string 1.000 and should it?
    // If QVariant::toULongLong() does not do exactly what is required, a switch statement for each of the types used to hold CA data
    // will need to be added and the conversions done  manually or using QVariant::toULongLong() as required.



    // Use QString conversions is variant is a string.
    // (QVariant toLongLong can't convert strings like "2.000"!)
    bool convertOk;
    unsigned long ulValue;
    if( value.type() == QVariant::String )
    {
        QString str = value.toString();
        double dd = str.toDouble( &convertOk );
        ulValue = dd;
    }

    // Use QVariant conversions otherwise
    else
    {
        ulValue = value.toULongLong( &convertOk );
    }

    if( !convertOk )
    {
        formatFailure( QString( "Warning from QEStringFormatting::formatFromUnsignedInteger(). A variant could not be converted to an unsigned long." ) );
        return;
    }

    // Generate the text
    stream << ulValue;

    // Add sperators if needs be
    outStr = insertSeparators( outStr );
}
开发者ID:rorydog1,项目名称:epics,代码行数:49,代码来源:QEStringFormatting.cpp

示例2: matches

bool QValueFilter::matches(const QVariant & value, int type) const
{
    Qt::CaseSensitivity s;
    Qt::MatchFlag mf;
    int t = type;
    if (t == -1){
        t = value.type();
    }
    switch(t)
    {
    case QVariant::Char:
        return value.toChar() == property("value").toChar();
    case QVariant::Date:
        return value.toDate() == property("value").toDate();
    case QVariant::DateTime:
        return value.toDateTime() == property("value").toDateTime();
    case QVariant::Double:
        return value.toDouble() == property("value").toDouble();
    case QVariant::Int:
        return value.toInt() == property("value").toInt();
    case QVariant::LongLong:
        return value.toLongLong() == property("value").toLongLong();
    case QVariant::String:
        s = static_cast<Qt::CaseSensitivity>(property("caseSensitivity", Qt::CaseInsensitive).toInt());
        mf = static_cast<Qt::MatchFlag>(property("matchFlag", Qt::MatchStartsWith).toInt());
        if (mf == Qt::MatchContains){
            return value.toString().contains(property("value").toString(), s);
        } else if (mf == Qt::MatchEndsWith){
            return QString::compare(value.toString().right(property("value").toString().length()), property("value").toString(), s) == 0;
        }
        return QString::compare(value.toString().left(property("value").toString().length()), property("value").toString(), s) == 0;
    case QVariant::Time:
        return value.toTime() == property("value").toTime();
    case QVariant::UInt:
        return value.toUInt() == property("value").toUInt();
    case QVariant::ULongLong:
        return value.toULongLong() == property("value").toULongLong();
    default:
        return value == property("value");
    }
    return false;
}
开发者ID:lit-uriy,项目名称:QAdvancedItemViews,代码行数:42,代码来源:qvaluefilter.cpp

示例3: pushVariant

LUA_INLINE void Lua::pushVariant(lua_State* L, const QVariant& v)
{
    switch (v.type()) {
    case QVariant::Invalid:
        lua_pushnil(L);
        break;
    case QVariant::Bool:
        lua_pushboolean(L, v.toBool());
        break;
    case QVariant::Int:
        lua_pushinteger(L, v.toInt());
        break;
    case QVariant::UInt:
        lua_pushunsigned(L, v.toUInt());
        break;
    case QVariant::LongLong:
        push(L, v.toLongLong());
        break;
    case QVariant::ULongLong:
        push(L, v.toULongLong());
        break;
    case QVariant::Double:
        lua_pushnumber(L, v.toDouble());
        break;
    case QVariant::Map:
        pushMap(L, v.toMap());
        break;
    case QVariant::List:
        pushList(L, v.toList());
        break;
    case QVariant::StringList:
        pushList(L, v.toStringList());
        break;
    case QVariant::ByteArray:
        push(L, v.toByteArray());
        break;
    default:
        push(L, v.toString());
        break;
    }
}
开发者ID:281627166,项目名称:NoahGameFrame,代码行数:41,代码来源:QtLuaIntf.cpp

示例4: getDatabaseRevision

bool SqlDataQuery::getDatabaseRevision(QSqlDatabase &connection,
        DataRevision *revision) {
    bool revisionOK = false;
    quint64 numericRevision = 0L;
    if (!m_revisionQuery.isEmpty()) {
        QVariant resultRevision;
        if (SqlQueryUtils().getSingleQueryValue(connection, m_revisionQuery,
                m_bindValues, "", &resultRevision, &m_error)) {
            // this code only supports numeric revisions; empty DataRevision returned otherwise.
            numericRevision = resultRevision.toULongLong(&revisionOK);
        } else {
            qWarning() << "Failed to fetch the database revision.";
            return false;
        }
    }
    *revision =
            revisionOK ?
                    DataRevision(new NumericRevision(numericRevision)) :
                    DataRevision();
    return true;
}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:21,代码来源:SqlDataQuery.cpp

示例5: _push

static void _push(lua_State *L, const QVariant & v)
{
    switch( v.type() )
    {
    case QVariant::Invalid:
        lua_pushnil( L );
        break;
    case QVariant::Bool:
        lua_pushboolean( L, v.toBool() );
        break;
    case QVariant::Int:
        lua_pushnumber( L, v.toInt() );
        break;
    case QVariant::Double:
        lua_pushnumber( L, v.toDouble() );
        break;
    case QVariant::LongLong:
        lua_pushnumber( L, v.toLongLong() );
        break;
    case QVariant::ULongLong:
        lua_pushnumber( L, (double)(quint32)v.toULongLong() );
        break;
    case QVariant::UInt:
        lua_pushnumber( L, v.toUInt() );
        break;
    case QVariant::Char:
        lua_pushnumber( L, v.toChar().unicode() );
        break;
    case QVariant::ByteArray:
        lua_pushstring( L, v.toByteArray() );
        break;
    case QVariant::String:
        lua_pushstring( L, v.toString().toLatin1() );
        break;
    default:
        lua_pushnil( L );
        break;
    }
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:39,代码来源:QtValue.cpp

示例6: setData

bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role )
{
    row=index.row();
    column=index.column();
    if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT)
        return false;

    transfertItem& item = transfertItemList[row];
    if(role==Qt::UserRole)
    {
        item.id=value.toULongLong();
        return true;
    }
    else if(role==Qt::DisplayRole)
    {
        switch(column)
        {
            case 0:
                item.source=value.toString();
                emit dataChanged(index,index);
                return true;
            break;
            case 1:
                item.size=value.toString();
                emit dataChanged(index,index);
                return true;
            break;
            case 2:
                item.destination=value.toString();
                emit dataChanged(index,index);
                return true;
            break;
            default:
            return false;
        }
    }
    return false;
}
开发者ID:dsferruzza,项目名称:Ultracopier,代码行数:38,代码来源:TransferModel.cpp

示例7: defaultColor

QColor VisualAttribute::value2color(const QVariant &var) const
{
    if ( !_domain.isValid()){ // the range case
        bool ok;
        double d = var.toDouble(&ok);
        if ( ok){
            double f = (d - _actualRange.min())/_actualRange.distance();
            int defColorSize = ColorRangeBase::defaultColorNames().size();
            int index = std::max(0.0,std::min((double)defColorSize-1, f * (defColorSize)));
            return ColorRangeBase::defaultColor(index);
        }
    }
    double v;
    if ( hasType(_domain->valueType(), itCONTINUOUSCOLOR)){
        return ColorRangeBase::toColor(var.toULongLong(), ColorRangeBase::cmRGBA);
    }else if ( hasType(_domain->ilwisType(), itNUMERICDOMAIN | itITEMDOMAIN)){
        v  =  var.toDouble();
    }else{
        v = tovalue(var.toString());
    }

    return _representation->colors()->value2color(v, _actualRange, _stretchRange) ;
}
开发者ID:ridoo,项目名称:IlwisCore,代码行数:23,代码来源:attributevisualproperties.cpp

示例8: setModelData

void IntegerWatchLineEdit::setModelData(const QVariant &v)
{
    if (debug)
        qDebug(">IntegerLineEdit::setModelData(%s, '%s'): base=%d, signed=%d, bigint=%d",
               v.typeName(), qPrintable(v.toString()),
               base(), isSigned(), isBigInt());
    switch (v.type()) {
    case QVariant::Int:
    case QVariant::LongLong: {
        const qint64 iv = v.toLongLong();
        setSigned(true);
        setText(QString::number(iv, base()));
    }
        break;
    case QVariant::UInt:
    case QVariant::ULongLong: {
         const quint64 iv = v.toULongLong();
         setSigned(false);
         setText(QString::number(iv, base()));
        }
        break;
    case QVariant::ByteArray:
        setNumberText(QString::fromLatin1(v.toByteArray()));
        break;
    case QVariant::String:
        setNumberText(v.toString());
        break;
    default:
        qWarning("Invalid value (%s) passed to IntegerLineEdit::setModelData",
                 v.typeName());
        setText(QString(QLatin1Char('0')));
        break;
    }
    if (debug)
        qDebug("<IntegerLineEdit::setModelData(): base=%d, signed=%d, bigint=%d",
               base(), isSigned(), isBigInt());
}
开发者ID:AltarBeastiful,项目名称:qt-creator,代码行数:37,代码来源:watchdelegatewidgets.cpp

示例9: AddWmdmItem

 static void AddWmdmItem(IWMDMMetaData* metadata, const wchar_t* name,
                         const QVariant& value) {
   switch (value.type()) {
     case QVariant::Int:
     case QVariant::UInt: {
       DWORD data = value.toUInt();
       metadata->AddItem(WMDM_TYPE_DWORD, name, (BYTE*)&data, sizeof(data));
       break;
     }
     case QVariant::String: {
       ScopedWCharArray data(value.toString());
       metadata->AddItem(WMDM_TYPE_STRING, name, (BYTE*)data.get(), data.bytes());
       break;
     }
     case QVariant::ByteArray: {
       QByteArray data = value.toByteArray();
       metadata->AddItem(WMDM_TYPE_BINARY, name, (BYTE*)data.constData(), data.size());
       break;
     }
     case QVariant::Bool: {
       int data = value.toBool();
       metadata->AddItem(WMDM_TYPE_BOOL, name, (BYTE*)&data, sizeof(data));
       break;
     }
     case QVariant::LongLong:
     case QVariant::ULongLong: {
       quint64 data = value.toULongLong();
       metadata->AddItem(WMDM_TYPE_QWORD, name, (BYTE*)&data, sizeof(data));
       break;
     }
     default:
       qLog(Warning) << "Type" << value.type() << "not handled";
       Q_ASSERT(0);
       break;
   }
 }
开发者ID:alanbriolat,项目名称:clementine-subsonic,代码行数:36,代码来源:song.cpp

示例10: winId

WId MInputContextConnection::winId()
{
#ifdef Q_WS_WIN
    WId result = 0;
    return result;
#else
    QVariant winIdVariant = widgetState[WinId];
    // after transfer by dbus type can change
    switch (winIdVariant.type()) {
    case QVariant::UInt:
        if (sizeof(uint) >= sizeof(WId))
            return winIdVariant.toUInt();
        break;
    case QVariant::ULongLong:
        if (sizeof(qulonglong) >= sizeof(WId))
            return winIdVariant.toULongLong();
        break;
    default:
        if (winIdVariant.canConvert<WId>())
            return winIdVariant.value<WId>();
    }
    return 0;
#endif
}
开发者ID:maliit,项目名称:inputcontext-qt4,代码行数:24,代码来源:minputcontextconnection.cpp

示例11: stringify

QString JSON::stringify(QVariant v){
    if (v.isNull()){
        return QLatin1String("null");
    }
    switch (v.type()) {
        case QVariant::Bool:
            return v.toBool()?QLatin1String("true"):QLatin1String("false");
            break;
        case QVariant::ULongLong:
        case QVariant::UInt:
            return QString::number(v.toULongLong());
            break;
        case QVariant::LongLong:
        case QVariant::Int:
            return QString::number(v.toLongLong());
            break;
        case QVariant::Double:
            return QString::number(v.toDouble());
            break;
        case QVariant::Map:
            {
                QString r=QLatin1String("{");
                QMap<QString, QVariant> map = v.toMap();
                QMapIterator<QString, QVariant> i(map);
                while (i.hasNext()){
                    i.next();
                    r+=QLatin1String("\"")+i.key()+ QLatin1String("\":") +stringify(i.value())+QLatin1String(",");
                }
                if(r.length()>1)
                    r.chop(1);
                r+=QLatin1String("}");
                return r;
            }
            break;
#if QT_VERSION >= 0x040500
        case QVariant::Hash:
            {
                QString r=QLatin1String("{");
                QHash<QString, QVariant> map = v.toHash();
                QHashIterator<QString, QVariant> i(map);
                while (i.hasNext()){
                    i.next();
                    r+=QLatin1String("\"")+i.key()+QLatin1String("\":")+stringify(i.value())+QLatin1String(",");
                }
                if(r.length()>1)
                    r.chop(1);
                r+=QLatin1String("}");
                return r;
            }
            break;
#endif
        case QVariant::StringList:
            {
                QString r=QLatin1String("[");
                QStringList l = v.toStringList();
                foreach(QString i, l){
                    r+=QLatin1String("\"")+i+QLatin1String("\",");
                }
                if(r.length()>1)
                    r.chop(1);
                r+=QLatin1String("]");
                return r;
            }
        case QVariant::List:
            {
                QString r=QLatin1String("[");
                QVariantList l = v.toList();
                foreach(QVariant i, l){
                    r+=stringify(i)+QLatin1String(",");
                }
                if(r.length()>1)
                    r.chop(1);
                r+=QLatin1String("]");
                return r;
            }
开发者ID:davidgraeff,项目名称:oldstuff,代码行数:75,代码来源:json.cpp

示例12: copyArgument

QT_BEGIN_NAMESPACE

static void copyArgument(void *to, int id, const QVariant &arg)
{
    if (id == arg.userType()) {
        switch (id) {
        case QVariant::Bool:
            *reinterpret_cast<bool *>(to) = arg.toBool();
            return;

        case QMetaType::UChar:
            *reinterpret_cast<uchar *>(to) = arg.value<uchar>();
            return;

        case QMetaType::Short:
            *reinterpret_cast<short *>(to) = arg.value<short>();
            return;

        case QMetaType::UShort:
            *reinterpret_cast<ushort *>(to) = arg.value<ushort>();
            return;

        case QVariant::Int:
            *reinterpret_cast<int *>(to) = arg.toInt();
            return;

        case QVariant::UInt:
            *reinterpret_cast<uint *>(to) = arg.toUInt();
            return;

        case QVariant::LongLong:
            *reinterpret_cast<qlonglong *>(to) = arg.toLongLong();
            return;

        case QVariant::ULongLong:
            *reinterpret_cast<qulonglong *>(to) = arg.toULongLong();
            return;

        case QVariant::Double:
            *reinterpret_cast<double *>(to) = arg.toDouble();
            return;

        case QVariant::String:
            *reinterpret_cast<QString *>(to) = arg.toString();
            return;

        case QVariant::ByteArray:
            *reinterpret_cast<QByteArray *>(to) = arg.toByteArray();
            return;

        case QVariant::StringList:
            *reinterpret_cast<QStringList *>(to) = arg.toStringList();
            return;
        }

        if (id == QDBusMetaTypeId::variant) {
            *reinterpret_cast<QDBusVariant *>(to) = arg.value<QDBusVariant>();
            return;
        } else if (id == QDBusMetaTypeId::objectpath) {
            *reinterpret_cast<QDBusObjectPath *>(to) = arg.value<QDBusObjectPath>();
            return;
        } else if (id == QDBusMetaTypeId::signature) {
            *reinterpret_cast<QDBusSignature *>(to) = arg.value<QDBusSignature>();
            return;
        }

        // those above are the only types possible
        // the demarshaller code doesn't demarshall anything else
        qFatal("Found a decoded basic type in a D-Bus reply that shouldn't be there");
    }

    // if we got here, it's either an un-dermarshalled type or a mismatch
    if (arg.userType() != QDBusMetaTypeId::argument) {
        // it's a mismatch
        //qWarning?
        return;
    }

    // is this type registered?
    const char *userSignature = QDBusMetaType::typeToSignature(id);
    if (!userSignature || !*userSignature) {
        // type not registered
        //qWarning?
        return;
    }

    // is it the same signature?
    QDBusArgument dbarg = arg.value<QDBusArgument>();
    if (dbarg.currentSignature() != QLatin1String(userSignature)) {
        // not the same signature, another mismatch
        //qWarning?
        return;
    }

    // we can demarshall
    QDBusMetaType::demarshall(dbarg, id, to);
}
开发者ID:sicily,项目名称:qt4.8.4,代码行数:97,代码来源:qdbusinterface.cpp

示例13: print_ulonglong

void print_ulonglong(QString const &name, QVariant const &value) {
    qDebug() << "Got " << name << "=" << value.toULongLong() << "\n";
}
开发者ID:deztructor,项目名称:contextkit-battery-n950-n9,代码行数:3,代码来源:battest.cpp

示例14: setOptions

void QtCUrl::setOptions(Options& opt) {
	Options defaults;
    //defaults[CURLOPT_FAILONERROR] = true;
	defaults[CURLOPT_ERRORBUFFER].setValue(_errorBuffer);

    if(FileName.isEmpty())
    {
        defaults[CURLOPT_WRITEFUNCTION].setValue(&writer);
        defaults[CURLOPT_WRITEDATA].setValue(&_buffer);
    }else
    {
        File.setFileName(FileName);

        defaults[CURLOPT_WRITEFUNCTION].setValue(&writer_file);
        defaults[CURLOPT_WRITEDATA].setValue(&File);
    }

    defaults[CURLOPT_PROGRESSFUNCTION].setValue(&progress_callback);
    defaults[CURLOPT_PROGRESSDATA].setValue(&AutoDelete);

    defaults[CURLOPT_NOPROGRESS].setValue(0);

    defaults[CURLOPT_SSL_VERIFYPEER].setValue(false);
    defaults[CURLOPT_SSL_VERIFYHOST].setValue(false);

    if(!Filter.isEmpty())
    {
        //defaults[CURLOPT_VERBOSE].setValue(1);
        defaults[CURLOPT_HEADERFUNCTION].setValue(&writer2);
        defaults[CURLOPT_WRITEHEADER].setValue(&_buffer_and_filter);
    }
    //defaults[CURLOPT_VERBOSE].setValue(1);



#ifdef QTCURL_DEBUG
	curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1);
	curl_easy_setopt(_curl, CURLOPT_DEBUGFUNCTION, trace);
#endif

	OptionsIterator i(defaults);

	while (i.hasNext()) {
		i.next();

		if (! opt.contains(i.key())) {
			opt[i.key()] = i.value();
		}
	}

    if(opt.contains(CURLOPT_POSTFIELDSIZE))
    {
        int val = opt[CURLOPT_POSTFIELDSIZE].toInt();
        curl_easy_setopt(_curl, CURLOPT_POSTFIELDSIZE, (long)val);
    }

	i = opt;

	while (i.hasNext()) {
		i.next();
		QVariant value = i.value();


        if(i.key() == CURLOPT_POSTFIELDSIZE)
        {
            continue;
        }

		switch (value.type()) {
			case QVariant::Bool:
			case QVariant::Int: {
				int val = value.toInt();
				curl_easy_setopt(_curl, i.key(), val);
				break;
			}
			case QVariant::ByteArray: {
				QByteArray ba = value.toByteArray();
				curl_easy_setopt(_curl, i.key(), ba.constData());
				break;
			}
			case QVariant::Url: {
				QByteArray ba = value.toUrl().toEncoded();
				curl_easy_setopt(_curl, i.key(), ba.constData());
				break;
			}
			case QVariant::String: {
                curl_easy_setopt(_curl, i.key(), value.toString().toUtf8().data());
				break;
			}
			case QVariant::ULongLong: {
				qulonglong val = value.toULongLong();
				curl_easy_setopt(_curl, i.key(), (void*) val);
				break;
			}
			case QVariant::StringList: {
				struct curl_slist *slist = NULL;
				foreach (const QString &tmp, value.toStringList()) {
					 slist = curl_slist_append(slist, tmp.toUtf8().data());
				}
				_slist.append(slist);
//.........这里部分代码省略.........
开发者ID:bablosoft,项目名称:BAS,代码行数:101,代码来源:QtCUrl.cpp

示例15: lqtL_qvariant_value

int lqtL_qvariant_value(lua_State *L) {
	QVariant* self = static_cast<QVariant*>(lqtL_toudata(L, 1, "QVariant*"));
	lqtL_selfcheck(L, self, "QVariant");
	QVariant::Type type;
	if (lua_isnoneornil(L, 2)) {
		type = self->type();
	} else {
		type = (QVariant::Type)lqtL_toenum(L, 2, "QVariant.Type");
		const char * currentType = self->typeName();
		if (!self->canConvert(type) || !self->convert(type)) {
			lua_pushnil(L);
			lua_pushfstring(L, "cannot convert %s to %s", currentType, self->typeToName(type));
			return 2;
		}
	}
	switch (self->type()) {
		case QVariant::Invalid: lua_pushnil(L); return 1;
		/* basic types */
		case QVariant::Bool: lua_pushboolean(L, self->toBool()); return 1;
		case QVariant::Double: lua_pushnumber(L, self->toDouble()); return 1;
		case QVariant::Int: lua_pushinteger(L, self->toInt()); return 1;
		case QVariant::UInt: lua_pushinteger(L, self->toUInt()); return 1;
		case QVariant::LongLong: lua_pushnumber(L, self->toLongLong()); return 1;
		case QVariant::ULongLong: lua_pushnumber(L, self->toULongLong()); return 1;
		case QVariant::ByteArray: {
			const QByteArray &ba = self->toByteArray();
			lua_pushlstring(L, ba.data(), ba.size());
			return 1;
		};
		/* QtCore types */
		case QVariant::BitArray: lqtL_passudata(L, new QBitArray(self->value<QBitArray>()), "QBitArray*"); return 1;
		case QVariant::Char: lqtL_passudata(L, new QChar(self->value<QChar>()), "QChar*"); return 1;
		case QVariant::Date: lqtL_passudata(L, new QDate(self->value<QDate>()), "QDate*"); return 1;
		case QVariant::DateTime: lqtL_passudata(L, new QDateTime(self->value<QDateTime>()), "QDateTime*"); return 1;
		case QVariant::KeySequence: lqtL_passudata(L, new QKeySequence(self->value<QKeySequence>()), "QKeySequence*"); return 1;
		case QVariant::Line: lqtL_passudata(L, new QLine(self->value<QLine>()), "QLine*"); return 1;
		case QVariant::LineF: lqtL_passudata(L, new QLineF(self->value<QLineF>()), "QLineF*"); return 1;
		case QVariant::List: lqtL_passudata(L, new QList<QVariant>(self->toList()), "QList<QVariant>*"); return 1;
		case QVariant::Locale: lqtL_passudata(L, new QLocale(self->value<QLocale>()), "QLocale*"); return 1;
		case QVariant::Point: lqtL_passudata(L, new QPoint(self->value<QPoint>()), "QPoint*"); return 1;
		case QVariant::PointF: lqtL_passudata(L, new QPointF(self->value<QPointF>()), "QPointF*"); return 1;
		case QVariant::Rect: lqtL_passudata(L, new QRect(self->value<QRect>()), "QRect*"); return 1;
		case QVariant::RectF: lqtL_passudata(L, new QRectF(self->value<QRectF>()), "QRectF*"); return 1;
		case QVariant::RegExp: lqtL_passudata(L, new QRegExp(self->value<QRegExp>()), "QRegExp*"); return 1;
		case QVariant::Size: lqtL_passudata(L, new QSize(self->value<QSize>()), "QSize*"); return 1;
		case QVariant::SizeF: lqtL_passudata(L, new QSizeF(self->value<QSizeF>()), "QSizeF*"); return 1;
		case QVariant::String: lqtL_passudata(L, new QString(self->value<QString>()), "QString*"); return 1;
		case QVariant::StringList: lqtL_passudata(L, new QStringList(self->value<QStringList>()), "QStringList*"); return 1;
		case QVariant::Time: lqtL_passudata(L, new QTime(self->value<QTime>()), "QTime*"); return 1;
		case QVariant::Url: lqtL_passudata(L, new QUrl(self->value<QUrl>()), "QUrl*"); return 1;
#ifdef MODULE_qtgui
		/* QtGui types */
		case QVariant::Bitmap: lqtL_passudata(L, new QBitmap(self->value<QBitmap>()), "QBitmap*"); return 1;
		case QVariant::Brush: lqtL_passudata(L, new QBrush(self->value<QBrush>()), "QBrush*"); return 1;
		case QVariant::Color: lqtL_passudata(L, new QColor(self->value<QColor>()), "QColor*"); return 1;
		case QVariant::Cursor: lqtL_passudata(L, new QCursor(self->value<QCursor>()), "QCursor*"); return 1;
		case QVariant::Font: lqtL_passudata(L, new QFont(self->value<QFont>()), "QFont*"); return 1;
		case QVariant::Icon: lqtL_passudata(L, new QIcon(self->value<QIcon>()), "QIcon*"); return 1;
		case QVariant::Image: lqtL_passudata(L, new QImage(self->value<QImage>()), "QImage*"); return 1;
		case QVariant::Matrix: lqtL_passudata(L, new QMatrix(self->value<QMatrix>()), "QMatrix*"); return 1;
		case QVariant::Matrix4x4: lqtL_passudata(L, new QMatrix4x4(self->value<QMatrix4x4>()), "QMatrix4x4*"); return 1;
		case QVariant::Palette: lqtL_passudata(L, new QPalette(self->value<QPalette>()), "QPalette*"); return 1;
		case QVariant::Pen: lqtL_passudata(L, new QPen(self->value<QPen>()), "QPen*"); return 1;
		case QVariant::Pixmap: lqtL_passudata(L, new QPixmap(self->value<QPixmap>()), "QPixmap*"); return 1;
		case QVariant::Polygon: lqtL_passudata(L, new QPolygon(self->value<QPolygon>()), "QPolygon*"); return 1;
		case QVariant::Quaternion: lqtL_passudata(L, new QQuaternion(self->value<QQuaternion>()), "QQuaternion*"); return 1;
		case QVariant::Region: lqtL_passudata(L, new QRegion(self->value<QRegion>()), "QRegion*"); return 1;
		case QVariant::SizePolicy: lqtL_passudata(L, new QSizePolicy(self->value<QSizePolicy>()), "QSizePolicy*"); return 1;
		case QVariant::Transform: lqtL_passudata(L, new QTransform(self->value<QTransform>()), "QTransform*"); return 1;
		case QVariant::TextFormat: lqtL_passudata(L, new QTextFormat(self->value<QTextFormat>()), "QTextFormat*"); return 1;
		case QVariant::TextLength: lqtL_passudata(L, new QTextLength(self->value<QTextLength>()), "QTextLength*"); return 1;
		case QVariant::Vector2D: lqtL_passudata(L, new QVector2D(self->value<QVector2D>()), "QVector2D*"); return 1;
		case QVariant::Vector3D: lqtL_passudata(L, new QVector3D(self->value<QVector3D>()), "QVector3D*"); return 1;
		case QVariant::Vector4D: lqtL_passudata(L, new QVector4D(self->value<QVector4D>()), "QVector4D*"); return 1;
#endif
	}
	return 0;
}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:78,代码来源:lqt_qt.cpp


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