Qt 4.8
Classes | Functions
qtestdata.h File Reference
#include <QtTest/qtest_global.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qstring.h>

Go to the source code of this file.

Classes

class  QTestData
 

Functions

template<typename T >
QTestDataoperator<< (QTestData &data, const T &value)
 
QTestDataoperator<< (QTestData &data, const char *value)
 

Function Documentation

◆ operator<<() [1/2]

template<typename T >
QTestData& operator<< ( QTestData data,
const T &  value 
)

Definition at line 80 of file qtestdata.h.

81 {
82  data.append(qMetaTypeId<T>(), &value);
83  return data;
84 }
static const char * data(const QByteArray &arr)
void append(int type, const void *data)
Definition: qtestdata.cpp:86

◆ operator<<() [2/2]

QTestData& operator<< ( QTestData data,
const char *  value 
)
inline

Definition at line 86 of file qtestdata.h.

87 {
88  QString str = QString::fromAscii(value);
89  data.append(QMetaType::QString, &str);
90  return data;
91 }
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const char * data(const QByteArray &arr)
void append(int type, const void *data)
Definition: qtestdata.cpp:86