42 #include "private/qdeclarativestringconverters_p.h" 44 #include <QtGui/qcolor.h> 45 #include <QtGui/qvector3d.h> 46 #include <QtCore/qpoint.h> 47 #include <QtCore/qrect.h> 48 #include <QtCore/qsize.h> 49 #include <QtCore/qvariant.h> 50 #include <QtCore/qdatetime.h> 57 if (c >=
'0' && c <=
'9')
59 else if (c >=
'A' && c <=
'F')
60 rv += (c -
'A' + 10) * 16;
61 else if (c >=
'a' && c <=
'f')
62 rv += (c -
'a' + 10) * 16;
64 if (c2 >=
'0' && c2 <=
'9')
66 else if (c2 >=
'A' && c2 <=
'F')
67 rv += (c2 -
'A' + 10);
68 else if (c2 >=
'a' && c2 <=
'f')
69 rv += (c2 -
'a' + 10);
101 int qRoundDouble(
double d)
103 return d >= double(0.0) ? int(d +
double(0.5)) : int(d -
int(d-1) +
double(0.5)) + int(d-1);
108 switch (preferredType) {
115 #ifndef QT_NO_DATESTRING 122 #endif // QT_NO_DATESTRING 151 return QColor(r, g, b, a);
159 #ifndef QT_NO_DATESTRING 180 #endif // QT_NO_DATESTRING 195 if (!xGood || !yGood) {
203 return QPointF(xCoord, yCoord);
219 if (!wGood || !hGood) {
227 return QSizeF(width, height);
239 bool xGood, yGood, wGood, hGood;
247 if (!xGood || !yGood || !wGood || !hGood) {
255 return QRectF(x, y, width, height);
267 bool xGood, yGood, zGood;
273 if (!xGood || !yGood || !zGood) {
281 return QVector3D(xCoord, yCoord, zCoord);
The QVariant class acts like a union for the most common Qt data types.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QVector3D class represents a vector or vertex in 3D space.
QColor Q_DECLARATIVE_PRIVATE_EXPORT colorFromString(const QString &, bool *ok=0)
#define QT_END_NAMESPACE
This macro expands to.
const QChar at(int i) const
Returns the character at the given index position in the string.
bool isValid() const
Returns true if this date is valid; otherwise returns false.
int length() const
Returns the number of characters in this string.
The QPointF class defines a point in the plane using floating point precision.
QVector3D Q_DECLARATIVE_PRIVATE_EXPORT vector3DFromString(const QString &, bool *ok=0)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
bool isValid() const
Returns true if both the date and the time are valid; otherwise returns false.
The QDate class provides date functions.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
QDateTime Q_DECLARATIVE_PRIVATE_EXPORT dateTimeFromString(const QString &, bool *ok=0)
The QSizeF class defines the size of a two-dimensional object using floating point precision...
QRectF Q_DECLARATIVE_PRIVATE_EXPORT rectFFromString(const QString &, bool *ok=0)
static QDateTime fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the QDateTime represented by the string, using the format given, or an invalid datetime if th...
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QPointF Q_DECLARATIVE_PRIVATE_EXPORT pointFFromString(const QString &, bool *ok=0)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QVariant Q_DECLARATIVE_PRIVATE_EXPORT variantFromString(const QString &)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
static QTime fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the time represented in the string as a QTime using the format given, or an invalid time if t...
char toAscii() const
Returns the character value of the QChar obtained using the current codec used to read C strings...
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QSizeF Q_DECLARATIVE_PRIVATE_EXPORT sizeFFromString(const QString &, bool *ok=0)
The QDateTime class provides date and time functions.
static uchar fromHex(const uchar c, const uchar c2)
static QDate fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the QDate represented by the string, using the format given, or an invalid date if the string...
double toDouble(bool *ok=0) const
Returns the string converted to a double value.
bool isValid() const
Returns true if the color is valid; otherwise returns false.
QTime Q_DECLARATIVE_PRIVATE_EXPORT timeFromString(const QString &, bool *ok=0)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QDate Q_DECLARATIVE_PRIVATE_EXPORT dateFromString(const QString &, bool *ok=0)
bool isValid() const
Returns true if the time is valid; otherwise returns false.