#include <QtGlobal>
#include <QString>
#include <QList>
#include <QVector>
#include <QDomDocument>
#include <QObject>
#include <QRectF>
#include <QFlags>
#include <QStringList>
Go to the source code of this file.
Classes | |
class | PrivateDataT< Tx > |
flags operator More... | |
Namespaces | |
namespace | sx |
Global namespace. | |
Defines | |
#define | SX_SDKEXPORT |
Expanded to __declspec(dllexport) or __declspec(dllimport) in Windows platform when building dynamic library, empty in other platform. | |
#define | SX_GUISDKEXPORT |
#define | SX_DISABLE_COPY(Class) |
disable copy constructor (taken from qglobal.h) | |
#define | SXTR(s) QObject::tr((s)) |
String translation, link to QObject::tr(). | |
#define | SXIsPower2(num) ((num) != 0 && ((num) & ((num) - 1)) == 0) |
return true if given value is power of 2 | |
#define | SXDiffZero(n1, n2) ((n1) > (n2) ? (n1) - (n2) : 0) |
return 0 or diff | |
#define | SX_VERSION(sdk, major, minor) (((sdk) << 16) | ((major) << 8) | (minor)) |
version packing macro. | |
#define | SX_SDK_VERSION(ver) ((ver) >> 16) |
Extract sdk version from version info. | |
#define | SX_MAJOR_VERSION(ver) (((ver) >> 8) & 0x000000ff) |
Extract major version. | |
#define | SX_MINOR_VERSION(ver) ((ver) & 0x000000ff) |
Extract minor version. | |
Typedefs | |
typedef qptrdiff | sxint_t |
Alias to integer (32-bits / 64-bits). | |
typedef PrivateDataT< double > | PrivateDouble |
typedef PrivateDataT< char > | PrivateChar |
Enumerations | |
enum | DataType { TypeInvalid = 0x00, TypeBool = 0x01, TypeChar = 0x02, TypeShort = 0x04, TypeInt = 0x08, TypeFloat = 0x10, TypeDouble = 0x20, TypeSxInt = 0x40, TypeInt64 = 0x80, TypeUChar = 0x100, TypeUShort = 0x200, TypeUInt = 0x400, TypeUInt64 = 0x800 } |
enum | Position { Front = 1, Back } |
enum | RunMode { RunOnce = 1, RunCounted, RunTimed, RunForever } |
enum | MessageType { RegularMessage = -1, InfoMessage, WarningMessage, ErrorMessage, CriticalMessage } |
enum | { DecimalPrecission = 30 } |
Functions | |
template<typename Tx > | |
QDomElement | sx::appendSettingText (QDomElement &pn, const QString &cap, const Tx &val) |
Helper function to append setting to given xml element. | |
template<typename Tx > | |
QDomElement | sx::appendSettingCDATA (QDomElement &pn, const QString &cap, const Tx &val) |
template<typename Tx > | |
QDomElement | sx::appendSettingAttribute (QDomElement &pn, const QString &cap, const QString &attr, const Tx &val) |
Helper function to append setting to given xml element. | |
bool | sx::isInMainThread () |
check wheter we are in main thread or not | |
int | sx::version () |
sdk version | |
size_t | sx::nextPower2 (size_t sz) |
get nearest power 2 size (equal or greater than sz). | |
QString | sx::rectfToString (const QRectF &r) |
qrectf to string | |
QRectF | sx::stringToRectf (const QString &str) |
string to rectf | |
QString | sx::pointfToString (const QPointF &pt) |
pointf to string | |
QPointF | sx::stringToPointf (const QString &str) |
string to pointf | |
QString | sx::doubleToString (const double *db, int n, int precission=DecimalPrecission) |
convert double array to string, value separated with white space | |
QVector< double > | sx::stringToDouble (const QString &str) |
convert string to double values | |
QStringList | sx::dataTypes () |
return available data types | |
QString | sx::dataTypeToString (DataType tid) |
data type to string | |
DataType | sx::dataTypeFromString (const QString &tstr) |
string to data type |
#define SX_DISABLE_COPY | ( | Class | ) |
Value:
Class(const Class &); \ Class &operator=(const Class &);
#define SX_VERSION | ( | sdk, | |||
major, | |||||
minor | ) | (((sdk) << 16) | ((major) << 8) | (minor)) |
version packing macro.
Version is organized in 32-bit integer bit 31 - 16 : SDK Version bit 15 - 8 : Major Version (0 ~ 255) bit 7 - 8 : Minor Version (0 ~ 255)
Referenced by sx::version().
#define SXIsPower2 | ( | num | ) | ((num) != 0 && ((num) & ((num) - 1)) == 0) |
return true if given value is power of 2
num | number to test |