Commit b747207d authored by Acker's avatar Acker

init commit

parents
Pipeline #8088 failed with stage
in 15 seconds
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
# TopLinker
# ----------------------------------------------------------------------------
**/dist/
!party3/QtitanDataGrid/bin/QtitanBase*.dll
!party3/QtitanDataGrid/bin/QtitanBase*.pdb
!party3/QtitanDataGrid/bin/QtitanGrid*.dll
!party3/QtitanDataGrid/bin/QtitanGrid*.pdb
!party3/QtitanDataGrid/bin/libQtitanBase.so.1.0.0
!party3/QtitanDataGrid/bin/libQtitanGrid.so.5.22.0
party3/QtitanDataGrid/bin/QtitanGridd5.exp
!src/lib/*.qm
# SINCPM
sincpm-lock.json
# Stages
stages:
- build
- test
- publish
# Cache
cache:
paths:
- dist/
# Jobs
windows_develop:
stage: build
only:
- develop
tags:
- windows7_cd
variables:
QT_BIN: C:/DevTools/Qt5.6.3/5.6.3/msvc2015/bin
QTCREATOR_BIN: C:/DevTools/Qt5.6.3/Tools/QtCreator/bin
script:
- python ci/build.py -p %CI_PROJECT_DIR%/src/%CI_PROJECT_NAME%.pro -b %CI_PROJECT_DIR%/build/%CI_COMMIT_REF_NAME%/%CI_JOB_NAME% -m release
linux_develop:
stage: build
only:
- develop
tags:
- centos6_cd
variables:
QT_BIN: /opt/Qt5.6.3/5.6.3/gcc_64/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
windows_master:
stage: build
only:
- master
tags:
- windows7_cd
variables:
QT_BIN: C:/DevTools/Qt5.6.3/5.6.3/msvc2015/bin
QTCREATOR_BIN: C:/DevTools/Qt5.6.3/Tools/QtCreator/bin
script:
- python ci/build.py -p %CI_PROJECT_DIR%/src/%CI_PROJECT_NAME%.pro -b %CI_PROJECT_DIR%/build/%CI_COMMIT_REF_NAME%/%CI_JOB_NAME% -m release
- python ci/build.py -p %CI_PROJECT_DIR%/src/%CI_PROJECT_NAME%.pro -b %CI_PROJECT_DIR%/build/%CI_COMMIT_REF_NAME%/%CI_JOB_NAME% -m debug
- python ci/publish.py -p topikm6-mqtt
- python ci/publish.py -p topikm6-mqtt-debug
linux_master:
stage: build
only:
- master
tags:
- centos6_cd
variables:
QT_BIN: /opt/Qt5.6.3/5.6.3/gcc_64/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
- python ci/publish.py -p topikm6-mqtt
# topikm6-twidget
[![pipeline status](http://gitlab.topibd.net/topikm6/topikm6-twidget/badges/master/pipeline.svg)](http://gitlab.topibd.net/topikm6/topikm6-twidget/commits/master)
[![pipeline status](http://gitlab.topibd.net/topikm6/topikm6-twidget/badges/develop/pipeline.svg)](http://gitlab.topibd.net/topikm6/topikm6-twidget/commits/develop)
## 如何发布?
### CI发布(推荐)
默认规则:当将代码从develop分支合并到master分支,进行包发布。
0. 修改sincpm.json中的版本号
1. 修改src/lib/lib.pro中的版本号
2. 在CHANGELOG.md中添加新版本的发布日志
3. 将代码从develop分支合并到master分支
### 手动发布(不推荐)
0. (若未安装sincpm) 安装[sincpm](http://gitlab.topibd.net/topsin/topsin-sincpm/releases),配置好环境变量
1. 修改sincpm.json中的版本号
2. 修改src/lib/lib.pro中的版本号
3. 在CHANGELOG.md中添加新版本的发布日志
4. 在根目录下打包
```bash
sincpm package xxx
sincpm package xxx-debug
```
5. 在sincpm的local目录下上传包,例如
```bash
cd local
cd xxx
sincpm upload [xxx]-[1.0.0]-[windows-x86-msvc2015]-[qt5.6.3]
```
\ No newline at end of file
'''
@File: build.py
@Description: CI Build Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 08:53:45
'''
import argparse
import sys
import qtciutil
import os
import subprocess
def sincpm_bin(cmd):
return qtciutil.common_cmd('SINCPM_BIN', cmd)
def sincpm_update():
# check sincpm.json if exists
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
filepath = os.path.join(ci_script_dir, "../sincpm.json")
if not os.path.isfile(filepath):
raise qtciutil.QtCiUtilError("no sincpm.json found.")
# get platform infomation
qt_verison_str = qtciutil.qt_version()
qmake_spec_str = qtciutil.qmake_spec()
compiler_str = qmake_spec_str.split('-')[1]
if compiler_str == 'g++':
compiler_str = 'gcc'
os_system = qtciutil.platform_system()
arch_str = 'x64'
if os_system == 'windows':
arch_str = 'x86'
# sincpm update
update_args = [sincpm_bin('sincpm'), 'update']
update_args.append('--os=%s' % os_system)
update_args.append('--qt=%s' % qt_verison_str)
update_args.append('--compiler=%s' % compiler_str)
update_args.append('--arch=%s' % arch_str)
print("update_args: ", update_args)
pinfo = subprocess.run(update_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("sincpm update failed.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build Arg Parser')
parser.add_argument('--pro_file', '-p', type=str, required=True,
help='pro path', metavar='$CI_PROJECT_DIR/src/something.pro')
parser.add_argument('--build_dir', '-b', type=str, required=True,
help='build directory', metavar='$CI_PROJECT_DIR/build')
parser.add_argument('--mode', '-m', type=str, required=True,
help='debug or release', metavar='release')
args = vars(parser.parse_args())
pro_file = args['pro_file']
build_dir = args['build_dir']
mode = args['mode']
sincpm_update()
qtciutil.build(pro_file, build_dir, mode)
'''
@File: publish.py
@Description: CI Publish Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 14:05:07
'''
import platform
import os
import argparse
import sys
import subprocess
import glob
import re
import json
import qtciutil
def sincpm_bin(cmd):
return qtciutil.common_cmd('SINCPM_BIN', cmd)
def sincpm_publish(pkg_name):
# check sincpm.json if exists
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
filepath = os.path.join(ci_script_dir, "../sincpm.json")
if not os.path.isfile(filepath):
raise qtciutil.QtCiUtilError("no sincpm.json found.")
# get platform infomation
qt_verison_str = qtciutil.qt_version()
qmake_spec_str = qtciutil.qmake_spec()
compiler_str = qmake_spec_str.split('-')[1]
if compiler_str == 'g++':
compiler_str = 'gcc'
os_system = qtciutil.platform_system()
arch_str = 'x64'
if os_system == 'windows':
arch_str = 'x86'
# sincpm package
package_args = [sincpm_bin('sincpm'), 'package']
package_args.append('--os=%s' % os_system)
package_args.append('--qt=%s' % qt_verison_str)
package_args.append('--compiler=%s' % compiler_str)
package_args.append('--arch=%s' % arch_str)
package_args.append(pkg_name)
print("package_args: ", package_args)
pinfo = subprocess.run(package_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("sincpm pakcage failed.")
output = pinfo.stdout.decode('utf-8')
print("sincpm pakcage output: %s" % output)
m = re.search(r'package to "(.*)/(.*)"', output)
if not m:
raise qtciutil.QtCiUtilError("sincpm package failed. No expected output.")
# sincpm upload
local_dir = m.group(1)
pkg_dir = m.group(2)
os.chdir(local_dir)
pinfo = subprocess.run([sincpm_bin('sincpm'), 'upload', pkg_dir],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("sincpm upload failed.")
m = re.search(r'error: ', pinfo.stdout.decode('utf-8'), re.IGNORECASE)
if m:
raise qtciutil.QtCiUtilError("The upload result contains an error message. %s" % pinfo.stdout.decode('utf-8'))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Publish Arg Parser')
parser.add_argument('--package_name', '-p', type=str, required=True,
help='package name', metavar='topikm6-tpm')
args = vars(parser.parse_args())
package_name = args['package_name']
sincpm_publish(package_name)
print("Successfully published.")
\ No newline at end of file
'''
@File: test.py
@Description: CI Test Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 14:04:39
'''
import argparse
import qtciutil
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build Arg Parser')
parser.add_argument('--pro_file', '-p', type=str, required=True,
help='pro path', metavar='$CI_PROJECT_DIR/test/something.pro')
parser.add_argument('--build_dir', '-b', type=str, required=True,
help='build directory', metavar='$CI_PROJECT_DIR/build')
parser.add_argument('--dist_dir', '-d', type=str, required=True,
help='dist directory', metavar='$CI_PROJECT_DIR/dist')
args = vars(parser.parse_args())
pro_file = args['pro_file']
build_dir = args['build_dir']
dist_dir = args['dist_dir']
qtciutil.unit_test(pro_file, build_dir, dist_dir)
\ No newline at end of file
/*
* qmqtt.h - qmqtt library heaer
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_H
#define QMQTT_H
#include "qmqtt_message.h"
#include "qmqtt_client.h"
#endif // QMQTT_H
/*
* qmqtt_client.h - qmqtt client header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_CLIENT_H
#define QMQTT_CLIENT_H
#include "qmqtt_global.h"
#include <QObject>
#include <QString>
#include <QHostAddress>
#include <QByteArray>
#include <QAbstractSocket>
#include <QScopedPointer>
#ifdef QT_WEBSOCKETS_LIB
#include <QWebSocket>
#endif // QT_WEBSOCKETS_LIB
#ifndef QT_NO_SSL
QT_FORWARD_DECLARE_CLASS(QSslConfiguration)
#endif // QT_NO_SSL
namespace QMQTT {
static const quint8 LIBRARY_VERSION_MAJOR = 0;
static const quint8 LIBRARY_VERSION_MINOR = 3;
static const quint8 LIBRARY_VERSION_REVISION = 1;
//static const char* LIBRARY_VERSION = "0.3.1";
enum MQTTVersion
{
V3_1_0 = 3,
V3_1_1 = 4
};
enum ConnectionState
{
STATE_INIT = 0,
STATE_CONNECTING,
STATE_CONNECTED,
STATE_DISCONNECTED
};
enum ClientError
{
UnknownError = 0,
SocketConnectionRefusedError,
SocketRemoteHostClosedError,
SocketHostNotFoundError,
SocketAccessError,
SocketResourceError,
SocketTimeoutError,
SocketDatagramTooLargeError,
SocketNetworkError,
SocketAddressInUseError,
SocketAddressNotAvailableError,
SocketUnsupportedSocketOperationError,
SocketUnfinishedSocketOperationError,
SocketProxyAuthenticationRequiredError,
SocketSslHandshakeFailedError,
SocketProxyConnectionRefusedError,
SocketProxyConnectionClosedError,
SocketProxyConnectionTimeoutError,
SocketProxyNotFoundError,
SocketProxyProtocolError,
SocketOperationError,
SocketSslInternalError,
SocketSslInvalidUserDataError,
SocketTemporaryError,
MqttUnacceptableProtocolVersionError=1<<16,
MqttIdentifierRejectedError,
MqttServerUnavailableError,
MqttBadUserNameOrPasswordError,
MqttNotAuthorizedError,
MqttNoPingResponse
};
class ClientPrivate;
class Message;
class Frame;
class NetworkInterface;
class Q_MQTT_EXPORT Client : public QObject
{
Q_OBJECT
Q_PROPERTY(quint16 _port READ port WRITE setPort)
Q_PROPERTY(QHostAddress _host READ host WRITE setHost)
Q_PROPERTY(QString _hostName READ hostName WRITE setHostName)
Q_PROPERTY(QString _clientId READ clientId WRITE setClientId)
Q_PROPERTY(QString _username READ username WRITE setUsername)
Q_PROPERTY(QByteArray _password READ password WRITE setPassword)
Q_PROPERTY(quint16 _keepAlive READ keepAlive WRITE setKeepAlive)
Q_PROPERTY(MQTTVersion _version READ version WRITE setVersion)
Q_PROPERTY(bool _autoReconnect READ autoReconnect WRITE setAutoReconnect)
Q_PROPERTY(int _autoReconnectInterval READ autoReconnectInterval WRITE setAutoReconnectInterval)
Q_PROPERTY(bool _cleanSession READ cleanSession WRITE setCleanSession)
Q_PROPERTY(QString _willTopic READ willTopic WRITE setWillTopic)
Q_PROPERTY(quint8 _willQos READ willQos WRITE setWillQos)
Q_PROPERTY(bool _willRetain READ willRetain WRITE setWillRetain)
Q_PROPERTY(QByteArray _willMessage READ willMessage WRITE setWillMessage)
Q_PROPERTY(QString _connectionState READ connectionState)
public:
Client(const QHostAddress& host = QHostAddress::LocalHost,
const quint16 port = 1883,
QObject* parent = NULL);
#ifndef QT_NO_SSL
Client(const QString& hostName,
const quint16 port,
const QSslConfiguration& config,
const bool ignoreSelfSigned=false,
QObject* parent = NULL);
#endif // QT_NO_SSL
// This function is provided for backward compatibility with older versions of QMQTT.
// If the ssl parameter is true, this function will load a private key ('cert.key') and a local
// certificate ('cert.crt') from the current working directory. It will also set PeerVerifyMode
// to None. This may not be the safest way to set up a SSL connection.
Client(const QString& hostName,
const quint16 port,
const bool ssl,
const bool ignoreSelfSigned,
QObject* parent = NULL);
#ifdef QT_WEBSOCKETS_LIB
// Create a connection over websockets
Client(const QString& url,
const QString& origin,
QWebSocketProtocol::Version version,
bool ignoreSelfSigned = false,
QObject* parent = NULL);
Client(const QString& url,
const QString& origin,
QWebSocketProtocol::Version version,
const QSslConfiguration& config,
const bool ignoreSelfSigned = false,
QObject* parent = NULL);
#endif // QT_WEBSOCKETS_LIB
// for testing purposes only
Client(NetworkInterface* network,
const QHostAddress& host = QHostAddress::LocalHost,
const quint16 port = 1883,
QObject* parent = NULL);
virtual ~Client();
QHostAddress host() const;
QString hostName() const;
quint16 port() const;
QString clientId() const;
QString username() const;
QByteArray password() const;
QMQTT::MQTTVersion version() const;
quint16 keepAlive() const;
bool cleanSession() const;
bool autoReconnect() const;
int autoReconnectInterval() const;
ConnectionState connectionState() const;
QString willTopic() const;
quint8 willQos() const;
bool willRetain() const;
QByteArray willMessage() const;
bool isConnectedToHost() const;
public slots:
void setHost(const QHostAddress& host);
void setHostName(const QString& hostName);
void setPort(const quint16 port);
void setClientId(const QString& clientId);
void setUsername(const QString& username);
void setPassword(const QByteArray& password);
void setVersion(const MQTTVersion version);
void setKeepAlive(const quint16 keepAlive);
void setCleanSession(const bool cleanSession);
void setAutoReconnect(const bool value);
void setAutoReconnectInterval(const int autoReconnectInterval);
void setWillTopic(const QString& willTopic);
void setWillQos(const quint8 willQos);
void setWillRetain(const bool willRetain);
void setWillMessage(const QByteArray& willMessage);
void connectToHost();
void disconnectFromHost();
void subscribe(const QString& topic, const quint8 qos = 0);
void unsubscribe(const QString& topic);
quint16 publish(const QMQTT::Message& message);
signals:
void connected();
void disconnected();
void error(const QMQTT::ClientError error);
void subscribed(const QString& topic, const quint8 qos = 0);
void unsubscribed(const QString& topic);
void published(const QMQTT::Message& message, quint16 msgid = 0);
void received(const QMQTT::Message& message);
void pingresp();
protected slots:
void onNetworkConnected();
void onNetworkDisconnected();
void onNetworkReceived(const QMQTT::Frame& frame);
void onTimerPingReq();
void onPingTimeout();
void onNetworkError(QAbstractSocket::SocketError error);
protected:
QScopedPointer<ClientPrivate> d_ptr;
private:
Q_DISABLE_COPY(Client)
Q_DECLARE_PRIVATE(Client)
};
} // namespace QMQTT
Q_DECLARE_METATYPE(QMQTT::ClientError)
#endif // QMQTT_CLIENT_H
/*
* qmqtt_client_p.h - qmqtt client private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_CLIENT_P_H
#define QMQTT_CLIENT_P_H
#include <qmqtt_client.h>
#include <QHostAddress>
#include <QString>
#include <QByteArray>
#include <QHash>
#include <QTimer>
#include <QAbstractSocket>
#ifdef QT_WEBSOCKETS_LIB
#include <QWebSocket>
#endif // QT_WEBSOCKETS_LIB
#ifndef QT_NO_SSL
QT_FORWARD_DECLARE_CLASS(QSslConfiguration)
#endif // QT_NO_SSL
namespace QMQTT {
class NetworkInterface;
class ClientPrivate
{
public:
ClientPrivate(Client* qq_ptr);
~ClientPrivate();
void init(const QHostAddress& host, const quint16 port, NetworkInterface* network = NULL);
#ifndef QT_NO_SSL
void init(const QString& hostName, const quint16 port, const QSslConfiguration& config,
const bool ignoreSelfSigned=false);
#endif // QT_NO_SSL
void init(const QString& hostName, const quint16 port, const bool ssl, const bool ignoreSelfSigned);
#ifdef QT_WEBSOCKETS_LIB
void init(const QString& url,
const QString& origin,
QWebSocketProtocol::Version version,
const QSslConfiguration* sslConfig,
bool ignoreSelfSigned);
#endif // QT_WEBSOCKETS_LIB
void init(NetworkInterface* network);
QHostAddress _host;
QString _hostName;
quint16 _port;
#ifdef QT_WEBSOCKETS_LIB
QWebSocketProtocol::Version _webSocketVersion;
#endif // QT_WEBSOCKETS_LIB
quint16 _gmid;
MQTTVersion _version;
QString _clientId;
QString _username;
QByteArray _password;
bool _cleanSession;
ConnectionState _connectionState;
QScopedPointer<NetworkInterface> _network;
QTimer _timer;
QTimer _pingResponseTimer;
QString _willTopic;
quint8 _willQos;
bool _willRetain;
QByteArray _willMessage;
QHash<quint16, QString> _midToTopic;
QHash<quint16, Message> _midToMessage;
Client* const q_ptr;
quint16 nextmid();
void connectToHost();
void sendConnect();
void onTimerPingReq();
void onPingTimeout();
quint16 sendUnsubscribe(const QString &topic);
quint16 sendSubscribe(const QString &topic, const quint8 qos);
quint16 sendPublish(const Message &message);
void sendPuback(const quint8 type, const quint16 mid);
void sendDisconnect();
void sendFrame(const Frame &frame);
void disconnectFromHost();
void stopKeepAlive();
void onNetworkConnected();
void onNetworkDisconnected();
quint16 publish(const Message& message);
void puback(const quint8 type, const quint16 msgid);
void subscribe(const QString& topic, const quint8 qos);
void unsubscribe(const QString& topic);
void onNetworkReceived(const QMQTT::Frame& frame);
void handleConnack(const quint8 ack);
void handlePublish(const Message& message);
void handlePuback(const quint8 type, const quint16 msgid);
void handleSuback(const QString& topic, const quint8 qos);
void handleUnsuback(const QString& topic);
void handlePingresp();
bool autoReconnect() const;
void setAutoReconnect(const bool autoReconnect);
int autoReconnectInterval() const;
void setAutoReconnectInterval(const int autoReconnectInterval);
bool isConnectedToHost() const;
QMQTT::ConnectionState connectionState() const;
void setCleanSession(const bool cleanSession);
bool cleanSession() const;
void setKeepAlive(const quint16 keepAlive);
quint16 keepAlive() const;
void setPassword(const QByteArray& password);
QByteArray password() const;
void setUsername(const QString& username);
QString username() const;
void setVersion(const MQTTVersion);
MQTTVersion version() const;
void setClientId(const QString& clientId);
QString clientId() const;
void setPort(const quint16 port);
quint16 port() const;
void setHost(const QHostAddress& host);
QHostAddress host() const;
void setHostName(const QString& hostName);
QString hostName() const;
void setWillTopic(const QString& willTopic);
void setWillQos(const quint8 willQos);
void setWillRetain(const bool willRetain);
void setWillMessage(const QByteArray& willMessage);
QString willTopic() const;
quint8 willQos() const;
bool willRetain() const;
QByteArray willMessage() const;
void onNetworkError(QAbstractSocket::SocketError error);
Q_DECLARE_PUBLIC(Client)
};
} // namespace QMQTT
#endif // QMQTT_CLIENT_P_H
/*
* qmqtt_frame.h - qmqtt frame heaer
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_FRAME_H
#define QMQTT_FRAME_H
#include "qmqtt_global.h"
#include <QMetaType>
#include <QByteArray>
#include <QString>
QT_FORWARD_DECLARE_CLASS(QDataStream)
#define PROTOCOL_MAGIC_3_1_0 "MQIsdp"
#define PROTOCOL_MAGIC_3_1_1 "MQTT"
#define RANDOM_CLIENT_PREFIX "QMQTT-"
#define CONNECT 0x10
#define CONNACK 0x20
#define PUBLISH 0x30
#define PUBACK 0x40
#define PUBREC 0x50
#define PUBREL 0x60
#define PUBCOMP 0x70
#define SUBSCRIBE 0x80
#define SUBACK 0x90
#define UNSUBSCRIBE 0xA0
#define UNSUBACK 0xB0
#define PINGREQ 0xC0
#define PINGRESP 0xD0
#define DISCONNECT 0xE0
#define LSB(A) quint8(A & 0x00FF)
#define MSB(A) quint8((A & 0xFF00) >> 8)
/*
|--------------------------------------
| 7 6 5 4 | 3 | 2 1 | 0 |
| Type | DUP flag | QoS | RETAIN |
|--------------------------------------
*/
#define GETTYPE(HDR) (HDR & 0xF0)
#define SETQOS(HDR, Q) (HDR | ((Q) << 1))
#define GETQOS(HDR) ((HDR & 0x06) >> 1)
#define SETDUP(HDR, D) (HDR | ((D) << 3))
#define GETDUP(HDR) ((HDR & 0x08) >> 3)
#define SETRETAIN(HDR, R) (HDR | (R))
#define GETRETAIN(HDR) (HDR & 0x01)
/*
|----------------------------------------------------------------------------------
| 7 | 6 | 5 | 4 3 | 2 | 1 | 0 |
| username | password | willretain | willqos | willflag | cleansession | reserved |
|----------------------------------------------------------------------------------
*/
#define FLAG_CLEANSESS(F, C) (F | ((C) << 1))
#define FLAG_WILL(F, W) (F | ((W) << 2))
#define FLAG_WILLQOS(F, Q) (F | ((Q) << 3))
#define FLAG_WILLRETAIN(F, R) (F | ((R) << 5))
#define FLAG_PASSWD(F, P) (F | ((P) << 6))
#define FLAG_USERNAME(F, U) (F | ((U) << 7))
namespace QMQTT {
class Q_MQTT_EXPORT Frame
{
public:
explicit Frame();
explicit Frame(const quint8 header);
explicit Frame(const quint8 header, const QByteArray &data);
virtual ~Frame();
Frame(const Frame& other);
Frame& operator=(const Frame& other);
bool operator==(const Frame& other) const;
inline bool operator!=(const Frame& other) const
{ return !operator==(other); }
quint8 header() const;
QByteArray data() const;
quint16 readInt();
quint8 readChar();
QByteArray readByteArray();
QString readString();
void writeInt(const quint16 i);
void writeChar(const quint8 c);
void writeByteArray(const QByteArray &data);
void writeString(const QString &string);
void writeRawData(const QByteArray &data);
//TODO: FIXME LATER
void write(QDataStream &stream) const;
bool encodeLength(QByteArray &lenbuf, int length) const;
private:
quint8 _header;
QByteArray _data;
};
} // namespace QMQTT
Q_DECLARE_METATYPE(QMQTT::Frame)
#endif // QMQTT_FRAME_H
/*
* qmqtt_global.h - qmqtt libray global
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_GLOBAL_H
#define QMQTT_GLOBAL_H
#include <QtGlobal>
#if !defined(QMQTT_STATIC)
# if defined(QMQTT_SHARED)
# define Q_MQTT_EXPORT Q_DECL_EXPORT
# else
# define Q_MQTT_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_MQTT_EXPORT
#endif
#endif // QMQTT_GLOBAL_H
/*
* qmqtt_message.h - qmqtt message header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_MESSAGE_H
#define QMQTT_MESSAGE_H
#include "qmqtt_global.h"
#include <QMetaType>
#include <QString>
#include <QByteArray>
#include <QSharedDataPointer>
namespace QMQTT {
class MessagePrivate;
class Q_MQTT_EXPORT Message
{
public:
Message();
explicit Message(const quint16 id, const QString &topic, const QByteArray &payload,
const quint8 qos = 0, const bool retain = false, const bool dup = false);
Message(const Message &other);
~Message();
Message &operator=(const Message &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline Message &operator=(Message &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif
bool operator==(const Message &other) const;
inline bool operator!=(const Message &other) const
{ return !operator==(other); }
inline void swap(Message &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
quint16 id() const;
void setId(const quint16 id);
quint8 qos() const;
void setQos(const quint8 qos);
bool retain() const;
void setRetain(const bool retain);
bool dup() const;
void setDup(const bool dup);
QString topic() const;
void setTopic(const QString &topic);
QByteArray payload() const;
void setPayload(const QByteArray &payload);
private:
QSharedDataPointer<MessagePrivate> d;
};
} // namespace QMQTT
Q_DECLARE_SHARED(QMQTT::Message)
Q_DECLARE_METATYPE(QMQTT::Message)
#endif // QMQTT_MESSAGE_H
/*
* qmqtt_message.h - qmqtt message private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_MESSAGE_P_H
#define QMQTT_MESSAGE_P_H
#include <QSharedData>
#include <QString>
#include <QByteArray>
namespace QMQTT {
class MessagePrivate : public QSharedData
{
public:
inline MessagePrivate()
: QSharedData(),
id(0),
qos(0),
retain(false),
dup(false)
{}
inline MessagePrivate(const MessagePrivate &other)
: QSharedData(other),
id(other.id),
qos(other.qos),
retain(other.retain),
dup(other.dup),
topic(other.topic),
payload(other.payload)
{}
inline MessagePrivate(quint16 id, const QString &topic, const QByteArray &payload,
quint8 qos, bool retain, bool dup)
: QSharedData(),
id(id),
qos(qos),
retain(retain),
dup(dup),
topic(topic),
payload(payload)
{}
quint16 id;
quint8 qos : 2;
quint8 retain: 1;
quint8 dup: 1;
QString topic;
QByteArray payload;
};
} // namespace QMQTT
#endif // QMQTT_MESSAGE_P_H
/*
* qmqtt_network_p.h - qmqtt network private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_NETWORK_P_H
#define QMQTT_NETWORK_P_H
#include <qmqtt_networkinterface.h>
#include <QObject>
#include <QHostAddress>
#include <QString>
#include <QByteArray>
#ifdef QT_WEBSOCKETS_LIB
#include <QWebSocket>
#endif // QT_WEBSOCKETS_LIB
#ifndef QT_NO_SSL
QT_FORWARD_DECLARE_CLASS(QSslConfiguration)
#endif // QT_NO_SSL
namespace QMQTT {
class SocketInterface;
class TimerInterface;
class Frame;
class Network : public NetworkInterface
{
Q_OBJECT
public:
Network(QObject* parent = NULL);
#ifndef QT_NO_SSL
Network(const QSslConfiguration& config, bool ignoreSelfSigned, QObject* parent = NULL);
#endif // QT_NO_SSL
#ifdef QT_WEBSOCKETS_LIB
Network(const QString& origin,
QWebSocketProtocol::Version version,
const QSslConfiguration* sslConfig,
bool ignoreSelfSigned,
QObject* parent = NULL);
#endif // QT_WEBSOCKETS_LIB
Network(SocketInterface* socketInterface, TimerInterface* timerInterface,
QObject* parent = NULL);
~Network();
void sendFrame(const Frame &frame);
bool isConnectedToHost() const;
bool autoReconnect() const;
void setAutoReconnect(const bool autoReconnect);
QAbstractSocket::SocketState state() const;
int autoReconnectInterval() const;
void setAutoReconnectInterval(const int autoReconnectInterval);
public slots:
void connectToHost(const QHostAddress& host, const quint16 port);
void connectToHost(const QString& hostName, const quint16 port);
void disconnectFromHost();
protected slots:
void onSocketError(QAbstractSocket::SocketError socketError);
protected:
void initialize();
quint16 _port;
QHostAddress _host;
QString _hostName;
bool _autoReconnect;
int _autoReconnectInterval;
SocketInterface* _socket;
TimerInterface* _autoReconnectTimer;
enum ReadState {
Header,
Length,
PayLoad
};
ReadState _readState;
quint8 _header;
int _length;
int _shift;
QByteArray _data;
protected slots:
void onSocketReadReady();
void onDisconnected();
void connectToHost();
private:
Q_DISABLE_COPY(Network)
};
} // namespace QMQTT
#endif // QMQTT_NETWORK_P_H
/*
* qmqtt_networkinterface.h - qmqtt network interface header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_NETWORK_INTERFACE_H
#define QMQTT_NETWORK_INTERFACE_H
#include "qmqtt_global.h"
#include <QObject>
#include <QAbstractSocket>
#include <QHostAddress>
#include <QString>
namespace QMQTT {
class Frame;
class Q_MQTT_EXPORT NetworkInterface : public QObject
{
Q_OBJECT
public:
explicit NetworkInterface(QObject* parent = NULL) : QObject(parent) {}
virtual ~NetworkInterface() {}
virtual void sendFrame(const Frame& frame) = 0;
virtual bool isConnectedToHost() const = 0;
virtual bool autoReconnect() const = 0;
virtual void setAutoReconnect(const bool autoReconnect) = 0;
virtual int autoReconnectInterval() const = 0;
virtual void setAutoReconnectInterval(const int autoReconnectInterval) = 0;
virtual QAbstractSocket::SocketState state() const = 0;
public slots:
virtual void connectToHost(const QHostAddress& host, const quint16 port) = 0;
virtual void connectToHost(const QString& hostName, const quint16 port) = 0;
virtual void disconnectFromHost() = 0;
signals:
void connected();
void disconnected();
void received(const QMQTT::Frame& frame);
void error(QAbstractSocket::SocketError error);
};
} // namespace QMQTT
#endif // QMQTT_NETWORK_INTERFACE_H
/*
* qmqtt_router.h - qmqtt router
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* Router added by Niklas Wulf <nwulf at geenen-it-systeme dot de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_ROUTEDMESSAGE_H
#define QMQTT_ROUTEDMESSAGE_H
#include <qmqtt_message.h>
#include <QMetaType>
#include <QHash>
#include <QString>
namespace QMQTT {
class RouteSubscription;
class Q_MQTT_EXPORT RoutedMessage
{
public:
inline RoutedMessage()
{}
inline RoutedMessage(const Message &message)
: _message(message)
{}
inline const Message &message() const
{ return _message; }
inline QHash<QString, QString> parameters() const
{ return _parameters; }
private:
friend class RouteSubscription;
Message _message;
QHash<QString, QString> _parameters;
};
} // namespace QMQTT
Q_DECLARE_METATYPE(QMQTT::RoutedMessage)
#endif // QMQTT_ROUTEDMESSAGE_H
/*
* qmqtt_router.h - qmqtt router
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* Router added by Niklas Wulf <nwulf at geenen-it-systeme dot de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_ROUTER_H
#define QMQTT_ROUTER_H
#include "qmqtt_global.h"
#include <QObject>
namespace QMQTT {
class Client;
class RouteSubscription;
class Q_MQTT_EXPORT Router : public QObject
{
Q_OBJECT
public:
explicit Router(Client *parent = 0);
RouteSubscription *subscribe(const QString &route);
Client *client() const;
private:
Client *_client;
};
} // namespace QMQTT
#endif // QMQTT_ROUTER_H
/*
* qmqtt_router.h - qmqtt router
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* Router added by Niklas Wulf <nwulf at geenen-it-systeme dot de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_ROUTESUBSCRIPTION_H
#define QMQTT_ROUTESUBSCRIPTION_H
#include "qmqtt_global.h"
#include <QObject>
#include <QPointer>
#include <QString>
#include <QRegularExpression>
#include <QStringList>
namespace QMQTT {
class Client;
class Message;
class RoutedMessage;
class Router;
class Q_MQTT_EXPORT RouteSubscription : public QObject
{
Q_OBJECT
public:
~RouteSubscription();
QString route() const;
signals:
void received(const RoutedMessage &message);
private slots:
void routeMessage(const Message &message);
private:
friend class Router;
explicit RouteSubscription(Router *parent = 0);
void setRoute(const QString &route);
QPointer<Client> _client;
QString _topic;
QRegularExpression _regularExpression;
QStringList _parameterNames;
};
} // namespace QMQTT
#endif // QMQTT_ROUTESUBSCRIPTION_H
/*
* qmqtt_socket_p.h - qmqtt socket private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_SOCKET_P_H
#define QMQTT_SOCKET_P_H
#include <qmqtt_socketinterface.h>
#include <QObject>
#include <QHostAddress>
#include <QString>
#include <QAbstractSocket>
#include <QScopedPointer>
QT_FORWARD_DECLARE_CLASS(QIODevice)
QT_FORWARD_DECLARE_CLASS(QTcpSocket)
namespace QMQTT
{
class Socket : public SocketInterface
{
Q_OBJECT
public:
explicit Socket(QObject* parent = NULL);
virtual ~Socket();
virtual QIODevice *ioDevice();
void connectToHost(const QHostAddress& address, quint16 port);
void connectToHost(const QString& hostName, quint16 port);
void disconnectFromHost();
QAbstractSocket::SocketState state() const;
QAbstractSocket::SocketError error() const;
protected:
QScopedPointer<QTcpSocket> _socket;
};
}
#endif // QMQTT_SOCKET_P_H
/*
* qmqtt_socketinterface.h - qmqtt socket interface header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_SOCKET_INTERFACE_H
#define QMQTT_SOCKET_INTERFACE_H
#include "qmqtt_global.h"
#include <QObject>
#include <QHostAddress>
#include <QString>
#include <QAbstractSocket>
QT_FORWARD_DECLARE_CLASS(QIODevice)
namespace QMQTT
{
class Q_MQTT_EXPORT SocketInterface : public QObject
{
Q_OBJECT
public:
explicit SocketInterface(QObject* parent = NULL) : QObject(parent) {}
virtual ~SocketInterface() {}
virtual QIODevice *ioDevice() = 0;
virtual void connectToHost(const QHostAddress& address, quint16 port) = 0;
virtual void connectToHost(const QString& hostName, quint16 port) = 0;
virtual void disconnectFromHost() = 0;
virtual QAbstractSocket::SocketState state() const = 0;
virtual QAbstractSocket::SocketError error() const = 0;
signals:
void connected();
void disconnected();
void error(QAbstractSocket::SocketError socketError);
};
}
#endif // QMQTT_SOCKET_INTERFACE_H
/*
* qmqtt_ssl_socket_p.h - qmqtt SSL socket private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* Copyright (c) 2016 Matthias Dieter Wallnöfer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_SSL_SOCKET_P_H
#define QMQTT_SSL_SOCKET_P_H
#ifndef QT_NO_SSL
#include <qmqtt_socketinterface.h>
#include <QObject>
#include <QHostAddress>
#include <QString>
#include <QList>
#include <QScopedPointer>
QT_FORWARD_DECLARE_CLASS(QSslSocket)
QT_FORWARD_DECLARE_CLASS(QSslError)
QT_FORWARD_DECLARE_CLASS(QSslConfiguration)
namespace QMQTT
{
class SslSocket : public SocketInterface
{
Q_OBJECT
public:
explicit SslSocket(const QSslConfiguration &config, bool ignoreSelfSigned, QObject* parent = NULL);
virtual ~SslSocket();
virtual QIODevice *ioDevice();
void connectToHost(const QHostAddress& address, quint16 port);
void connectToHost(const QString& hostName, quint16 port);
void disconnectFromHost();
QAbstractSocket::SocketState state() const;
QAbstractSocket::SocketError error() const;
protected slots:
void sslErrors(const QList<QSslError> &errors);
protected:
QScopedPointer<QSslSocket> _socket;
bool _ignoreSelfSigned;
};
}
#endif // QT_NO_SSL
#endif // QMQTT_SSL_SOCKET_P_H
/*
* qmqtt_timer_p.h - qmqtt timer private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_TIMER_P_H
#define QMQTT_TIMER_P_H
#include <qmqtt_timerinterface.h>
#include <QObject>
#include <QTimer>
namespace QMQTT {
class Timer : public TimerInterface
{
Q_OBJECT
public:
explicit Timer(QObject *parent = 0);
virtual ~Timer();
bool isSingleShot() const;
void setSingleShot(bool singleShot);
int interval() const;
void setInterval(int msec);
void start();
void stop();
protected:
QTimer _timer;
};
}
#endif // QMQTT_TIMER_P_H
/*
* qmqtt_timerinterface.h - qmqtt timer interface header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_TIMER_INTERFACE_H
#define QMQTT_TIMER_INTERFACE_H
#include "qmqtt_global.h"
#include <QObject>
namespace QMQTT {
class Q_MQTT_EXPORT TimerInterface : public QObject
{
Q_OBJECT
public:
explicit TimerInterface(QObject* parent = NULL) : QObject(parent) {}
virtual ~TimerInterface() {}
virtual bool isSingleShot() const = 0;
virtual void setSingleShot(bool singleShot) = 0;
virtual int interval() const = 0;
virtual void setInterval(int msec) = 0;
virtual void start() = 0;
virtual void stop() = 0;
signals:
void timeout();
};
}
#endif // QMQTT_TIMER_INTERFACE_H
/*
* qmqtt_websocket_p.h - qmqtt socket private header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_WEBSOCKET_H
#define QMQTT_WEBSOCKET_H
#ifdef QT_WEBSOCKETS_LIB
#include <qmqtt_socketinterface.h>
#include <qmqtt_websocketiodevice_p.h>
#include <QObject>
#include <QWebSocket>
#include <QHostAddress>
#include <QString>
#include <QList>
#include <QAbstractSocket>
QT_FORWARD_DECLARE_CLASS(QIODevice)
QT_FORWARD_DECLARE_CLASS(QSslConfiguration)
QT_FORWARD_DECLARE_CLASS(QSslError)
namespace QMQTT
{
class WebSocket : public SocketInterface
{
Q_OBJECT
public:
WebSocket(const QString& origin,
QWebSocketProtocol::Version version,
const QSslConfiguration* sslConfig,
bool ignoreSelfSigned,
QObject* parent = NULL);
virtual ~WebSocket();
QIODevice *ioDevice()
{
return _ioDevice;
}
void connectToHost(const QHostAddress& address, quint16 port);
void connectToHost(const QString& hostName, quint16 port);
void disconnectFromHost();
QAbstractSocket::SocketState state() const;
QAbstractSocket::SocketError error() const;
private slots:
void sslErrors(const QList<QSslError> &errors);
private:
QWebSocket *_socket;
WebSocketIODevice *_ioDevice;
bool _ignoreSelfSigned;
};
}
#endif // QT_WEBSOCKETS_LIB
#endif // QMQTT_WEBSOCKET_H
/*
* qmqtt_socketinterface.h - qmqtt socket interface header
*
* Copyright (c) 2013 Ery Lee <ery.lee at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of mqttc nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef QMQTT_WEBSOCKETIODEVICE_H
#define QMQTT_WEBSOCKETIODEVICE_H
#ifdef QT_WEBSOCKETS_LIB
#include <QByteArray>
#include <QIODevice>
#include <QList>
#include <QAbstractSocket>
QT_FORWARD_DECLARE_CLASS(QWebSocket)
QT_FORWARD_DECLARE_CLASS(QNetworkRequest)
QT_FORWARD_DECLARE_CLASS(QSslError)
namespace QMQTT
{
class WebSocketIODevice : public QIODevice
{
Q_OBJECT
public:
explicit WebSocketIODevice(QWebSocket *socket, QObject *parent = NULL);
bool connectToHost(const QNetworkRequest &request);
virtual qint64 bytesAvailable() const;
signals:
void connected();
void disconnected();
void error(QAbstractSocket::SocketError error);
void sslErrors(const QList<QSslError> &errors);
protected:
virtual qint64 readData(char *data, qint64 maxSize);
virtual qint64 writeData(const char *data, qint64 maxSize);
private slots:
void binaryMessageReceived(const QByteArray &frame);
private:
QByteArray _buffer;
QWebSocket *_webSocket;
};
}
#endif // QT_WEBSOCKETS_LIB
#endif // QMQTT_WEBSOCKETIODEVICE_H
COPY=cp
win32: COPY=copy
SHELL_SUFFIX=sh
win32: SHELL_SUFFIX=bat
BUILD_TYPE = release
CONFIG(debug,debug|release):BUILD_TYPE=debug
CONFIG(release,debug|release):BUILD_TYPE=release
!exists($$system_path($${TOPIKM_SDKPATH})) {
mkpath($$system_path($${TOPIKM_SDKPATH}))
}
!exists($$system_path($${SDK_HEADER_PATH}/qmqtt/)) {
mkpath($$system_path($${SDK_HEADER_PATH}/qmqtt/))
}
# 复制qmqtt链接库
SRC_PATH = $$PWD/bin/$${BUILD_TYPE}/$${MISC_SUFFIX}/qmqtt$${DEBUG_SUFFIX}
win32 {
system($${COPY} $$system_path($${SRC_PATH}.dll) $$system_path($$DESTDIR/qmqtt$${DEBUG_SUFFIX}.dll))
system($${COPY} $$system_path($${SRC_PATH}.lib) $$system_path($$DESTDIR/qmqtt$${DEBUG_SUFFIX}.lib))
###导出header
system(copy $$system_path($$PWD/include/qmqtt/*.h) $$system_path($${SDK_HEADER_PATH}/qmqtt/))
}
linux {
system(cp $$PWD/bin/$${BUILD_TYPE}/$${MISC_SUFFIX}/libqmqtt.so.1.0.1) $$system_path($$DESTDIR/libqmqtt.so.1.0.1))
system("cd $${DESTDIR} && ln -s libqmqtt.so.1.0.1 libqmqtt.so")
system("cd $${DESTDIR} && ln -s libqmqtt.so.1.0.1 libqmqtt.so.1")
###导出header
system(cp $$system_path($$PWD/include/qmqtt/*.h) $$system_path($${SDK_HEADER_PATH}/qmqtt/))
}
include(../global/qt-module-defaults-offline.qdocconf)
# Name of the project which must match the outputdir. Determines the .index file
project = tmqtt
description = TopIKM6 MQTT
version = 0.0.1
depends += qtcore qtnetwork
outputformats=HTML
outputdir = ../html
imagedirs = ../images
tagfile = ../doc.tags
# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in
# Qt Assistant and/or Qt Creator.
# Defines the name of the project. You cannot use operators (+, =, -) in
# the name. Properties for this project are set using a qhp.<projectname>.property
# format.
qhp.projects = tmqtt
# Sets the name of the output qhp file.
qhp.tbaseutil.file = tmqtt.qhp
qhp.tbaseutil.namespace = net.topibd.topikm6.tmqtt.0.0.1
qhp.tbaseutil.virtualFolder = tmqtt
# Title for the package, will be the main title for the package in
# Assistant/Creator.
qhp.tbaseutil.indexTitle = tmqtt
# Only update the name of the project for the next variables.
qhp.tbaseutil.filterAttributes = tmqtt qtrefdoc
qhp.tbaseutil.customFilters.Qt.name = tmqtt
qhp.tbaseutil.subprojects = classes
qhp.tbaseutil.subprojects.classes.title = C++ Classes
qhp.tbaseutil.subprojects.classes.indexTitle = All Classes
qhp.tbaseutil.subprojects.classes.selectors = class fake:headerfile
qhp.tbaseutil.subprojects.classes.sortPages = true
headerdirs += ../src \
../../src/lib
sourcedirs = ../src \
../../src/lib
navigation.landingpage = "tmqtt"
navigation.cppclassespage = "tmqtt C++ Classes"
indexes += $TOPIKM6_DOCS/topikm6/topikm6.index
macro.0 = "\\\\0"
macro.n = "\\\\n"
macro.r = "\\\\r"
macro.img = "\\image"
macro.endquote = "\\endquotation"
macro.relatesto = "\\relates"
spurious = "Missing comma in .*" \
"Missing pattern .*"
#Include this file to inherit configuration related to Qt Project based modules.
dita.metadata.default.author = TopLinker
dita.metadata.default.permissions = all
dita.metadata.default.publisher = TopLinker Co., Ltd.
dita.metadata.default.copyryear = 2020
dita.metadata.default.copyrholder = TopLinker Co., Ltd.
dita.metadata.default.audience = programmer
#Set the main Qt index.html
navigation.homepage = "topikm6"
sourcedirs += includes
url = http://139.196.104.13:8888/topikm6-mqtt
# Include the external websites
sourcedirs += externalsites
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://www.freedesktop.org/
\title freedesktop.org
*/
/*!
\externalpage http://www.freedesktop.org/Standards/xembed-spec
\title XEmbed Specification
*/
/*!
\externalpage http://www.freedesktop.org/Standards/icon-theme-spec
\title Icon Themes Specification
*/
/*!
\externalpage http://www.cups.org/
\title Common Unix Printing System (CUPS)
\keyword CUPS
*/
/*!
\externalpage http://www.freedesktop.org/wiki/Standards_2fdesktop_2dentry_2dspec
\title Desktop Entry Specification
*/
/*!
\externalpage http://www.kde.org/
\title The K Desktop Environment
\keyword KDE
*/
/*!
\externalpage http://www.cmake.org/cmake/help/documentation.html
\title CMake Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
\title CMake find_package Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:AUTOMOC
\title CMake AUTOMOC Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION
\title CMake LOCATION Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
\title CMake POSITION_INDEPENDENT_CODE Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:target_link_libraries
\title CMake target_link_libraries Documentation
*/
/*!
\externalpage http://www.gnome.org/
\title GNOME
*/
/*!
\externalpage http://www.gnu.org/software/emacs/
\title GNU Emacs
*/
/*!
\externalpage http://gnuwin32.sourceforge.net/packages.html
\title GnuWin32 Project
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/About.html
\title About SVG
\keyword Scalable Vector Graphics
*/
/*!
\externalpage http://www.w3.org/TR/SVG/types.html#ColorKeywords
\title SVG color keyword names
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/
\title SVG Working Group
*/
/*!
\externalpage http://www.w3.org/TR/SVGMobile/
\title Mobile SVG Profiles
\omit
Mobile SVG Profiles: SVG Tiny and SVG Basic
\endomit
*/
/*!
\externalpage http://www.w3.org/TR/SVGMobile12/
\title SVG 1.2 Tiny
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static
\title SVG 1.2 Tiny Static Features
*/
/*!
\externalpage http://tdm-gcc.tdragon.net/
\title TDM-GCC
*/
/*!
\externalpage http://www.dependencywalker.com/
\title Dependency Walker
*/
/*!
\externalpage http://webkit.org/
\title WebKit Open Source Project
*/
/*!
\externalpage http://www.informit.com/store/product.aspx?isbn=0132354160
\title C++ GUI Programming with Qt 4, 2nd Edition
*/
/*!
\externalpage http://www.openssl.org/
\title OpenSSL Toolkit
*/
/*!
\externalpage http://arora-browser.org/
\title Arora Browser
*/
/*!
\externalpage http://www.activestate.com/Products/activeperl/index.mhtml
\title ActivePerl
*/
/*!
\externalpage https://chromium.googlesource.com/angle/angle/+/master/README.md
\title ANGLE
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/directx/default.aspx
\title Direct X SDK
*/
/*!
\externalpage http://www.w3.org/TR/html401/
\title HTML 4
*/
/*!
\externalpage http://www.w3.org/TR/html5/
\title HTML 5
*/
/*!
\externalpage http://site.icu-project.org/
\title ICU
*/
/*!
\externalpage http://www.mingw.org/
\title MinGW
*/
/*!
\externalpage http://www.python.org/
\title Python
*/
/*!
\externalpage http://pyxml.sourceforge.net/topics/xbel/
\title XML Bookmark Exchange Language Resource Page
*/
/*!
\externalpage http://www.w3.org/TR/xquery/#errors
\title error handling in the XQuery language
*/
/*!
\externalpage http://xaos.sourceforge.net/
\title XaoS
*/
/*!
\externalpage http://www.unixodbc.org
\title http://www.unixodbc.org
*/
/*!
\externalpage http://www.postgresql.org
\title http://www.postgresql.org
*/
/*!
\externalpage http://www.postgresql.org/docs/current/static/installation-platform-notes.html#INSTALLATION-NOTES-MINGW
\title PostgreSQL MinGW/Native Windows
*/
/*!
\externalpage http://www.freetds.org
\title http://www.freetds.org
*/
/*!
\externalpage http://www.sybase.com
\title http://www.sybase.com
*/
/*!
\externalpage http://linux.sybase.com
\title http://linux.sybase.com
*/
/*!
\externalpage http://www.sqlite.org
\title http://www.sqlite.org
*/
/*!
\externalpage http://www.amazon.com/Threads-Primer-Guide-Multithreaded-Programming/dp/0134436989/ref=sr_1_1?ie=UTF8&qid=1354884049&sr=8-1&keywords=a+guide+to+multithreaded+programming
\title Threads Primer: A Guide to Multithreaded Programming
*/
/*!
\externalpage http://www.amazon.com/Thread-Time-MultiThreaded-Programming-Guide/dp/0131900676/ref=sr_1_sc_3?ie=UTF8&qid=1354884427&sr=8-3-spell&keywords=The+Mulltithread+Programming+Guide
\title Thread Time: The Multithreaded Programming Guide
*/
/*!
\externalpage http://www.amazon.com/Pthreads-Programming-Standard-Multiprocessing-Nutshell/dp/1565921151/ref=sr_1_1?s=books&ie=UTF8&qid=1354884565&sr=1-1&keywords=threads+Programming%3A+A+POSIX+Standard+for+Better+Multiprocessing
\title Pthreads Programming: A POSIX Standard for Better Multiprocessing
*/
/*!
\externalpage http://www.amazon.com/Win32-Multithreaded-Programming-Aaron-Cohen/dp/B00007GW3Z/ref=sr_1_1?s=books&ie=UTF8&qid=1354884647&sr=1-1&keywords=Win32+Multithreaded+Programming
\title Win32 Multithreaded Programming
*/
/*!
\externalpage http://www.phptr.com/content/images/0131872494/samplechapter/blanchette_ch10.pdf
\title "Item View Classes" Chapter of C++ GUI Programming with Qt 4
*/
/*!
\externalpage https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html
\title Mac OS X Aqua
*/
/*!
\externalpage http://www.kdedevelopers.org/node/2345
\title KDE applications
*/
/*!
\externalpage http://cgi.netscape.com/newsref/std/cookie_spec.html
\title Netscape Cookie Specification
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/library/ms533046(VS.85).aspx
\title Mitigating Cross-site Scripting With HTTP-only Cookies
*/
/*!
\externalpage http://en.tldp.org/HOWTO/Framebuffer-HOWTO.html
\title Framebuffer HOWTO
*/
/*!
\externalpage http://wap.trafikanten.no
\title Trafikanten
*/
/*!
\externalpage http://www.w3.org/TR/scxml/
\title State Chart XML: State Machine Notation for Control Abstraction
*/
/*!
\externalpage http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf
\title Statecharts: A visual formalism for complex systems
*/
/*!
\externalpage http://www.gnu.org/licenses/gpl.html
\title GNU General Public License
*/
/*!
\externalpage http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
\title GNU Lesser General Public License, version 2.1
*/
/*!
\externalpage http://developers.sun.com/sunstudio/downloads/patches/index.jsp
\title Sun Studio Patches
*/
/*!
\externalpage http://www.qtcentre.org
\title Qt Centre
*/
/*!
\externalpage http://www.kde.org
\title KDE
*/
/*!
\externalpage http://www.directfb.org/index.php?path=Main%2FDownloads&amp;page=1
\title DirectFB - df_window example
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBPalette.html
\title DirectFB - IDirectFBPalette
*/
/*!
\externalpage http://www.cplusplus.com/reference/clibrary/cstring/memcpy/
\title C++ Reference - memcpy
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFB_CreateInputEventBuffer.html
\title DirectFB - CreateInputEventBuffer
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/types.html#DFBSurfaceBlittingFlags
\title DirectFB - DFBSurfaceBlittingFlags
*/
/*!
\externalpage http://directfb.org/docs/DirectFB_Reference_1_4/IDirectFBImageProvider.html
\title DirectFB - IDirectFBImageProvider
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBSurface.html
\title DirectFB - IDirectFBSurface
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBWindow
\title DirectFB - IDirectFBWindow
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/types.html#DFBSurfaceDescription
\title DirectFB - DFBSurfaceDescription
*/
/*!
\externalpage http://www.w3.org/TR/REC-CSS2/selector.html#q1
\title Standard CSS2 selector
*/
/*!
\externalpage http://www.w3.org/XML/Core/#Publications
\title W3C XML specifications
*/
/*!
\externalpage http://www.w3.org/XML/Schema
\title XML Schema
*/
/*!
\externalpage http://opensource.org/licenses/bsd-license.php
\title New and Modified BSD Licenses
*/
/*!
\externalpage http://www.ecma-international.org/publications/standards/Ecma-262.htm
\title ECMAScript Language Specification
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript
\title JavaScript Resources
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/Guide
\title JavaScript Guide
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/About_JavaScript
\title About JavaScript
*/
/*!
\externalpage http://www.libusb.org/
\title libusb
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
\title JavaScript Reserved Words
*/
/*!
\externalpage http://publicsuffix.org/
\title publicsuffix.org
*/
/*!
\externalpage http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_accessible_event_i_d_8idl.html
\title AccessibleEventID.idl File Reference
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/library/dd318066.aspx
\title Microsoft Active Accessibility Event Constants
*/
/*!
\externalpage ftp://ftp.qt-project.org/pub/qt/solutions/lgpl/qtmotifextension-2.7_1-opensource.tar.gz
\title Motif Extension
*/
/*!
\externalpage http://www.opengl.org/registry/
\title OpenGL Registry
*/
/*!
\externalpage http://www.khronos.org/registry/gles/
\title Khronos OpenGL ES API Registry
*/
/*!
\externalpage http://git.iksaif.net/?p=qsslkey-p11.git
\title qsslkey example
*/
/*!
\externalpage http://www.w3.org/TR/2009/WD-webdatabase-20091029/
\title HTML5 Web Database API
*/
/*!
\externalpage http://lldb.llvm.org/
\title The LLDB Debugger
*/
/*!
\externalpage https://login.qt.io/
\title Qt Account Sign-up
*/
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://qt.io/
\title Qt Homepage
*/
/*!
\externalpage http://bugreports.qt.io
\title Qt Bug Tracker
*/
/*!
\externalpage http://qt.io/download
\title Downloads
*/
/*!
\externalpage http://qt.io/licensing/
\title Qt Licensing Overview
*/
/*!
\externalpage http://doc.qt.io/archives/qq/
\title Qt Quarterly
*/
/*!
\externalpage http://doc.qt.io/archives/qq/qq19-plurals.html
\title Qt Quarterly: Plural Form in Translation
*/
/*!
\externalpage https://code.qt.io/
\title Public Qt Repository
*/
/*!
\externalpage https://code.qt.io/cgit/%7bnon-gerrit%7d/qt-labs/qtestlib-tools.git/
\title qtestlib-tools
*/
/*!
\externalpage http://wiki.qt.io/Qt_Coding_Style
\title Qt Coding Style
*/
/*!
\externalpage http://doc.qt.io/archives/qt-eclipse-1.6/index.html
\title Eclipse Plugin
*/
/*!
\externalpage http://doc.qt.io/archives/qq/qq11-events.html
\title Qt Quarterly: Another Look at Events
*/
/*!
\externalpage http://qt-project.org/videos/watch/livecoding-video-effects-with-qt5
\title Livecoding video effects with Qt5
*/
/*!
\externalpage http://blog.qt.io/2012/02/29/pimp-my-video-shader-effects-and-multimedia/
\title Pimp my video
*/
/*!
\externalpage http://wiki.qt.io/QtMediaHub
\title QtMediaHub
*/
/*!
\externalpage http://wiki.qt.io/Qt_RaspberryPi
\title QtonPi
*/
/*!
\externalpage http://wiki.qt.io/jom
\title jom
*/
/*!
\externalpage http://doc.qt.io/qt-4.8
\title Qt 4.8 Reference Documentation
*/
/*!
\externalpage http://doc.qt.io/qt-4.8/qtquick.html
\title Qt Quick 1 Reference Documentation
*/
/*!
\externalpage http://wiki.qt.io/Qt_Localization
\title external: Translating Qt Into Other Languages
*/
/*!
\externalpage http://wiki.qt.io/BlackBerry
\title Qt for BlackBerry
*/
/*!
\externalpage http://wiki.qt.io/Qt_Multimedia_Backends
\title Qt Multimedia Backends
*/
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment-qnx.html
\title Qt Creator: Deploying Applications to QNX Neutrino Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-baremetal.html
\title Qt Creator: Connecting Bare Metal Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-qnx.html
\title Qt Creator: Connecting QNX Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-generic-linux.html
\title Qt Creator: Connecting Embedded Linux Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment-embedded-linux.html
\title Qt Creator: Deploying Applications to Embedded Linux Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-faq.html
\title Qt Creator: FAQ
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-tips.html
\title Qt Creator: Tips and Tricks
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-help.html
\title Qt Creator: Using the Help Mode
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-quick-tour.html
\title Qt Creator: User Interface
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-cli.html
\title Qt Creator: Using Command Line Options
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-task-lists.html
\title Qt Creator: Showing Task List Files in Issues Pane
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-managing-sessions.html
\title Qt Creator: Managing Sessions
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-external.html
\title Qt Creator: Using External Tools
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-version-control.html
\title Qt Creator: Using Version Control Systems
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-keyboard-shortcuts.html
\title Qt Creator: Keyboard Shortcuts
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-screens.html
\title Qt Creator: Creating Screens
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-qtquick-designer-extensions.html
\title Qt Creator: Using Qt Quick Designer Extensions
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qmldesigner-pathview-editor.html
\title Qt Creator: Editing PathView Properties
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qmldesigner-connections.html
\title Qt Creator: Adding Connections
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtcreator-transitions-example.html
\title Qt Creator: Creating a Qt Quick Application
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtquick-iso-icon-browser.html
\title Qt Creator: Browsing ISO 7000 Icons
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-export-to-qml.html
\title Qt Creator: Exporting Designs from Graphics Software
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html
\title Qt Creator: Using QML Modules with Plugins
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-visual-editor.html
\title Qt Creator: Developing Qt Quick Applications
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-using-qt-quick-designer.html
\title Qt Creator: Using Qt Quick Designer
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-projects.html
\title Qt Creator: Creating Qt Quick Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-components.html
\title Qt Creator: Creating Components
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qt-quick-toolbars.html
\title Qt Creator: Using Qt Quick Toolbars
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-buttons.html
\title Qt Creator: Creating Buttons
*/
/*!
\externalpage http://doc.qt.io/qtcreator/quick-scalable-image.html
\title Qt Creator: Creating Scalable Buttons and Borders
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-options.html
\title Qt Creator: Configuring the Editor
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-functions.html
\title Qt Creator: Writing Code
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-coding-navigating.html
\title Qt Creator: Working in Edit Mode
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-highlighting.html
\title Qt Creator: Semantic Highlighting
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-checking-code-syntax.html
\title Qt Creator: Checking Code Syntax
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-completing-code.html
\title Qt Creator: Completing Code
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-codepasting.html
\title Qt Creator: Pasting and Fetching Code Snippets
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-macros.html
\title Qt Creator: Using Text Editing Macros
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-fakevim.html
\title Qt Creator: Using FakeVim Mode
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-indenting-code.html
\title Qt Creator: Indenting Text or Code
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-finding.html
\title Qt Creator: Finding and Replacing
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-refactoring.html
\title Qt Creator: Refactoring
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-locator.html
\title Qt Creator: Searching with the Locator
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-coding.html
\title Qt Creator: Coding
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-options-text.html
\title Qt Creator: Specifying Text Editor Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-finding-overview.html
\title Qt Creator: Finding
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-mime-types.html
\title Qt Creator: Editing MIME Types
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-modeling.html
\title Qt Creator: Modeling
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-qml-debugging-example.html
\title Qt Creator: Debugging a Qt Quick Example Application
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugging-example.html
\title Qt Creator: Debugging a C++ Example Application
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugger-engines.html
\title Qt Creator: Setting Up Debugger
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugging-qml.html
\title Qt Creator: Debugging Qt Quick Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugging.html
\title Qt Creator: Debugging
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugger-operating-modes.html
\title Qt Creator: Launching the Debugger
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debug-mode.html
\title Qt Creator: Interacting with the Debugger
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debugging-helpers.html
\title Qt Creator: Using Debugging Helpers
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-troubleshooting-debugging.html
\title Qt Creator: Troubleshooting Debugger
*/
/*!
\externalpage http://doc.qt.io/qtcreator/index.html
\title Qt Creator Manual
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-advanced.html
\title Qt Creator: Advanced Use
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-os-supported-platforms.html
\title Qt Creator: Supported Platforms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-connecting-mobile.html
\title Qt Creator: Connecting Mobile Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-usability.html
\title Qt Creator: Optimizing Applications for Mobile Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-acknowledgements.html
\title Qt Creator: Acknowledgements
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-help-overview.html
\title Qt Creator: Getting Help
*/
/*!
\externalpage http://doc.qt.io/qtcreator/technical-support.html
\title Qt Creator: Technical Support
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-overview.html
\title Qt Creator: IDE Overview
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-testing.html
\title Qt Creator: Testing
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment.html
\title Qt Creator: Deploying to Mobile Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-tutorials.html
\title Qt Creator: Tutorials
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-known-issues.html
\title Qt Creator: Known Issues
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-design-mode.html
\title Qt Creator: Designing User Interfaces
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-glossary.html
\title Qt Creator: Glossary
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-getting-started.html
\title Qt Creator: Getting Started
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-analyzer.html
\title Qt Creator: Detecting Memory Leaks
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-cache-profiler.html
\title Qt Creator: Profiling Function Execution
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-running-valgrind-remotely.html
\title Qt Creator: Running Valgrind Tools Remotely
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-valgrind-overview.html
\title Qt Creator: Using Valgrind Code Analysis Tools
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-analyze-mode.html
\title Qt Creator: Analyzing Code
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-qml-performance-monitor.html
\title Qt Creator: Profiling QML Applications
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deploying-android.html
\title Qt Creator: Deploying Applications to Android Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-ios.html
\title Qt Creator: Connecting iOS devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-android.html
\title Qt Creator: Connecting Android Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-build-example-application.html
\title Qt Creator: Building and Running an Example
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-generic.html
\title Qt Creator: Setting Up a Generic Project
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-sharing-project-settings.html
\title Qt Creator: Sharing Project Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-opening.html
\title Qt Creator: Opening Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-managing.html
\title Qt Creator: Managing Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-cmake.html
\title Qt Creator: Setting Up a CMake Project
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-targets.html
\title Qt Creator: Adding Kits
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-tool-chains.html
\title Qt Creator: Adding Compilers
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-qbs.html
\title Qt Creator: Setting Up a Qbs Project
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-creating.html
\title Qt Creator: Creating Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-wizards.html
\title Qt Creator: Adding New Custom Wizards
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-wizards-json.html
\title Qt Creator: Adding JSON-Based Wizards
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-wizards-xml.html
\title Qt Creator: Adding XML-Based Wizards
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-projects-autotools.html
\title Qt Creator: Setting Up an Autotools Project
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-configuring-projects.html
\title Qt Creator: Configuring Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-build-process-customizing.html
\title Qt Creator: Customizing the Build Process
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-build-settings.html
\title Qt Creator: Specifying Build Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-code-style-settings.html
\title Qt Creator: Specifying Code Style Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-run-settings.html
\title Qt Creator: Specifying Run Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
\title Qt Creator: Adding Libraries to Projects
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-other.html
\title Qt Creator: Using Other Build Systems
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-running-targets.html
\title Qt Creator: Running on Multiple Platforms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-build-dependencies.html
\title Qt Creator: Specifying Dependencies
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-building-running.html
\title Qt Creator: Building and Running
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-editor-settings.html
\title Qt Creator: Specifying Editor Settings
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-qmake.html
\title Qt Creator: Adding Qt Versions
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-building-targets.html
\title Qt Creator: Building for Multiple Platforms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-using-qt-designer.html
\title Qt Creator: Developing Widget Based Applications
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-writing-program.html
\title Qt Creator: Creating a Qt Widget Based Application
*/
/*!
\externalpage http://doc.qt.io/qtcreator/adding-plugins.html
\title Qt Creator: Adding Qt Designer Plugins
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-configuring.html
\title Qt Creator: Configuring Qt Creator
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-debuggers.html
\title Qt Creator: Adding Debuggers
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtcreator-accelbubble-example.html
\title Qt Creator: Creating a Mobile Application
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-diff-editor.html
\title Qt Creator: Comparing Files
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-beautifier.html
\title Qt Creator: Beautifying Source Code
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-winrt.html
\title Qt Creator: Connecting Windows Runtime Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-clang-codemodel.html
\title Qt Creator: Parsing C++ Files
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-quick-ui-forms.html
\title Qt Creator: Qt Quick UI Forms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtcreator-uiforms-example.html
\title Qt Creator: Using Qt Quick UI Forms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html
\title Qt Creator: Using Clang Static Analyzer
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html
\title Qt Creator: Analyzing CPU Usage
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-autotest.html
\title Qt Creator: Running Autotests
*/
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://www.ietf.org/rfc/rfc1179.txt
\title RFC 1179
\keyword lpr
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1738.txt
\title RFC 1738
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1928.txt
\title RFC 1928
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1929.txt
\title RFC 1929
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2045.txt
\title RFC 2045
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2109.txt
\title RFC 2109
HTTP State Management Mechanism
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2965.txt
\title RFC 2965
HTTP State Management Mechanism
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3174.txt
\title RFC 3174
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3491.txt
\title RFC 3491
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3986.txt
\title RFC 3986
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2822.txt
\title RFC 2822
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1036.txt
\title RFC 1036
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc850.txt
\title RFC 850
*/
naturallanguage = zhcn
outputencoding = UTF-8
sourceencoding = UTF-8
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css *.glsl"
examples.imageextensions = "*.png *.jpg *.gif"
headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"
sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
#Additional HTML settings
HTML.nonavigationbar = "false"
HTML.tocdepth = 2
HTML.extraimages += template/images/arrow_bc.png \
template/images/home.png \
template/images/ico_out.png \
template/images/ico_note.png \
template/images/ico_note_attention.png \
template/images/btn_prev.png \
template/images/btn_next.png \
template/images/bullet_dn.png \
template/images/bullet_sq.png \
template/images/bgrContent.png \
template/images/logo.png
#specify which files in the output directory should be packed into the qch file.
#these files are assumed to be in each module's output directory."qtquick/images/ico_out.png" for example.
qhp.extraFiles += images/arrow_bc.png \
images/home.png \
images/ico_out.png \
images/ico_note.png \
images/ico_note_attention.png \
images/btn_prev.png \
images/btn_next.png \
images/bullet_dn.png \
images/bullet_sq.png \
images/bgrContent.png \
images/logo.png
#Default HTML footer for QDoc builds.
HTML.footer = \
" </div>\n" \
" </div>\n" \
" </div>\n" \
" </div>\n" \
"</div>\n" \
"<div class=\"footer\">\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2020 TopLinker Co.,Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners.<br>" \
" <a href=\"http://www.topibd.com\">无锡东领智能科技股份有限公司" </a> \
"</div>\n" \
#Default HTML header for QDoc builds.
#specify the CSS file used by this template
HTML.stylesheets = template/style/offline.css
#for including files into the qch file
qhp.extraFiles += style/offline.css
HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
HTML.endheader = \
"</head>\n"
HTML.postheader = \
"<body>\n" \
"<div class=\"header\" id=\"qtdocheader\">\n"\
" <div class=\"main\">\n" \
" <div class=\"main-rounded\">\n" \
" <div class=\"navigationbar\">\n"\
" <ul>\n"\
HTML.postpostheader = \
" </ul>\n"\
" </div>\n" \
"</div>\n" \
"<div class=\"content\">\n" \
"<div class=\"line\">\n" \
"<div class=\"content mainContent\">\n" \
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page search-results.html
\title Search Results
\raw HTML
<link rel="stylesheet" type="text/css" href="style/gsc.css" />
<script type="text/javascript">
$(function(){ $(".title").append(": " + decodeURIComponent(location.search.split('=')[1]).substring(0,32)); });
</script>
<gcse:searchresults-only></gcse:searchresults-only>
\endraw
*/
\section1 Running the Example
To run the example from \l{Qt Creator Manual}{Qt Creator}, open the \gui Welcome
mode and select the example from \gui Examples. For more information, visit
\l{Qt Creator: Building and Running an Example}{Building and Running an Example}.
macro.aacute.HTML = "&aacute;"
macro.Aring.HTML = "&Aring;"
macro.aring.HTML = "&aring;"
macro.Auml.HTML = "&Auml;"
macro.author = "\\b{Author:}"
macro.BR.HTML = "<br />"
macro.copyright.HTML = "&copy;"
macro.eacute.HTML = "&eacute;"
macro.gui = "\\b"
macro.HR.HTML = "<hr />"
macro.iacute.HTML = "&iacute;"
macro.key = "\\b"
macro.macos = "macOS"
macro.menu = "\\b"
macro.oslash.HTML = "&oslash;"
macro.ouml.HTML = "&ouml;"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
macro.QQV = "\\e{Qt QML Viewer}"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.rarrow.HTML = "&rarr;"
macro.reg.HTML = "<sup>&reg;</sup>"
macro.return = "Returns"
macro.starslash = "\\c{*/}"
macro.begincomment = "\\c{/*}"
macro.endcomment = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
macro.pi.HTML = "&Pi;"
macro.beginqdoc.HTML = "/*!"
macro.endqdoc.HTML = "*/"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
macro.clearfloat.HTML = "<br style=\"clear: both\" />"
macro.emptyspan.HTML = "<span></span>"
# Additional meta information (attributes for matched entries, as well as tags)
# to be added to manifest.xml files.
#
# manifestmeta.filters = <filter1>,<filter2>,...
#
# manifestmeta.<filter>.names = <Module1>/<name1>,<Module2>/<name2>,..
# manifestmeta.<filter>.attributes = <attribute1:value1>,<attribute2:value2>,..
# manifestmeta.<filter>.tags = <tag1>,<tag2>,..
#
# <filter>.names specify all the module/name combinations to apply the
# attributes/tags to. You can use simple wildcard matching by appending
# '*' at the end of name.
#
# Note: You cannot use operators (+, =, -) in the names.
#
# Examples: add a 'isHighlighted' attribute for two 'Analog Clock' examples,
# add a 'database' tag for QtSql examples, and a 'qt5' tag for all examples
#
# manifestmeta.filters = highlighted sql global
#
# manifestmeta.highlighted.names = "QtGui/Analog Clock Window Example" \
# "QtWidgets/Analog Clock Example"
# manifestmeta.highlighted.attributes = isHighlighted:true
#
# manifestmeta.sql.names = "QtSql/*"
# manifestmeta.sql.tags = database
#
# manifestmeta.global.names = *
# manifestmeta.global.tags = qt5
manifestmeta.filters = highlighted android thumbnail ios
manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Photo Surface" \
"QtQuick/Qt Quick Demo - Tweet Search" \
"QtQuick/Qt Quick Demo - Maroon*" \
"QtQuick/Qt Quick Demo - Calqlatr" \
"QtQuick/Qt Quick Demo - StocQt" \
"QtQuick/Qt Quick Demo - Clocks" \
"QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuickExtras/Qt Quick Extras - Dashboard" \
"QtQuickExtras/Qt Quick Extras - Flat" \
"QtQuickExtras/Qt Quick Extras - Gallery" \
"QtQuickControls/Qt Quick Controls - Gallery" \
"QtQuickControls/Qt Quick Controls - Text Editor Example" \
"QtQuickControls/Qt Quick Controls - Table View Example" \
"QtQuickControls/Qt Quick Controls - Calendar Example" \
"QtQuickControls/Qt Quick Controls - File System Browser Example" \
"QtQuickDialogs/Qt Quick System Dialog Examples" \
"QtWinExtras/Quick Player" \
"QtMultimedia/QML Video Shader Effects Example" \
"QtCanvas3D/Planets Example" \
"QtCanvas3D/Interactive Mobile Phone Example" \
"QtLocation/Map Viewer (QML)"
manifestmeta.highlighted.attributes = isHighlighted:true
manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \
"QtQuick/Qt Quick Demo - Calqlatr" \
"QtWidgets/Application Chooser Example" \
"QtWidgets/Stickman Example" \
"QtWidgets/Move Blocks Example" \
"QtWidgets/Border Layout Example" \
"QtWidgets/Flow Layout Example" \
"QtWidgets/Dock Widgets Example" \
"QtWidgets/Recent Files Example" \
"QtWidgets/Concentric Circles Example" \
"QtWidgets/Gradients" \
"QtWidgets/Font Sampler Example" \
"QtWidgets/Path Stroking" \
"QtWidgets/Transformations Example" \
"QtWidgets/Syntax Highlighter Example" \
"QtWidgets/Calendar Example" \
"QtWidgets/Analog Clock Example" \
"QtWidgets/Calculator Example" \
"QtWidgets/Mouse Button Tester" \
"QtWidgets/Character Map Example" \
"QtWidgets/Digital Clock Example" \
"QtWidgets/Elided Label Example" \
"QtWidgets/Sliders Example" \
"QtWidgets/Tetrix Example" \
"QtWidgets/Group Box Example" \
"QtWidgets/Undo Framework" \
"QtWidgets/Colliding Mice Example" \
"QtWidgets/Diagram Scene Example" \
"QtWidgets/Elastic Nodes Example" \
"QtWidgets/Weather Anchor Layout Example" \
"QtNetwork/Torrent Example" \
"QtNetwork/Network Chat Example" \
"QtSQL/Master Detail Example" \
"QtLinguist/Arrow Pad Example" \
"QtGui/Raster Window Example" \
"QtGui/Analog Clock Window Example" \
"QtAndroidExtras/Qt Notifier" \
"QtMultimedia/QML Video Shader Effects Example" \
"QtMultimedia/QML Video Example" \
"QtMultimedia/QML Camera Example" \
"QtSVG/Text Object Example" \
"QtQML/Qt Quick Examples - XMLHttpRequest" \
"QtQuick/Qt Quick Particles Examples - *" \
"QtQuick/Qt Quick Examples - Touch Interaction" \
"QtQuick/Scene Graph - Custom Geometry" \
"QtQuick/Scene Graph - Graph" \
"QtQuick/Scene Graph - OpenGL Under QML" \
"QtQuick/Scene Graph - Painted Item" \
"QtQuick/Scene Graph - Rendering FBOs" \
"QtQuick/Scene Graph - Simple Material" \
"QtQuick/Qt Quick Examples - Image Elements" \
"QtQuick/Qt Quick Examples - Key Interaction" \
"QtQuick/Qt Quick Examples - Text" \
"QtQuick/Qt Quick Examples - Animation" \
"QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuick/Qt Quick Examples - Canvas" \
"QtQuick/Qt Quick Examples - MouseArea" \
"QtQuick/Qt Quick Examples - Positioners" \
"QtQuick/Qt Quick Examples - Right to Left" \
"QtWidgets/Interview" \
"QtWidgets/Spreadsheet" \
"QtWidgets/Pixelator Example" \
"QtWidgets/Animated Tiles Example" \
"QtWidgets/Affine Transformations" \
"QtWidgets/Image Composition Example" \
"QtWidgets/Basic Drawing Example" \
"QtWidgets/Vector Deformation" \
"QtWidgets/Painter Paths Example" \
"QtWidgets/Style Sheet Example" \
"QtWidgets/Code Editor Example" \
"QtWidgets/Scribble Example" \
"QtWidgets/Line Edits Example" \
"QtWidgets/Calendar Widget Example" \
"QtWidgets/Completer Example" \
"QtWidgets/I18N Example" \
"QtQML/Extending QML - Grouped Properties Example" \
"QtQML/Extending QML - Methods Example" \
"QtQML/Extending QML - Signal Support Example" \
"QtQML/Extending QML - Attached Properties Example"
manifestmeta.android.tags = android
manifestmeta.ios.names = "QtCore/Contiguous Cache Example" \
"QtCore/Mandelbrot Example" \
"QtCore/Queued Custom Type Example" \
"QtGui/Analog Clock Window Example" \
"QtGui/OpenGL Window Example" \
"QtGui/Raster Window Example" \
"QtNetwork/Loopback Example" \
"QtNetwork/Network Chat Example" \
"QtNetwork/Torrent Example" \
"QtOpenGL/2D Painting Example" \
"QtOpenGL/Textures Example" \
"QtWidgets/Animated Tiles Example" \
"QtWidgets/Application Chooser Example" \
"QtWidgets/Easing Curves Example" \
"QtWidgets/Move Blocks Example" \
"QtWidgets/States Example" \
"QtWidgets/Class Wizard Example" \
"QtWidgets/Find Files Example" \
"QtWidgets/License Wizard Example" \
"QtWidgets/Standard Dialogs Example" \
"QtWidgets/Tab Dialog Example" \
"QtWidgets/Trivial Wizard Example" \
"QtWidgets/Draggable Text Example" \
"QtWidgets/Fridge Magnets Example" \
"QtWidgets/Blur Picker Effect Example" \
"QtWidgets/Fade Message Effect Example" \
"QtWidgets/Lighting Effect Example" \
"QtWidgets/Anchor Layout Example" \
"QtWidgets/Basic Graphics Layouts Example" \
"QtWidgets/40000 Chips" \
"QtWidgets/Colliding Mice Example" \
"QtWidgets/Diagram Scene Example" \
"QtWidgets/Elastic Nodes Example" \
"QtWidgets/Embedded Dialogs" \
"QtWidgets/Graphics View Flow Layout Example" \
"QtWidgets/Simple Anchor Layout Example" \
"QtWidgets/Weather Anchor Layout Example" \
"QtWidgets/Address Book Example" \
"QtWidgets/Basic Sort/Filter Model Example" \
"QtWidgets/Chart Example" \
"QtWidgets/Custom Sort/Filter Model Example" \
"QtWidgets/Dir View Example" \
"QtWidgets/Editable Tree Model Example" \
"QtWidgets/Frozen Column Example" \
"QtWidgets/Interview" \
"QtWidgets/Simple Tree Model Example" \
"QtWidgets/Simple Widget Mapper Example" \
"QtWidgets/Basic Layouts Example" \
"QtWidgets/Border Layout Example" \
"QtWidgets/Flow Layout Example" \
"QtWidgets/Basic Drawing Example" \
"QtWidgets/Concentric Circles Example" \
"QtWidgets/Font Sampler Example" \
"QtWidgets/Gradients" \
"QtWidgets/Image Composition Example" \
"QtWidgets/Painter Paths Example" \
"QtWidgets/Transformations Example" \
"QtWidgets/Calendar Example" \
"QtWidgets/Order Form Example" \
"QtWidgets/Syntax Highlighter Example" \
"QtWidgets/Text Edit" \
"QtWidgets/Traffic Light Example" \
"QtWidgets/Two-way Button Example" \
"QtWidgets/Completer Example" \
"QtWidgets/Custom Completer Example" \
"QtWidgets/Undo Framework" \
"QtWidgets/Analog Clock Example" \
"QtWidgets/Calculator Example" \
"QtWidgets/Calendar Widget Example" \
"QtWidgets/Character Map Example" \
"QtWidgets/Code Editor Example" \
"QtWidgets/Digital Clock Example" \
"QtWidgets/Elided Label Example" \
"QtWidgets/Line Edits Example" \
"QtWidgets/Scribble Example" \
"QtWidgets/Shaped Clock Example" \
"QtWidgets/Sliders Example" \
"QtWidgets/Validators Example" \
"QtWidgets/Window Flags Example" \
"QtWidgets/Wiggly Example" \
"QtQuick/Qt Quick Examples - Animation" \
"QtQuick/Qt Quick Examples - Canvas" \
"QtQuick/Qt Quick Examples - Drag and Drop" \
"QtQuick/Qt Quick Examples - Image Elements" \
"QtQuick/Qt Quick Examples - MouseArea" \
"QtQuick/Qt Quick Examples - Positioners" \
"QtQuick/Qt Quick Examples - Right to Left" \
"QtQuick/Scene Graph - OpenGL Under QML" \
"QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuick/Qt Quick Examples - Text" \
"QtQuick/Qt Quick Examples - Touch Interaction" \
"QtQuick/Qt Quick Examples - Views" \
"QtQuick/Qt Quick Examples - Window and Screen"
manifestmeta.ios.tags = ios
# add a generic thumbnail image to examples that do not have any images in their documentation
#manifestmeta.thumbnail.attributes = "imageUrl:qthelp\://org.qt-project.qtdoc.$QT_VERSION_TAG/qtdoc/images/qt-codesample.png"
manifestmeta.thumbnail.names = "QtCore/Contiguous Cache Example" \
"QtCore/Custom Type Example" \
"QtCore/JSON Save Game Example" \
"QtCore/Semaphores Example" \
"QtCore/Wait Conditions Example" \
"QtConcurrent/Map Example" \
"QtConcurrent/QtConcurrent Word Count Example" \
"QtConcurrent/Run Function Example" \
"QtGui/Raster Window Example" \
"QtNetwork/Network Download*" \
"QtWidgets/Dynamic Layouts Example" \
"QtWidgets/Event Transitions Example" \
"QtWidgets/Two-way Button Example" \
"QtWidgets/Validators Example" \
"QtDbus/*" \
"QtHelp/*" \
"QtMultimedia/AudioEngine Example" \
"QtQml/Extending QML*" \
"QtQuick/C++ Extensions: Image Response Provider Example" \
"QtQuick/Qt Quick Examples - Accessibility" \
"QtSensors/Qt Sensors - SensorGesture QML Type example" \
"QtWinExtras/Icon Extractor"
versionsym = QT_VERSION_STR
defines += Q_QDOC \
QT_.*_SUPPORT \
QT_.*_LIB \
QT_COMPAT \
QT_KEYPAD_NAVIGATION \
QT_NO_EGL \
QT3_SUPPORT \
Q_DEAD_CODE_FROM_QT4_.* \
Q_OS_.* \
Q_BYTE_ORDER \
QT_DEPRECATED \
QT_DEPRECATED_* \
Q_NO_USING_KEYWORD \
__cplusplus \
Q_COMPILER_INITIALIZER_LISTS \
Q_COMPILER_UNIFORM_INIT \
Q_COMPILER_RVALUE_REFS
Cpp.ignoretokens += \
ENGINIOCLIENT_EXPORT \
PHONON_EXPORT \
Q_AUTOTEST_EXPORT \
Q_BLUETOOTH_EXPORT \
Q_COMPAT_EXPORT \
Q_CORE_EXPORT \
Q_CORE_EXPORT_INLINE \
Q_DBUS_EXPORT \
Q_DECL_CONSTEXPR \
Q_DECL_RELAXED_CONSTEXPR \
Q_DECL_CONST_FUNCTION \
Q_DECL_DEPRECATED \
Q_DECL_NOEXCEPT \
Q_DECL_FINAL \
Q_DECL_OVERRIDE \
Q_DECL_NOTHROW \
Q_DECL_PURE_FUNCTION \
Q_DECL_UNUSED \
Q_DECL_CF_RETURNS_RETAINED \
Q_DECL_NS_RETURNS_AUTORELEASED \
Q_DECL_EQ_DEFAULT \
Q_DECLARATIVE_EXPORT \
Q_EXPLICIT \
Q_EXPORT \
Q_EXPORT_CODECS_CN \
Q_EXPORT_CODECS_JP \
Q_EXPORT_CODECS_KR \
Q_EXPORT_PLUGIN \
Q_EXPORT_PLUGIN2 \
Q_GADGET \
Q_GFX_INLINE \
Q_GUI_EXPORT \
Q_GUI_EXPORT_INLINE \
Q_GUI_EXPORT_STYLE_CDE \
Q_GUI_EXPORT_STYLE_COMPACT \
Q_GUI_EXPORT_STYLE_MAC \
Q_GUI_EXPORT_STYLE_MOTIF \
Q_GUI_EXPORT_STYLE_MOTIFPLUS \
Q_GUI_EXPORT_STYLE_PLATINUM \
Q_GUI_EXPORT_STYLE_POCKETPC \
Q_GUI_EXPORT_STYLE_SGI \
Q_GUI_EXPORT_STYLE_WINDOWS \
Q_GUI_EXPORT_STYLE_WINDOWSXP \
Q_INLINE_TEMPLATE \
Q_INTERNAL_WIN_NO_THROW \
Q_INVOKABLE \
Q_LOCATION_EXPORT \
Q_POSITIONING_EXPORT \
Q_MULTIMEDIA_EXPORT \
Q_NETWORK_EXPORT \
Q_NEVER_INLINE \
Q_NORETURN \
Q_OPENGL_EXPORT \
Q_OPENVG_EXPORT \
Q_OUTOFLINE_TEMPLATE \
Q_PRINTSUPPORT_EXPORT \
Q_QML_EXPORT \
Q_REQUIRED_RESULT \
Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \
Q_SERIALBUS_EXPORT \
Q_SQL_EXPORT \
Q_SVG_EXPORT \
Q_TESTLIB_EXPORT \
Q_TYPENAME \
Q_WIDGETS_EXPORT \
Q_WINEXTRAS_EXPORT \
Q_XML_EXPORT \
Q_XMLPATTERNS_EXPORT \
Q_XMLSTREAM_EXPORT \
QAXFACTORY_EXPORT \
QDBUS_EXPORT \
QDESIGNER_COMPONENTS_LIBRARY \
QDESIGNER_EXTENSION_LIBRARY \
QDESIGNER_SDK_LIBRARY \
QDESIGNER_SHARED_LIBRARY \
QDESIGNER_UILIB_LIBRARY \
QHELP_EXPORT \
QM_AUTOTEST_EXPORT \
QM_EXPORT_CANVAS \
QM_EXPORT_DNS \
QM_EXPORT_DOM \
QM_EXPORT_FTP \
QM_EXPORT_HTTP \
QM_EXPORT_ICONVIEW \
QM_EXPORT_NETWORK \
QM_EXPORT_OPENGL \
QM_EXPORT_OPENVG \
QM_EXPORT_SQL \
QM_EXPORT_TABLE \
QM_EXPORT_WORKSPACE \
QM_EXPORT_XML \
QT_ASCII_CAST_WARN \
QT_ASCII_CAST_WARN_CONSTRUCTOR \
QT_BEGIN_INCLUDE_NAMESPACE \
QT_BEGIN_NAMESPACE \
QT_BOOTSTRAPPED \
QT_DESIGNER_STATIC \
QT_END_INCLUDE_NAMESPACE \
QT_END_NAMESPACE \
QT_FASTCALL \
QT_MUTEX_LOCK_NOEXCEPT \
QT_WARNING_PUSH \
QT_WARNING_POP \
QT_WIDGET_PLUGIN_EXPORT \
QWEBKIT_EXPORT
Cpp.ignoredirectives += \
__attribute__ \
K_DECLARE_PRIVATE \
PHONON_HEIR \
PHONON_OBJECT \
Q_CLASSINFO \
Q_DECLARE_INTERFACE \
Q_DECLARE_METATYPE \
Q_DECLARE_OPERATORS_FOR_FLAGS \
Q_DECLARE_PRIVATE \
Q_DECLARE_PRIVATE_D \
Q_DECLARE_PUBLIC \
Q_DECLARE_SHARED \
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 \
Q_DECLARE_TR_FUNCTIONS \
Q_DECLARE_TYPEINFO \
Q_DECL_NOEXCEPT_EXPR \
QT_DEPRECATED_X \
Q_DISABLE_COPY \
Q_DUMMY_COMPARISON_OPERATOR \
Q_ENUM \
Q_ENUMS \
Q_FLAG \
Q_FLAGS \
Q_INTERFACES \
Q_PRIVATE_PROPERTY \
QT_FORWARD_DECLARE_CLASS \
Q_DECLARE_HANDLE \
Q_REVISION \
QT_WARNING_DISABLE_CLANG \
QT_WARNING_DISABLE_GCC \
QT_WARNING_DISABLE_INTEL \
QT_WARNING_DISABLE_MSVC \
Q_ATTRIBUTE_FORMAT_PRINTF \
Q_MV_IOS
# Qt 6: Remove
falsehoods += \
"QT_VERSION >= QT_VERSION_CHECK\\(6,0,0\\)"
# Specify a custom CSS file used by this template
HTML.stylesheets += template/style/offline-simple.css
qhp.extraFiles += style/offline-simple.css
# Override the header styles
HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline-simple.css\" />\n" \
" <script type=\"text/javascript\">\n" \
" document.getElementsByTagName(\"link\").item(0).setAttribute(\"href\", \"style/offline.css\");\n" \
" </script>\n"
HTML.postheader = \
"<body>\n" \
"<div class=\"header\" id=\"qtdocheader\">\n"\
" <div class=\"main\">\n" \
" <div class=\"main-rounded\">\n" \
" <div class=\"navigationbar\">\n" \
" <table><tr>\n"
HTML.postpostheader = \
" </tr></table>\n"\
" </div>\n" \
" </div>\n" \
"<div class=\"content\">\n" \
"<div class=\"line\">\n" \
"<div class=\"content mainContent\">\n"
HTML.navigationseparator = \
"<span class=\"naviSeparator\"> &#9702; </span>\n"
# Add some padding around code snippets, as we cannot
# currectly style them for QTextBrowser using only CSS.
codeindent = 2
codeprefix = "\n\n"
codesuffix = "\n\n"
#include standard set of HTML header and footer.
include(html-config.qdocconf)
include(html-header-offline.qdocconf)
include(html-footer.qdocconf)
#uncomment if navigation bar is not wanted
#HTML.nonavigationbar = "true"
HTML.stylesheets = template/style/offline.css
HTML.extraimages += template/images/ico_out.png \
template/images/ico_note.png \
template/images/ico_note_attention.png \
template/images/btn_prev.png \
template/images/btn_next.png \
template/images/bullet_dn.png \
template/images/bullet_sq.png \
template/images/bgrContent.png
#specify which files in the output directory should be packed into the qch file.
qhp.extraFiles += style/offline.css \
images/ico_out.png \
images/ico_note.png \
images/ico_note_attention.png \
images/btn_prev.png \
images/btn_next.png \
images/bullet_dn.png \
images/bullet_sq.png \
images/bgrContent.png
# By default, include override definitions for a simplified template/CSS,
# suited for rendering HTML with QTextBrowser. Comment out this line to
# select the standard CSS.
include(qt-html-templates-offline-simple.qdocconf)
#The default configuration for a Qt 5 module, including Add-Ons and Tools.
#Include this file for a standard Qt 5 module; builds with the offline style.
#include standard set of macros and C++ defines and ignores
include(macros.qdocconf)
include(qt-cpp-defines.qdocconf)
include(compat.qdocconf)
#include(manifest-meta.qdocconf)
include(fileextensions.qdocconf)
include(qt-html-templates-offline.qdocconf)
#extra configuration data such as file extensions
include(config.qdocconf)
# Show Qt version as part of the navigation bar
buildversion = "TopIKM6 Reference Documentation"
var vOffset_init = 65;
var vOffset = vOffset_init;
var c = 'collapsed';
function toggleList(toggle, content, maxItems) {
if (toggle.css('display') == 'none') {
vOffset = vOffset_init;
toggle.removeClass(c);
content.show();
return;
} else
vOffset = 8;
if (maxItems > content.children().length)
return;
content.hide();
toggle.addClass(c);
}
$(function () {
$('a[href*=#]:not([href=#])').on('click', function (e) {
if (e.which == 2 || e.metaKey || e.ctrlKey || e.shiftKey)
return true;
var target = $(this.hash.replace(/(\.)/g, "\\$1"));
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
setTimeout(function () {
$('html, body').animate({scrollTop: target.offset().top - vOffset}, 50);}, 50);
}
});
});
$(window).load(function () {
var hashChanged = function() {
var h = window.location.hash;
var re = /[^a-z0-9_\.\#\-]/i
if (h.length > 1 && !re.test(h)) {
setTimeout(function () {
var tgt = $(h.replace(/(\.)/g, "\\$1"));
tgt = tgt.length ? tgt : $('[name=' + h.slice(1) + ']');
$(window).scrollTop(tgt.offset().top - vOffset);
}, 0);
}
}
$(window).bind('hashchange', hashChanged);
hashChanged.call();
if (!$('.sidebar toc').is(':empty')) {
$('<div id="toc-toggle"></div>').prependTo('.sidebar .toc');
var toc = $('.sidebar .toc ul');
var tocToggle = $('#toc-toggle');
var tocCallback = function() { toggleList(tocToggle, toc, 4); };
$('#toc-toggle').on('click', function(e) {
e.stopPropagation();
toc.toggle();
tocToggle.toggleClass(c);
});
tocCallback.call();
$(window).resize(tocCallback);
}
if (!$('#sidebar-content').is(':empty')) {
$('#sidebar-content h2').first().clone().prependTo('#sidebar-content');
$('<div id="sidebar-toggle"></div>').prependTo('#sidebar-content');
var sb = $('#sidebar-content .sectionlist');
var sbToggle = $('#sidebar-toggle');
var sbCallback = function() { toggleList(sbToggle, sb, 0); };
$('#sidebar-toggle').on('click', function(e) {
e.stopPropagation();
sb.toggle();
sbToggle.toggleClass(c);
});
sbCallback.call();
$(window).resize(sbCallback);
}
});
"use strict";
function createCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
} else {
expires = "";
}
document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/";
$('.cookies_yum').click(function() {
$(this).fadeOut()
});
}
function readCookie(name) {
var nameEQ = escape(name) + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) === 0) return unescape(c.substring(nameEQ.length, c.length));
}
return null;
}
function eraseCookie(name) {
createCookie(name, "", -1);
}
function load_sdk(s, id, src) {
var js, fjs = document.getElementsByTagName(s)[0];
if (document.getElementById(id)) return;
js = document.createElement(s);
js.id = id;
js.src = src;
fjs.parentNode.insertBefore(js, fjs);
}
$(document).ready(function($) {
if (document.documentElement.clientWidth < 1280) {
oneQt.extraLinksToMain();
}
$('#menuextras .search').click(function(e){
e.preventDefault();
$('.big_bar.account').slideUp();
$('.big_bar.search').slideToggle();
$('.big_bar_search').focus();
$(this).toggleClass('open');
});
$('.cookies_yum').click(function() {
$('.cookies_yum').fadeOut();
createCookie("cookies_nom", "yum", 180);
var cookie_added = 1;
});
if (!(readCookie('cookies_nom') == 'yum')) {
$('.cookies_yum').fadeIn();
} else {
var cookie_added = 1;
}
Modernizr.load({test: Modernizr.input.placeholder,
nope: wpThemeFolder + '/js/placeholders.min.js'});
$('#navbar .navbar-toggle').click(function(e) {
e.preventDefault();
if ($(this).hasClass('opened')) {
$(this).removeClass('opened');
$('#navbar .navbar-menu').css('max-height', '0px');
}
else {
$(this).addClass('opened');
$('#navbar .navbar-menu').css('max-height', $('#navbar .navbar-menu ul').outerHeight() + 'px');
}
});
$(window).resize(function() {
oneQt.stickySidebar();
oneQt.footerPosition();
if (document.documentElement.clientWidth < 1280) {
oneQt.extraLinksToMain();
} else {
oneQt.mainLinkstoExtra();
}
});
$(window).scroll(function() {
oneQt.stickySidebar();
oneQt.stickyHeader();
});
oneQt.stickySidebar();
oneQt.footerPosition();
oneQt.tabContents();
});
$( window ).load(function() {
load_sdk('script', 'facebook-jssdk','//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=207346529386114&version=v2.0');
load_sdk('script', 'twitter-wjs', '//platform.twitter.com/widgets.js');
$.getScript("//www.google.com/jsapi", function(){
google.load("feeds", "1", {"callback": oneQt.liveFeeds});
});
});
var oneQt = {
stickySidebar: function() {
if ($('#sidebar').length && $('#sidebar').outerHeight() > 20) {
var $sidebar = $('#sidebar');
var $win = $(window);
var $sidebarContainer = $sidebar.parent();
var headerHeight = $('#navbar').outerHeight();
if ($win.outerHeight() - headerHeight > $sidebar.innerHeight() &&
$win.scrollTop() > $sidebarContainer.offset().top) {
var newTop = headerHeight + $win.scrollTop() - $sidebarContainer.offset().top;
if (newTop + $sidebar.innerHeight() > $sidebarContainer.innerHeight())
newTop = $sidebarContainer.innerHeight() - $sidebar.innerHeight();
$sidebar.css({top: newTop +'px'})
}
else {
$sidebar.css({top: '0'})
}
}
},
footerPosition: function () {
$('#footerbar').removeClass('fixed');
if (($('.hbspt-form').length > 0) || ($('#customerInfo').length > 0) || ($('.purchase_bar').length > 0)) {
var footerBottomPos = $('#footerbar').offset().top + $('#footerbar').outerHeight();
if (footerBottomPos < $(window).height())
$('#footerbar').addClass('fixed');
}
},
stickyHeader: function () {
var originalHeaderHeight = 79;
if ($(window).scrollTop() > originalHeaderHeight) {
$('#navbar').addClass('fixed');
$('#bottom_header').fadeOut();
if (!(cookie_added == 1)) {
$('.cookies_yum').fadeOut();
createCookie("cookies_nom", "yum", 180);
var cookie_added = 1;
}
}
else {
$('#navbar').removeClass('fixed');
$('#bottom_header').fadeIn();
}
},
tabContents: function () {
$('.tab-container').each(function(i) {
var $el = $(this);
$el.find('.tab-titles li:eq(0)').addClass('active');
$el.find('.tab-contents .tab:eq(0)').addClass('active');
$el.find('.tab-titles a').click(function(e) {
e.preventDefault();
var index = $(this).parent().index();
$el.find('.tab-titles li').removeClass('active');
$el.find('.tab-contents .tab').removeClass('active');
$(this).parent().addClass('active');
$el.find('.tab-contents .tab').eq(index).addClass('active');
})
});
},
liveFeeds: function () {
$('.feed-container').each(function(i) {
var feedUrl = $(this).data('url');
if (feedUrl != "") oneQt.blogFeed($(this), feedUrl);
});
},
blogFeed: function ($container, feedUrl) {
var feed = new google.feeds.Feed(feedUrl);
feed.setNumEntries(3);
feed.load(function(result) {
$container.html('');
if (!result.error) {
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var $article = $('<article class="discussion-tile cf"></article>');
$container.append($article);
var html = ' <div class="author retina">';
html += ' <img src="'+wpThemeFolder+'/assets/images/author_placeholder.png" alt="">';
html += ' </div>';
html += ' <div class="discussion-item">';
html += ' <h4><a href="'+encodeURI(entry.link)+'"></a></h4>'
html += ' <h3><a href="'+encodeURI(entry.link)+'" target="_blank"></a></h3>'
html += ' <p><a href="'+encodeURI(entry.link)+'" target="_blank"></a></p>';
html += ' <ul class="taglist cf">';
html += ' </ul>';
html += ' </div>';
$article.append(html);
$article.find('h4 a').text(result.feed.title);
$article.find('h3 a').text(entry.title);
$article.find('p a').text(entry.author);
try {
for (var j=0; j<entry.categories.length; j++) {
var $li = $('<li><a href="'+encodeURI(entry.link)+'" target="_blank" class="btn btn-tag"></a></li>');
$li.find('a').text(entry.categories[j]);
$article.find('.taglist').append($li);
}
} catch(e) {}
}
if (result.feed.link && result.feed.link != "") {
var linkHtml = '<a href="'+encodeURI(result.feed.link)+'" class="text-lightgrey" target="_blank">Show all</a>';
$container.append(linkHtml);
}
}
});
},
extraLinksToMain: function() {
var extramenuLinks = $('#menuextras').find('li');
var mainmenu = $('#mainmenu');
var count = 0;
if ($(extramenuLinks).length > 2) {
$(extramenuLinks).each(function() {
if (count < 3) {
var newLink = $(this);
$(newLink).addClass('dynamic-add');
$(mainmenu).append(newLink);
}
count++;
});
}
},
mainLinkstoExtra: function() {
var mainmenuLinks = $('#mainmenu').find('.dynamic-add');
var extramenu = $('#menuextras');
var count = 0;
$(mainmenuLinks).each(function() {
var newLink = $(this);
$(extramenu).prepend(newLink);
count++;
});
}
}
.gsc-control-cse table, table td, table th {
border: none !important;
margin-bottom: 10px !important
}
.gsc-control-cse {
width: 100% !important;
box-sizing: border-box !important
}
.gsc-control-cse * {
font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
line-height: 1.5 !important;
font-weight: 300 !important
}
.gsc-control-cse,
.gsc-control-cse .gsc-table-result {
width: 100% !important;
font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
font-weight: 300 !important;
font-size: 13px !important
}
.gsc-resultsHeader {
width: 100% !important;
clear: both !important
}
.gsc-resultsHeader td.gsc-twiddleRegionCell {
width: 75% !important
}
.gsc-resultsbox-visible {
display: block !important
}
.gsc-resultsbox-invisible {
display: none !important
}
.gsc-results {
padding-bottom: 2px !important;
width: 99% !important
}
.gsc-result {
margin-bottom: 10px !important
}
.gsc-result .gs-title {
height: 1.4em !important;
overflow: hidden !important
}
.gsc-result div.gs-watermark {
display: none !important
}
.gsc-results .gsc-result img.gs-ad-marker {
display: none !important
}
.gsc-webResult:after {
content: "." !important;
display: block !important;
height: 0 !important;
clear: both !important;
visibility: hidden !important
}
.gsc-webResult {
zoom: 1 !important
}
.gsc-webResult .gsc-result {
margin: 0 !important;
padding: .5em 0 !important;
border-bottom: 1px solid #ebebeb !important
}
.gsc-above-wrapper-area {
border-bottom: 1px solid #E9E9E9 !important;
padding: 5px 0 5px 0 !important
}
.gsc-above-wrapper-area-invisible {
display: none !important
}
.gsc-above-wrapper-area-container {
width: 100% !important
}
.gsc-result-info {
text-align: left !important;
color: #676767 !important;
font-size: 13px !important;
padding-left: 8px !important;
margin: 10px 0 10px 0 !important
}
.gsc-result-info-container {
text-align: left !important
}
.gsc-result-info-invisible {
display: none !important
}
.gsc-orderby-container {
text-align: right !important;
background: transparent !important
}
.gsc-orderby-invisible {
display: none !important
}
.gsc-orderby-label {
color: #676767 !important;
padding: 5px 5px 6px 0 !important
}
.gsc-selected-option-container {
background-color: transparent !important;
border: 1px solid #eee !important;
border: 1px solid rgba(0, 0, 0, 0.1) !important;
border-radius: 2px !important;
box-shadow: none !important;
color: #444 !important;
cursor: default !important;
font-size: 11px !important;
font-weight: bold !important;
height: 20px !important;
line-height: 20px !important;
max-width: 90% !important;
min-width: 54px !important;
outline: 0 !important;
padding: 0 28px 0 6px !important;
position: relative !important;
text-align: center !important;
width: 50px !important !important
}
.gsc-selected-option {
position: relative !important;
width: 100% !important;
}
.gsc-control-cse .gsc-option-selector {
border: none !important;
height: 11px !important;
margin-top: -4px !important;
position: absolute !important;
right: 5px !important;
top: 8px !important;
width: 7px !important;
padding: 0 5px 0 5px !important;
background: url(//ssl.gstatic.com/ui/v1/disclosure/small-grey-disclosure-arrow-down.png) center no-repeat
}
.gsc-results .gsc-cursor-box .gsc-trailing-more-results {
margin-bottom: 0 !important;
display: inline !important
}
.gsc-results .gsc-cursor {
display: inline !important
}
.gsc-results .gsc-cursor-box {
margin: 10px 5px 10px !important
}
.gsc-results .gsc-cursor-box .gsc-cursor-page {
cursor: pointer !important;
color: #000000 !important;
text-decoration: underline !important;
margin-right: 8px !important;
display: inline !important
}
.gsc-results .gsc-cursor-box .gsc-cursor-current-page {
cursor: default !important;
color: white !important;
background-color: #5caa15 !important;
font-weight: bold !important;
text-decoration: none !important;
padding: 0 3px 0 3px !important;
margin-top: 10px !important;
cursor: pointer !important
}
.gs-result .gs-title,
.gs-result .gs-title * {
color: #5caa15 !important;
text-decoration: underline !important
}
.gs-webResult div.gs-visibleUrl-long,
.gs-promotion div.gs-visibleUrl-long {
overflow: hidden !important;
display: none !important
}
.gs-webResult div.gs-per-result-labels a.gs-label {
text-decoration: underline !important;
cursor: pointer !important;
padding: 3px !important;
color: #26282a !important
}
.gs-webResult div.gs-per-result-labels a.gs-label.gs-labelActive {
cursor: default !important;
text-decoration: none !important
}
.gsc-control-cse:after {
content: "." !important;
display: block !important;
clear: both !important;
height: 0 !important;
visibility: hidden !important
}
*:first-child + html .gsc-inline-block {
display: inline !important
}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="512">
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
<glyph unicode="&#xe600;" d="M70.281 478.981c-38.026 6.451-70.281-21.729-70.281-62.472v-448.51l347.671 58.398c24.106 4.075 42.78 32.255 42.78 62.812v337.486l-320.17 52.286zM232.233 147.608c-10.185-23.767-25.464-39.045-46.175-46.514 2.037-10.865 5.433-17.655 9.506-21.729 2.376-2.037 5.772-3.735 9.846-3.735h11.544c-2.376 0-4.414-0.679-6.451-0.679l0.339-0.339c2.037 0 3.055 0 6.451 0.339v-31.915l-14.939-2.037c-4.414-0.679-8.488-0.679-12.223-0.679-12.902 0-23.088 3.055-30.897 9.507-10.185 8.149-17.994 24.106-22.748 47.533-22.409 4.753-39.724 19.014-51.608 42.78-12.223 24.106-18.334 59.416-18.334 105.931 0 49.91 8.488 86.578 25.124 110.005 14.26 19.692 33.953 29.538 58.737 29.538 4.075 0 8.149-0.339 12.223-0.679 29.199-3.395 50.25-16.976 64.17-41.082 13.581-23.427 20.032-56.7 20.032-100.838 0-40.403-4.754-71.979-14.6-95.406zM346.313 125.199c-13.581-5.433-24.785-8.827-37.008-9.846-1.697 0-3.395-0.339-5.093-0.339-10.865 0-19.692 3.055-25.464 9.507-6.791 7.469-10.525 19.353-10.525 35.65v125.623l-13.581 0.679v33.273l17.994-1.358 11.884 49.57 27.841-3.055v-49.231l30.557-2.376v-30.897l-30.557 1.358v-113.061c0-9.846 1.019-16.297 3.055-19.014s5.093-3.735 9.167-3.735c0.339 0 1.019 0 1.358 0 6.111 0.339 13.581 2.377 20.372 5.772v-28.52zM162.631 347.586c-1.018 0-1.697 0-2.716 0-10.525 0-18.673-6.111-24.446-18.673-6.112-13.581-9.167-41.422-9.167-84.202 0-41.082 3.055-70.281 9.167-87.257 5.772-16.297 14.26-24.445 25.803-24.445 0.339 0 1.018 0 1.358 0 11.204 0.679 19.692 8.488 25.464 23.427 5.772 14.599 8.488 43.798 8.488 86.918 0 38.706-2.716 65.528-8.488 80.127-5.433 14.939-13.921 23.088-25.464 24.106zM206.090 75.289v0zM206.090 75.289c1.358 0 2.716 0 4.414 0 2.037 0 4.075 0.679 6.451 0.679h-11.544l0.679-0.679z" horiz-adv-x="391" />
<glyph unicode="&#xe601;" d="M511.589 224.206c0-141.272-114.523-255.794-255.794-255.794s-255.794 114.523-255.794 255.794c0 141.271 114.523 255.794 255.794 255.794s255.794-114.523 255.794-255.794zM192.565 127.717c0-18.066-14.781-32.436-32.436-32.436s-32.847 14.37-32.847 32.436c0 18.066 14.781 32.436 32.436 32.436s32.847-14.37 32.847-32.436zM127.281 367.91v-50.502c133.030 0 221.716-89.097 221.716-222.127h50.502c0 165.466-107.163 272.628-272.218 272.628zM142.473 262.8c-3.696 0-11.496 0-15.192-0.411v-45.164c3.695 0.411 11.497 0.411 15.192 0.411 61.999 0 107.163-45.164 107.163-107.163 0-3.695 0-11.907-0.411-15.192h45.575c0.411 3.695 0.411 11.497 0.411 15.192-0.411 94.024-58.714 152.327-152.738 152.327z" />
<glyph unicode="&#xe602;" d="M511.589 224.206c0-141.272-114.523-255.794-255.794-255.794s-255.794 114.523-255.794 255.794c0 141.271 114.523 255.794 255.794 255.794s255.794-114.523 255.794-255.794zM382.666 298.111h-253.331c-8.212 0-14.781 6.57-14.781 14.781v18.887c0 8.212 6.57 14.781 14.781 14.781h253.331c8.212 0 14.781-6.57 14.781-14.781v-18.887c0-8.212-6.57-14.781-14.781-14.781zM382.666 199.981h-253.331c-8.212 0-14.781 6.57-14.781 14.781v18.887c0 8.212 6.57 14.781 14.781 14.781h253.331c8.212 0 14.781-6.57 14.781-14.781v-18.887c0-8.212-6.57-14.781-14.781-14.781zM382.666 101.44h-253.331c-8.212 0-14.781 6.57-14.781 14.781v18.887c0 8.212 6.57 14.781 14.781 14.781h253.331c8.212 0 14.781-6.57 14.781-14.781v-18.887c0-7.801-6.57-14.781-14.781-14.781z" />
<glyph unicode="&#xe603;" d="M511.795 224c0-141.272-114.524-255.795-255.795-255.795s-255.795 114.524-255.795 255.795c0 141.272 114.523 255.795 255.795 255.795s255.795-114.524 255.795-255.795zM405.529 256.947l-103.168 14.797-46.566 92.646-46.080-92.646-103.245-14.797 74.471-71.68-17.664-101.581 92.416 47.974 93.056-48.051-17.69 101.657z" />
<glyph unicode="&#xe604;" d="M511.589 224.206c0-141.272-114.523-255.794-255.794-255.794s-255.794 114.523-255.794 255.794c0 141.271 114.523 255.794 255.794 255.794s255.794-114.523 255.794-255.794zM379.381 126.486l-74.726 75.137c12.728 17.245 20.118 39.005 20.118 61.998 0 29.152-11.907 55.429-30.794 74.316-18.887 19.298-45.575 31.204-74.726 31.204s-55.429-11.907-74.316-30.794c-18.887-18.887-30.794-45.575-30.794-74.316 0-29.151 11.907-55.429 30.794-74.316s45.575-30.794 74.316-30.794c20.119 0 38.595 5.748 54.608 15.192l75.959-75.959c5.337-5.337 13.96-5.337 19.298 0l9.854 9.854c5.748 4.517 5.748 13.139 0.411 18.476zM165.055 209.424c-13.96 13.96-22.582 32.847-22.582 54.197s8.623 40.238 22.582 54.197c13.96 13.96 32.847 22.582 54.197 22.582s40.238-8.623 54.197-22.582c13.96-13.96 22.582-32.847 22.582-54.197s-8.623-40.238-22.582-54.197c-13.96-13.96-32.847-22.582-54.197-22.582-20.94 0-40.238 8.623-54.197 22.582z" />
<glyph unicode="&#xe605;" d="M511.589 224.206c0-141.272-114.523-255.794-255.794-255.794s-255.794 114.523-255.794 255.794c0 141.271 114.523 255.794 255.794 255.794s255.794-114.523 255.794-255.794zM255.794-22.557c67.746 0 129.335 27.509 174.088 71.442-5.748 4.106-11.907 8.623-18.887 13.55-22.993 15.602-52.966 34.9-92.382 59.535-1.642 1.232-2.874 2.464-3.284 3.695-0.821 1.232-1.232 2.464-1.232 3.284-0.411 2.053-0.821 4.106-0.821 6.159 0 4.927 0.821 10.264 2.874 16.423 1.642 6.159 4.517 12.317 7.801 18.476 2.053 3.695 4.927 9.854 7.39 17.655s4.927 17.655 7.39 28.741c4.517 22.172 7.39 49.681 7.39 79.243 0 13.138-5.337 29.973-14.781 45.575-9.854 15.602-23.404 29.972-39.827 38.595-11.086 5.748-22.993 9.033-35.721 9.033v0 0c-18.476-0.411-35.31-7.801-49.681-19.708s-25.867-27.92-32.847-43.933c-4.517-10.675-6.57-20.94-6.57-29.562 0-22.171 1.643-43.112 4.517-61.588s6.57-34.489 10.264-45.986c2.464-7.801 5.338-13.96 7.391-17.655 3.696-5.748 6.159-12.317 7.801-18.476s2.874-11.497 2.874-16.423c0-1.642 0-2.874-0.411-4.517s-0.821-3.284-1.643-4.927c-0.821-1.232-1.643-2.464-3.285-3.695-51.323-32.026-87.044-55.429-111.679-73.084 43.933-44.343 105.52-71.853 173.267-71.853z" />
<glyph unicode="&#xe606;" d="M511.087 224.411c0-141.109-114.392-255.502-255.501-255.502s-255.501 114.392-255.501 255.501c0 141.109 114.392 255.501 255.501 255.501s255.501-114.392 255.501-255.501zM369.577 360.185h-227.981c-2.263-0.003-4.095-1.838-4.098-4.098v-263.767c0.003-2.263 1.838-4.095 4.098-4.098h227.981c2.263 0.003 4.095 1.838 4.098 4.098v263.767c-0.007 2.263-1.838 4.095-4.098 4.098zM291.959 165.217c0-4.507-3.688-8.197-8.197-8.197h-112.482c-4.507 0-8.196 3.688-8.196 8.197v2.263c0 4.507 3.689 8.197 8.197 8.197h112.482c4.507 0 8.197-3.688 8.197-8.197v-2.263zM348.089 210.007c0-4.507-3.688-8.197-8.197-8.197h-168.612c-4.507 0-8.196 3.688-8.196 8.197v2.263c0 4.507 3.689 8.197 8.197 8.197h168.608c4.507 0 8.197-3.688 8.197-8.197v-2.263zM348.089 254.796c0-4.507-3.688-8.197-8.197-8.197h-168.612c-4.507 0-8.196 3.689-8.196 8.197v2.263c0 4.508 3.689 8.197 8.197 8.197h168.608c4.507 0 8.197-3.688 8.197-8.197v-2.263zM348.089 299.584c0-4.507-3.688-8.197-8.197-8.197h-168.612c-4.507 0-8.196 3.689-8.196 8.197v2.263c0 4.508 3.689 8.197 8.197 8.197h168.608c4.507 0 8.197-3.688 8.197-8.197v-2.263z" />
<glyph unicode="&#xe607;" d="M0 139.988v153.96c0 19.471 0.36 36.417 3.966 50.84 36.056 11.538 85.093 18.389 127.279 18.389 23.797 0 53.724-2.524 75.719-5.409v122.231h55.166v-340.012c0-18.389-0.361-35.335-3.966-51.56-34.254-11.538-86.535-18.389-126.918-18.389-42.547 0-89.059 6.49-126.197 17.668-3.606 16.947-5.048 34.253-5.048 52.281zM57.33 308.372c-1.443-7.572-2.163-19.471-2.163-34.974v-113.578c0-18.389 0.721-29.927 2.163-34.974 20.191-5.409 49.758-7.933 73.916-7.933 27.042 0 56.248 3.245 73.555 8.293 1.442 5.048 2.163 16.586 2.163 34.614v150.355c-21.634 3.606-51.921 5.769-76.44 5.769-23.436 0.361-51.56-3.245-73.195-7.572zM389.048 360.293v-287.009h-55.887v287.009h55.887zM658.028 28.214c1.442 6.49 2.163 15.144 2.163 24.879v29.566c-22.355-2.524-50.479-4.327-72.112-4.327-41.826 0-89.059 6.13-123.673 17.668-2.885 16.947-4.327 33.893-4.327 51.2v146.75c0 18.028 1.442 34.974 4.327 50.839 34.254 11.538 81.848 18.389 123.673 18.389 41.465 0 87.256-6.851 123.673-18.389 3.606-16.586 3.966-32.812 3.966-50.839v-271.865c-15.865-46.512-64.18-54.084-124.034-54.084-25.961 0-62.377 4.327-91.583 10.096v43.988c29.206-5.769 72.834-9.735 108.169-7.933 19.11 0.721 40.383 5.769 49.758 14.062zM660.192 129.533v143.865c0 16.586-0.361 27.403-2.524 34.975-19.471 4.327-45.792 7.933-69.588 7.933-23.437 0-50.119-3.245-69.588-7.933-1.803-7.572-2.885-19.471-2.885-34.975v-107.087c0-15.865 1.082-27.403 2.885-34.974 18.389-5.409 45.431-7.933 69.228-7.933 23.076 0.361 50.479 2.163 72.473 6.13zM842.276 360.293v-287.009h-55.888v287.009h55.888zM1159.211 344.067c-36.417 12.62-73.555 18.75-115.741 18.75-36.057 0-91.583-5.769-123.673-15.144v-51.2h27.403c5.048 4.327 9.014 10.096 11.899 16.226 10.457 2.524 32.812 5.048 74.637 5.048 23.797 0 51.2-3.966 71.752-8.293 1.443-13.341 2.524-26.681 2.524-38.941v-23.076h-120.067c-22.355 0-51.2-3.245-75.357-12.619-3.606-15.143-4.688-32.451-5.048-44.71v-50.118c0-18.028 1.442-35.335 5.048-51.921 36.778-11.538 84.011-17.668 126.557-17.668 40.383 0 85.814 6.13 120.068 17.668 3.605 15.865 3.966 32.812 3.966 51.2v143.504c0 15.504-0.361 34.974-3.966 61.296zM998.039 206.693h110.333v-35.696c0-14.423 0.361-34.614-1.803-46.152-17.307-5.048-40.023-7.572-66.704-7.572-1.443 0-2.884 0-3.966 0-23.076 0-52.282 2.524-71.391 7.572-1.803 10.817-2.885 26.321-2.885 35.696v3.606c0 8.293 0.361 27.043 3.606 38.581 8.293 2.885 19.11 3.966 32.812 3.966zM912.586 234.817c-3.606-15.144-5.048-44.71-5.048-44.71v-50.118zM387.966 476.034v-59.493h-55.887v59.493h55.887zM842.276 476.034v-59.493h-55.888v59.493h55.888z" horiz-adv-x="1163" />
<glyph unicode="&#xe608;" d="M512.419 224.922c0-141.385-114.615-256-256-256s-256 114.615-256 256c0 141.385 114.615 256 256 256s256-114.615 256-256zM414.157 260.356l-108.984 15.832-48.921 98.764-7.456-15.246-41.047-83.519-108.984-15.832 78.744-76.9-18.597-108.565 97.424 51.267 97.759-51.267-18.597 108.565 78.659 76.9zM256.252 145.005l-75.142-39.539 14.409 83.769-60.817 59.309 84.189 12.314 37.362 76.231 37.78-76.231 84.188-12.231-60.817-59.309 14.409-83.853-75.56 39.539z" horiz-adv-x="513" />
<glyph unicode="&#xe609;" d="M511.795 224c0-141.272-114.524-255.795-255.795-255.795s-255.795 114.524-255.795 255.795c0 141.272 114.523 255.795 255.795 255.795s255.795-114.524 255.795-255.795zM418.457 266.368l-112.435 16.128-50.279 100.070-11.392-22.912-38.4-77.159-112.409-16.102 81.229-78.183-19.174-110.157 100.224 51.993 100.582-51.942-19.175 110.106 81.229 78.157z" />
</font></defs></svg>
\ No newline at end of file
pre, .LegaleseLeft {
background-color: #f0f0f0;
font-family: Courier, monospace;
font-weight: 600;
vertical-align: top;
margin: 15px 85px 15px 35px;
padding: 25px;
width: 90%;
overflow-x:auto;
}
pre a[href] {
color: #5caa15;
}
p {
width: 70%;
margin: 15px 0px 10px 15px;
}
table p {
margin: 0px;
padding: 0px;
}
a[href] {
color: #007330;
text-decoration: none;
}
/* Different color for ext. links */
a[href|="http://"], a[href|="https://"] {
color: #6bb8db;
}
h1.title {
margin-top: 30px;
margin-left: 6px;
padding: 6px;
}
h2, p.h2 {
background-color: #F2F3F4;
padding: 4px;
margin: 30px 0px 20px 10px;
}
h3 {
margin: 30px 0px 30px 6px;
}
ul, ol {
margin-top: 4px;
margin-bottom: 0px;
}
ul li, ol li {
margin-bottom: 8px;
}
.mainContent li.level2 {
margin-left: 16px;
}
.rightAlign {
text-align: right;
}
h3.fn, span.fn {
border-width: 3px;
border-style: solid;
border-color: #aaaaaa;
background-color: #eeeeee;
word-spacing: 3px;
padding: 5px;
text-decoration: none;
font-weight: 400;
margin: 45px 0px 0px 6px;
}
table {
max-width: 80%;
padding: 15px 45px 15px 15px;
}
table th {
text-align: left;
padding: 8px;
}
table td {
padding: 6px 10px 6px 10px;
}
table tr.odd {
background-color: #eeeeee;
}
table.qmlname td {
padding: 0px;
margin-left: 6px;
}
table.qmlname p .name,
h3.fn .name, h3.fn .type {
font-weight: bold;
}
.context h3.fn {
font-weight: 400;
}
.qmlreadonly, .qmldefault {
font-family: Courier, monospace;
margin-right: 6px;
}
code {
font-family: Courier, monospace;
font-weight: 400;
}
p.naviNextPrevious {
text-align: right;
margin-right: 20px;
}
span.naviSeparator {
white-space: pre;
}
.toc h3 {
margin: 0px 0px 10px 6px;
}
.toc ul {
list-style-type: none;
}
.navigationbar table {
padding: 0;
margin: 0;
}
.navigationbar table tr {
background-color: #eeeeee;
}
td#buildversion {
background-color: #ffffff;
}
.footer, .footer p {
padding: 5px 0px 5px 0px;
margin: 45px 15px 5px 15px;
font-size: 8.5pt;
background-color: #cccccc;
}
.footer p {
margin: 0px;
}
body {
font: normal 400 14px/1.2 Arial;
margin-top: 85px;
font-family: Arial, Helvetica;
text-align: left;
margin-left: 5px;
margin-right: 5px;
background-color: #fff;
}
p {
line-height: 20px
}
img {
margin-left: 0px;
max-width: 800px;
height: auto;
}
.content {
}
.content .indexboxcont li {
font: normal bold 13px/1 Verdana
}
.content .normallist li {
font: normal 13px/1 Verdana
}
.descr {
margin-top: 35px;
margin-bottom: 45px;
margin-left: 5px;
text-align: left;
vertical-align: top;
}
.name {
max-width: 75%;
font-weight: 100;
}
tt {
text-align: left
}
/*
-----------
links
-----------
*/
a:link {
color: #007330;
text-decoration: none;
text-align: left;
}
a.qa-mark:target:before {
content: "***";
color: #ff0000;
}
a:hover {
color: #44a51c;
text-align: left;
}
a:visited {
color: #007330;
text-align: left;
}
a:visited:hover {
color: #44a51c;
text-align: left;
}
/*
-----------
offline viewing: HTML links display an icon
-----------
*/
a[href*="http://"], a[href*="ftp://"], a[href*="https://"] {
text-decoration: none;
background-image: url(../images/ico_out.png);
background-repeat: no-repeat;
background-position: left;
padding-left: 20px;
text-align: left;
}
.flags {
text-decoration: none;
text-height: 24px;
}
.flags:target {
background-color: #FFFFD6;
}
/*
-------------------------------
NOTE styles
-------------------------------
*/
.notetitle, .tiptitle, .fastpathtitle {
font-weight: bold
}
.attentiontitle, .cautiontitle, .dangertitle, .importanttitle, .remembertitle, .restrictiontitle {
font-weight: bold
}
.note, .tip, .fastpath {
background: #F2F2F2 url(../images/ico_note.png);
background-repeat: no-repeat;
background-position: top left;
padding: 5px;
padding-left: 40px;
padding-bottom: 10px;
border: #999 1px dotted;
color: #666666;
margin: 5px;
}
.attention, .caution, .danger, .important, .remember, .restriction {
background: #F2F2F2 url(../images/ico_note_attention.png);
background-repeat: no-repeat;
background-position: top left;
padding: 5px;
padding-left: 40px;
padding-bottom: 10px;
border: #999 1px dotted;
color: #666666;
margin: 5px;
}
/*
-------------------------------
Top navigation
-------------------------------
*/
.qtref {
display: block;
position: relative;
height: 15px;
z-index: 1;
font-size: 11px;
padding-right: 10px;
float: right;
}
.naviNextPrevious {
clear: both;
display: block;
position: relative;
text-align: right;
top: -47px;
float: right;
height: 20px;
z-index: 1;
padding-right: 10px;
padding-top: 2px;
vertical-align: top;
margin: 0px;
}
.naviNextPrevious > a:first-child {
background-image: url(../images/btn_prev.png);
background-repeat: no-repeat;
background-position: left;
padding-left: 20px;
height: 20px;
padding-left: 20px;
}
.naviNextPrevious > a:last-child {
background-image: url(../images/btn_next.png);
background-repeat: no-repeat;
background-position: right;
padding-right: 20px;
height: 20px;
margin-left: 30px;
}
.naviSeparator { display: none }
/*
-----------
footer and license
-----------
*/
.footer {
text-align: left;
padding-top: 45px;
padding-left: 5px;
margin-top: 45px;
margin-bottom: 45px;
font-size: 10px;
border-top: 1px solid #999;
}
.footer p {
line-height: 14px;
font-size: 11px;
padding: 0;
margin: 0;
}
.footer a[href*="http://"], a[href*="ftp://"], a[href*="https://"] {
font-weight: bold;
}
.footerNavi {
width: auto;
text-align: right;
margin-top: 50px;
z-index: 1;
}
.navigationbar {
display: block;
position: relative;
top: -20px;
border-top: 1px solid #cecece;
border-bottom: 1px solid #cecece;
background-color: #F2F2F2;
z-index: 1;
height: 20px;
padding-left: 7px;
margin: 0px;
padding-top: 2px;
margin-left: -5px;
margin-right: -5px;
}
.navigationbar .first {
background: url(../images/home.png);
background-position: left;
background-repeat: no-repeat;
padding-left: 20px;
}
.navigationbar ul {
margin: 0px;
padding: 0px;
}
.navigationbar ul li {
list-style-type: none;
padding-top: 2px;
padding-left: 4px;
margin: 0;
height: 20px;
}
.navigationbar li {
float: left
}
.navigationbar li a, .navigationbar td a {
display: block;
text-decoration: none;
background: url(../images/arrow_bc.png);
background-repeat: no-repeat;
background-position: right;
padding-right: 17px;
}
table.buildversion {
float: right;
margin-top: -18px !important;
}
.navigationbar table {
border-radius: 0;
border: 0 none;
background-color: #F2F2F2;
margin: 0;
}
.navigationbar table td {
padding: 0;
border: 0 none;
}
#buildversion {
font-style: italic;
font-size: small;
float: right;
margin-right: 5px;
}
/*
/* table of content
no display
*/
/*
-----------
headers
-----------
*/
@media screen {
.title {
color: #313131;
font-size: 24px;
font-weight: normal;
left: 0;
padding-bottom: 20px;
padding-left: 10px;
padding-top: 20px;
position: absolute;
right: 0;
top: 0;
background-color: #E6E6E6;
border-bottom: 1px #CCC solid;
border-top: 2px #CCC solid;
font-weight: bold;
margin-left: 0px;
margin-right: 0px;
}
.subtitle, .small-subtitle {
display: block;
clear: left;
}
}
h1 {
margin: 0
}
h2, p.h2 {
font: 500 16px/1.2 Arial;
font-weight: 100;
background-color: #F2F3F4;
padding: 4px;
margin-bottom: 30px;
margin-top: 30px;
border-top: #E0E0DE 1px solid;
border-bottom: #E0E0DE 1px solid;
max-width: 99%;
}
h2:target {
background-color: #F2F3D4;
}
h3 {
font: 500 14px/1.2 Arial;
font-weight: 100;
text-decoration: underline;
margin-bottom: 30px;
margin-top: 30px;
}
h3.fn, span.fn {
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
word-spacing: 3px;
padding: 5px 5px;
text-decoration: none;
font-weight: bold;
max-width: 75%;
font-size: 14px;
margin: 0px;
margin-top: 45px;
}
h3.fn code {
float: right;
}
h3.fn:target {
background-color: #F6F6D6;
}
.name {
color: #1A1A1A
}
.type {
color: #808080
}
@media print {
.title {
color: #0066CB;
font-family: Arial, Helvetica;
font-size: 32px;
font-weight: normal;
left: 0;
position: absolute;
right: 0;
top: 0;
}
}
/*
-----------------
table styles
-----------------
*/
.table img {
border: none;
margin-left: 0px;
-moz-box-shadow: 0px 0px 0px #fff;
-webkit-box-shadow: 0px 0px 0px #fff;
box-shadow: 0px 0px 0px #fff;
}
/* table with border alternative colours*/
table, pre, .LegaleseLeft {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
margin-bottom: 25px;
margin-left: 15px;
font-size: 12px;
line-height: 1.2;
}
table tr.even {
background-color: white;
color: #66666E;
}
table tr.odd {
background-color: #F6F6F6;
color: #66666E;
}
table tr:target {
background-color: #F6F6D6;
}
table thead {
text-align: left;
padding-left: 20px;
background-color: #e1e0e0;
border-left: none;
border-right: none;
}
table thead th {
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
border-bottom: 2px solid #D1D1D1;
padding-right: 10px;
}
table th {
text-align: left;
padding-left: 20px;
}
table td {
padding: 3px 15px 3px 20px;
border-bottom: #CCC dotted 1px;
}
table p {
margin: 0px
}
.LegaleseLeft {
font-family: monospace;
white-space: pre-wrap;
}
/* table bodless & white*/
.borderless {
border-radius: 0px 0px 0px 0px;
background-color: #fff;
border: 1px solid #fff;
}
.borderless tr {
background-color: #FFF;
color: #66666E;
}
.borderless td {
border: none;
border-bottom: #fff dotted 1px;
}
/*
-----------
List
-----------
*/
ul {
margin-top: 10px;
}
li {
margin-bottom: 10px;
padding-left: 8px;
list-style: outside;
text-align: left;
}
ul > li {
list-style-type: square;
}
ol {
margin: 10px;
padding: 0;
}
ol.A > li {
list-style-type: upper-alpha;
}
ol.a > li{
list-style-type: lower-alpha;
}
ol > li {
margin-left: 30px;
padding-left: 8px;
list-style: decimal;
}
.centerAlign {
text-align: left
}
.cpp, .LegaleseLeft {
display: block;
margin: 10px;
overflow: auto;
padding: 20px 20px 20px 20px;
}
.js {
display: block;
margin: 10px;
overflow: auto;
padding: 20px 20px 20px 20px;
}
.memItemLeft {
padding-right: 3px
}
.memItemRight {
padding: 3px 15px 3px 0
}
.qml {
display: block;
margin: 10px;
overflow: auto;
padding: 20px 20px 20px 20px;
}
.qmldefault {
padding-left: 5px;
float: right;
color: red;
}
.qmlreadonly {
padding-left: 5px;
float: right;
color: #254117;
}
.rightAlign {
padding: 3px 5px 3px 10px;
text-align: right;
}
.qmldoc {
margin-left: 15px
}
.flowList {
padding: 25px
}
.flowList dd {
display: inline-block;
margin-left: 10px;
width: 255px;
line-height: 1.15em;
overflow-x: hidden;
text-overflow: ellipsis
}
.alphaChar {
font-size: 2em;
position: relative
}
/*
-----------
Content table
-----------
*/
@media print {
.toc {
float: right;
clear: right;
padding-bottom: 10px;
padding-top: 50px;
width: 100%;
background-image: url(../images/bgrContent.png);
background-position: top;
background-repeat: no-repeat;
}
}
@media screen {
.toc {
float: right;
clear: right;
vertical-align: top;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background: #FFF url('../images/bgrContent.png');
background-position: top;
background-repeat: repeat-x;
border: 1px solid #E6E6E6;
padding-left: 5px;
padding-bottom: 10px;
height: auto;
width: 200px;
text-align: left;
margin-left: 20px;
}
}
.toc h3 {
text-decoration: none
}
.toc h3 {
font: 500 14px/1.2 Arial;
font-weight: 100;
padding: 0px;
margin: 0px;
padding-top: 5px;
padding-left: 5px;
}
.toc ul {
padding-left: 10px;
padding-right: 5px;
}
.toc ul li {
margin-left: 15px;
list-style-image: url(../images/bullet_dn.png);
marker-offset: 0px;
margin-bottom: 8px;
padding-left: 0px;
}
.toc .level1 {
border: none
}
.toc .level2 {
border: none;
margin-left: 25px;
}
.level3 {
border: none;
margin-left: 30px;
}
.clearfix {
clear: both
}
/*
-----------
Landing page
-----------
*/
.col-group {
white-space: nowrap;
vertical-align: top;
}
.landing h2 {
background-color: transparent;
border: none;
margin-bottom: 0px;
font-size: 18px;
}
.landing a, .landing li {
font-size: 13px;
font-weight: bold !important;
}
.col-1 {
display: inline-block;
white-space: normal;
width: 70%;
height: 100%;
float: left;
}
.col-2 {
display: inline-block;
white-space: normal;
width: 20%;
margin-left: 5%;
position: relative;
top: -20px;
}
.col-1 h1 {
margin: 20px 0 0 0;
}
.col-1 h2 {
font-size: 18px;
font-weight: bold !important;
}
.landingicons {
display: inline-block;
width: 100%;
}
.icons1of3 {
display: inline-block;
width: 33.3333%;
float: left;
}
.icons1of3 h2, .doc-column h2 {
font-size: 15px;
margin: 0px;
padding: 0px;
}
div.multi-column {
position: relative;
}
div.multi-column div {
display: -moz-inline-box;
display: inline-block;
vertical-align: top;
margin-top: 1em;
margin-right: 4em;
width: 24em;
}
#navbar {
position:fixed;
top:0;
left:0;
z-index:100;
background:#fff;
width:100%
}
#navbar .container {
overflow:visible
}
.fixed .container {
overflow:visible
}
.box-shadowed-nav #navbar {
border-bottom:1px solid #eee
}
#navbar .navbar-header {
position:relative
}
#navbar .navbar-toggle {
display:none;
float:right;
line-height:18px;
min-width:95px;
position:relative;
text-align:center;
border-left:1px solid #eee;
border-right:1px solid #eee;
padding:10px 0 10px 0
}
#navbar .navbar-toggle:hover figure {
background:#5caa15
}
#navbar .navbar-toggle span {
color:#bdbebf;
font-weight:300
}
#navbar .navbar-toggle figure {
background:#7fc241;
border-radius:100%;
-webkit-border-radius:100%;
-moz-border-radius:100%;
transition:all 0.2s ease-in-out;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out;
height:26px;
width:34px;
padding:8px 0 0 0;
margin-top:3px;
margin-left:auto;
margin-right:auto;
text-align:center
}
#navbar .navbar-toggle figure span.line {
display:inline-block;
width:1.125em;
height:0.1875em;
background:#fff;
transition:0.3s;
position:relative;
vertical-align:middle;
margin-top:-3px
}
#navbar .navbar-toggle figure span.line:before,#navbar .navbar-toggle figure span.line:after {
display:inline-block;
width:1.125em;
height:0.1875em;
background:#fff;
position:absolute;
left:0;
content:'';
-webkit-transform-origin:0.28571rem center;
transform-origin:0.28571rem center;
transition:0.3s;
-webkit-transition:0.3s;
-moz-transition:0.3s;
-ms-transition:0.3s;
-o-transition:0.3s
}
#navbar .navbar-toggle figure span.line:before {
top:6px
}
#navbar .navbar-toggle figure span.line:after {
top:-6px
}
#navbar .navbar-toggle.opened figure {
background:#5caa15
}
#navbar .navbar-toggle.opened span {
color:#5caa15
}
#navbar .navbar-toggle.opened span.line {
background:transparent
}
#navbar .navbar-toggle.opened span.line:before,#navbar .navbar-toggle.opened span.line:after {
-webkit-transform-origin:50% 50%;
-moz-transform-origin:50% 50%;
transform-origin:50% 50%;
top:0;
width:23px;
margin-left:-2px
}
#navbar .navbar-toggle.opened span.line:before {
transform:rotate3d(0, 0, 1, 45deg);
-webkit-transform:rotate3d(0, 0, 1, 45deg);
-moz-transform:rotate3d(0, 0, 1, 45deg);
-ms-transform:rotate3d(0, 0, 1, 45deg);
-o-transform:rotate3d(0, 0, 1, 45deg);
left:0
}
#navbar .navbar-toggle.opened span.line:after {
transform:rotate3d(0, 0, 1, -45deg);
-webkit-transform:rotate3d(0, 0, 1, -45deg);
-moz-transform:rotate3d(0, 0, 1, -45deg);
-ms-transform:rotate3d(0, 0, 1, -45deg);
-o-transform:rotate3d(0, 0, 1, -45deg)
}
#navbar .navbar-oneQt {
display:inline;
float:left;
width:31px;
padding:20px 8px;
margin:0 15px 0 0
}
#navbar .navbar-oneQt:before {
content:attr(data-icon);
position:absolute;
top:15px;
left:0;
color:#80c342;
font-family:'Qt Icons';
line-height:1;
font-size:3.125em;
transition:all 0.2s ease-in-out;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out
}
.navbar-oneQt {
color: #80c342 !important;
}
.navbar-oneQt:hover {
color: #80c342;
}
#navbar .navbar-menu {
width:auto;
float:left
}
.lt-ie9 #navbar {
border-bottom:1px solid #ddd
}
#mainmenu {
float:left;
list-style:none;
margin-left:16px
}
#mainmenu li {
float:left;
margin-left:0;
list-style-type:none !important
}
#mainmenu li a {
display:block;
padding:29px 0.7em;
font-size:1.125em;
font-weight:300;
line-height:20px;
height:80px;
color:#26282a;
text-decoration:none;
border:0px solid #80c342;
-webkit-transition:all 0.2s ease-in-out;
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
*behavior:url(boxsizing.htc)
}
#mainmenu li a:hover {
color:#5caa15;
border-bottom:4px solid #80C342
}
#mainmenu li.current-menu-item a {
color:#5caa15;
border-bottom:4px solid #80C342
}
#menuextras, #mainmenu, #menuextraslanguages {
margin-bottom:0
}
#menuextras {
display:inline-block;
float:right;
list-style-type:none;
margin-right:0;
margin-left:0;
letter-spacing:-0.31em;
line-height:0
}
#menuextras li {
letter-spacing:normal;
float:left;
display:inline-block
}
#menuextras li a {
display:inline-block;
text-align:center;
height:80px;
border-left:1px solid #eee;
padding-top:14px;
box-sizing:border-box;
overflow:hidden;
min-width:85px;
font-weight:100
}
#menuextras li:last-child a {
border-right:1px solid #eee;
}
#menuextras li a:before {
display:inline-block;
font-family:'Qt Icons';
content:attr(data-icon);
font-size:2.125em;
width:100%;
color:#80c342;
line-height:1;
transition:all 0.2s ease-in-out;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out
}
#menuextras li a:hover:before {
color:#5caa15
}
#menuextras .search.open a {
color:#006325
}
#menuextras .search a {
border-right:1px solid #eee
}
#menuextras li a span {
color:#bdbebf;
display:inline-block;
overflow:hidden;
max-height:30px;
transition:max-height 0.2s ease-in-out;
-webkit-transition:max-height 0.2s ease-in-out;
-moz-transition:max-height 0.2s ease-in-out;
-ms-transition:max-height 0.2s ease-in-out;
-o-transition:max-height 0.2s ease-in-out;
line-height:1.4;
font-size:0.875em
}
@media (min-width: 1320px) {
.context .flowListDiv dl.flowList {
-webkit-column-count:3;
-moz-column-count:3;
column-count:3
}
}
@media (min-width: 1120px) {
#navbar.fixed,#navbar.shadow_bottom {
-moz-box-shadow:0px 0px 8px rgba(0,0,0,0.2);
-webkit-box-shadow:0px 0px 8px rgba(0,0,0,0.2);
box-shadow:0px 0px 8px rgba(0,0,0,0.2)
}
#navbar.fixed #menuextras li a,#navbar.shadow_bottom #menuextras li a {
padding-top:9px;
height:50px
}
#navbar.fixed #menuextras li a span,#navbar.shadow_bottom #menuextras li a span {
max-height:0
}
#navbar.fixed #menuextras li a:before,#navbar.shadow_bottom #menuextras li a:before {
font-size:30px
}
#navbar.fixed #mainmenu li a {
height:50px;
padding:14px 0.7em
}
#navbar.fixed #mainmenu li a:hover {
border-bottom:4px solid #5caa15
}
#navbar.fixed .navbar-toggle {
padding:13px 14px 9px
}
#navbar.fixed #menuextras li.navbar-search {
padding:0px 0
}
#navbar.fixed #menuextras ul.menuextraslinks,#navbar.fixed #menuextras ul.menuextraslanguages {
display:none
}
#navbar.fixed .navbar-oneQt:before {
font-size:35px;
top:7px
}
#navbar.fixed #mainmenu li.current-menu-item a {
border-bottom:4px solid #80C342
}
.flowListDiv dl.flowList {
-webkit-column-count:2;
-moz-column-count:2;
column-count:2
}
}
@media (max-width: 1120px) {
#navbar {
padding:0;
position:relative
}
#navbar .container {
max-width:100%
}
#navbar .menuextraslanguages {
bottom:10px !important;
right:0
}
#navbar .menuextraslanguages li a {
color:#7fc241 !important
}
#navbar .menuextraslanguages li.active a,#navbar .menuextraslanguages li a:hover {
border-color:#7fc241 !important
}
#navbar .container {
padding:0
}
#navbar .navbar-toggle {
display:block
}
#navbar .navbar-oneQt,#navbar.fixed .navbar-oneQt,#navbar .navbar-oneQt:hover {
margin-left:0;
height:26px;
width:22px;
padding:7px 20px 7px 15px
}
#navbar .navbar-oneQt:before {
left:20px
}
#navbar .navbar-menu {
max-height:0;
overflow:hidden;
width:100%;
border-top:1px solid #eee;
-webkit-transition:all 600ms ease-in-out;
-moz-transition:all 600ms ease-in-out;
-o-transition:all 600ms ease-in-out;
transition:all 600ms ease-in-out;
position:relative
}
#mainmenu {
float:none;
width:100%;
padding:0;
margin:0
}
#mainmenu li {
float:none;
list-style:none
}
#mainmenu li:nth-child(odd) {
background:rgba(0,0,0,0)
}
#mainmenu li a,#navbar.fixed #mainmenu li a {
padding:10px;
border-left:3px solid #fff;
height:auto;
width:100%
}
#mainmenu li.current-menu-item a,#navbar.fixed #mainmenu li.current-menu-item a {
border-bottom:none;
border-left:3px solid #5caa15;
padding:10px
}
#mainmenu li a:hover {
border-bottom:0;
padding:10px;
border-left:3px solid #5caa15
}
#navbar.fixed {
-moz-box-shadow:0px 0px 0px rgba(0,0,0,0);
-webkit-box-shadow:0px 0px 0px rgba(0,0,0,0);
box-shadow:0px 0px 0px rgba(0,0,0,0)
}
.lt-ie9 #navbar.fixed {
border-bottom:none
}
#menuextras li.navbar-search {
padding:5px 0
}
#footerbar .container {
padding:0
}
body .main {
margin-top:0px
}
#footerbar .footer-main .footer-nav {
padding:3.9% 0 3.9% 3%;
border-bottom:1px solid #413d3b;
float:none;
display:block;
width:auto
}
#footerbar .footer-main .theqtcompany {
clear:both;
float:left;
margin:30px 0 28px 3%
}
#footerbar .footer-main .footer-social {
float:left;
padding:30px 0px 0px 3%
}
#footerbar #menu-footer-submenu {
clear:both;
float:none;
display:block;
padding:0px 0px 3.9% 3%
}
ul#menu-footer-submenu {
margin-left: 0
}
}
.in-page-nav {
width:100%;
background:#eeeeee
}
.in-page-nav ul {
margin:0 auto;
letter-spacing:-0.31em;
max-width:1180px;
text-align:center
}
.in-page-nav ul li {
display:inline-block;
letter-spacing:normal
}
.in-page-nav ul li a {
color:#26282a;
padding:25px 10px;
display:inline-block
}
body.qt-account #navbar .navbar-oneQt {
width:auto;
height:auto
}
body.qt-account #navbar .navbar-oneQt:before {
left:0;
position:relative;
display:inline-block;
vertical-align:middle;
top:0;
margin-right:20px
}
body.qt-account #navbar .navbar-oneQt h2 {
margin:0;
color:#000;
display:inline-block;
vertical-align:middle
}
.landing header[role="banner"] {
background:#26282a
}
.landing header[role="banner"] figure {
max-width:1180px;
margin:auto;
position:relative
}
.landing header[role="banner"] figure img {
max-width:100%
}
.landing header[role="banner"] figcaption {
color:#fff;
position:absolute;
left:0px;
width:100%;
text-align:center
}
.landing header[role="banner"] figcaption.top {
top:0
}
.landing header[role="banner"] figcaption.bottom {
bottom:0
}
.landing header[role="banner"] figcaption h1 {
margin:50px auto 0 auto;
max-width:70%;
font-weight:600
}
.landing header[role="banner"] figcaption h3 {
margin-bottom:40px
}
.cookies_yum {
background-color:#d6d6d6;
display:none;
line-height:1.625em;
width:100%
}
.cookies_yum img {
width:25px;
top:6px;
display:inline-block;
position:absolute;
left:6px
}
.cookies_yum div {
margin:0 auto;
max-width:1280px;
min-height:30px;
padding:6px 0px 6px 0px;
position:relative
}
.cookies_yum p {
color:#585a5c;
margin:0px;
font-size:0.79em;
display:inline-block;
line-height:1.2;
padding:0 30px 0 50px
}
.cookies_yum p a {
white-space:nowrap
}
.cookies_yum a:hover {
color:white
}
.cookies_yum .close {
width:15px;
height:15px;
background-image:url("cookiebar-x.png");
background-size:15px 30px;
background-position:top left;
cursor:pointer;
top:13px;
right:13px;
position:absolute;
transition:none;
}
#sidebar-toggle,#toc-toggle {
width:24px;
height:14px;
background-size:24px 28px;
cursor:pointer;
background-image:url("list_expand.png");
float:right
}
#sidebar-toggle.collapsed,
#toc-toggle.collapsed {
background-position:bottom left
}
#sidebar-content > h2 {
display:none
}
.cookies_yum .close:hover {
background-position:bottom left
}
#bottom_header {
display:block;
position:absolute;
width:100%;
z-index:50;
padding-top:15px
}
#bottom_header .container {
overflow:visible
}
#bottom_header .left {
font-weight:bolder
}
#bottom_header a {
color:white;
transition-duration:0.3s
}
#bottom_header .left a:hover {
padding-left:10px
}
.fixed .menuextraslanguages {
opacity:0;
visibility:hidden
}
@media (max-width: 1120px) {
.fixed .menuextraslanguages {
opacity:1 !important;
visibility:visible !important
}
}
#navbar .menuextraslanguages {
position:absolute;
right:0;
bottom:-35px;
transition:all 0.2s ease-in-out;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out
}
#navbar .menuextraslanguages li {
display:inline;
list-style:none;
margin-left:3px;
padding:0px 4px;
font-size:0.6875em
}
#navbar .menuextraslanguages li.dark a {
color:#868482
}
#navbar .menuextraslanguages li.dark a:hover {
border:2px solid #868482
}
#navbar .menuextraslanguages li.active.dark a {
border-color:#868482;
color:#868482
}
#navbar .menuextraslanguages a {
color:#fff;
padding:2px 4px;
border:2px solid transparent
}
#navbar .menuextraslanguages a:hover,#navbar .menuextraslanguages li.active a {
border:2px solid #fff;
color:#fff
}
#bottom_header .dark,#bottom_header .dark.active {
color:#868482;
transition-duration:0.3s;
border-color:#868482 !important
}
#navbar .big_bar {
width:100%;
height:100px;
background-color:#80C342;
display:none;
position:relative
}
#navbar .big_bar.search {
height:auto;
overflow:hidden;
display:none
}
#navbar .big_bar ::-webkit-input-placeholder {
color:#fff
}
#navbar .big_bar :-moz-input-placeholder {
color:#fff
}
#navbar .big_bar ::-moz-input-placeholder {
color:#fff
}
#navbar .big_bar :-ms-input-placeholder {
color:#fff
}
#navbar .big_bar:hover>div .big_bar_button.account {
background-position:right bottom
}
#navbar .big_bar.account h1 {
padding-top:20px
}
#navbar .big_bar.account h1,#navbar .big_bar.account h1 a {
color:#FFF;
margin-bottom:5px
}
#navbar .big_bar.account h1 a:hover {
color:#328930
}
#navbar .big_bar_button:hover {
background-position:left bottom;
cursor:pointer
}
#navbar .big_bar_button.account {
background-position:right top
}
#navbar .big_bar input.big_bar_search {
background:none repeat scroll 0 0 transparent;
border:medium none;
color:#fff;
display:block;
float:left;
font-size:4em;
outline:0 none;
width:70%;
line-height:1.3;
height:auto;
margin:10px 5%;
padding:0;
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
*behavior:url(boxsizing.htc)
}
#navbar .big_bar_button {
background-color:transparent;
border:none;
width:18%;
transition-duration:0.3s;
display:block;
float:left;
position:relative;
font-family:'QT Icons';
font-size:3.5em;
color:#fff;
margin:15px 2% 0 0 !important;
text-align:right;
padding-right:2px !important;
transition:all 0.2s ease-in-out;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out
}
#navbar .big_bar_button:focus,#navbar .big_bar_button:hover {
outline:0;
color:#ebebeb
}
.hero_slide>div {
width:80%;
margin:0 auto
}
.hero_slide>div:first-child>div {
width:80%;
margin:0 auto
}
.hero_slide .content {
margin-top:70px
}
.hero_bar {
padding-top:50px;
padding-bottom:18px
}
.hero_bar p {
font-size:0.875em;
text-align:center
}
.hero_bar .arrow {
bottom:65px;
display:block;
margin:0 auto;
position:relative;
right:260px;
width:230px
}
.hero_bar .comment {
margin:0
}
#footerbar {
background:#26282a;
color:#fff
}
#footerbar.fixed {
bottom:0;
left:0;
width:100%
}
#footerbar .footer-nav {
display:inline;
float:left
}
#footerbar .footer-main .footer-nav li {
float:left;
margin-right:1em
}
#footerbar .footer-main .footer-nav li a {
display:block;
padding:31px 10px 15px 0;
line-height:20px;
height:20px;
color:#d6d6d6
}
#footerbar .footer-main .footer-nav li a:hover,#footerbar .footer-main .footer-nav li.current-menu-item a {
color:#eee
}
#footerbar .footer-main .footer-nav .sub-menu {
margin-left:0;
margin-bottom:0
}
#footerbar .footer-main .footer-nav .sub-menu li {
float:none
}
#footerbar .footer-main .footer-nav .sub-menu ul {
padding:1px 1em;
font-size:0.786em;
line-height:8px;
float:none;
color:#5d5b59;
margin-bottom:0
}
#footerbar .footer-main .footer-nav .sub-menu li a {
padding:1px 0;
font-size:0.786em;
line-height:8px;
float:none;
color:#d6d6d6
}
#footerbar .footer-main .footer-nav .sub-menu li a:hover,#footerbar .footer-main .footer-nav .sub-menu li.current-menu-item a {
color:#eee
}
#footerbar .theqtcompany {
background:url("theqtcompany.png") no-repeat;
background-size:100%;
width:215px;
height:68px;
display:inline;
float:right;
margin:29px 0 28px 30px
}
#footerbar .footer-social {
display:inline;
float:right;
padding-top:31px;
width:164px
}
#footerbar .footer-main .footer-social>div {
margin-left:0.1em;
margin-bottom:10px
}
#footerbar .disclaimer {
font-size:0.786em;
line-height:2.73;
color:#868584;
padding-top:20px;
padding-bottom:0.5%
}
#footerbar .disclaimer a {
color:#bdbebf
}
#footerbar .disclaimer a:hover {
color:#d6d6d6
}
#footerbar .disclaimer ul li {
float:left;
vertical-align:middle;
margin-left:1.18em
}
#footerbar .disclaimer ul li:first-child {
margin-left:0
}
#footerbar .disclaimer ul.lang-selector a {
color:#506a34;
color:rgba(128,195,66,0.3)
}
#footerbar .disclaimer ul.lang-selector a:hover {
color:#80c342;
color:rgba(128,195,66,0.7)
}
#menu-footer-menu, #menu-footer-menu ul {
margin-left:0;
margin-bottom:0
}
@font-face {
font-family:'Open Sans';
font-style:normal;
font-weight:300;
src:local("Open Sans Light"),local("OpenSans-Light"),url(//fonts.gstatic.com/s/opensans/v10/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format("truetype")
}
@font-face {
font-family:'Open Sans';
font-style:normal;
font-weight:400;
src:local("Open Sans"),local("OpenSans"),url(//fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format("truetype")
}
@font-face {
font-family:'Open Sans';
font-style:normal;
font-weight:600;
src:local("Open Sans Semibold"),local("OpenSans-Semibold"),url(//fonts.gstatic.com/s/opensans/v10/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format("truetype")
}
@font-face {
font-family:'Open Sans';
font-style:normal;
font-weight:700;
src:local("Open Sans Bold"),local("OpenSans-Bold"),url(//fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf) format("truetype")
}
@font-face {
font-family:'Open Sans';
font-style:normal;
font-weight:800;
src:local("Open Sans Extrabold"),local("OpenSans-Extrabold"),url(//fonts.gstatic.com/s/opensans/v10/EInbV5DfGHOiMmvb1Xr-honF5uFdDttMLvmWuJdhhgs.ttf) format("truetype")
}
@font-face {
font-family:'Droid Sans Mono';
font-style:normal;
font-weight:400;
src:local("Droid Sans Mono"),local("DroidSansMono"),url(//fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format("woff")
}
@font-face {
font-family:'Qt Icons';
src:url("../style/icomoon.eot?-tgjuoj");
src:url("../style/icomoon.eot?#iefix-tgjuoj") format("embedded-opentype"),url("../style/icomoon.woff?-tgjuoj") format("woff"),url("../style/icomoon.ttf?-tgjuoj") format("truetype"),url("../style/icomoon.svg?-tgjuoj#icomoon") format("svg");
font-weight:normal;
font-style:normal
}
.clearfix:before,.clearfix:after {
content:" ";
display:table
}
.clearfix:after {
clear:both
}
.clearfix {
*zoom:1
}
.clearfix .right {
float:right
}
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
margin:0;
padding:0;
border:0;
font-size:100%
}
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
vertical-align:baseline
}
body {
font-family:Open Sans, Arial, Helvetica, sans-serif;
line-height:1.5;
font-weight:400
}
h1,h2,h3,h4,h5,h6 {
font-weight:300
}
.context h2,.context h3,.context h4,.context h5,.context h6 {
margin:1.5em 0 1em
}
.context h1 {
margin-bottom:1em;
font-size:3.125em
}
.context h3.fn,.context h3.flags {
color:#26282a;
font-size:1.46em;
padding:15px 0 15px 0;
border-bottom:2px #eee solid;
word-wrap:break-word
}
.context h3.fn .name,
.context h3 span.type,
.qmlname span.name {
font-weight: 400
}
.qmlname {
font-size:1.46em
}
.qmlproto table {
border:none;
border-bottom:2px #eee solid
}
.qmlproto table p {
max-width:100%
}
.qmlproto table tr {
background-color:#fff
}
.qmlname td, .qmlname th {
border:none;
text-align:left;
padding:5px 0 0 0
}
.qmlreadonly,.qmldefault {
padding:0 5px 0 5px;
font-size:0.75em;
background-color:#eee;
float:right
}
.qmlreadonly {
color:#414141
}
.qmldefault {
color:#D14141
}
.rightAlign {
padding:3px 5px 3px 10px;
text-align:right
}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
display:block
}
body {
line-height:1;
font-family:"Open Sans", Arial, Helvetica, sans-serif;
transition-duration:1s
}
ol,ul {
list-style:none
}
.context ol,.context ul {
margin-top:0.75em;
margin-left:20px
}
.context ol > li {
margin-left: 20px
}
.mainContent ol>li {
list-style-type: decimal;
}
.mainContent ol.a >li {
list-style-type: lower-alpha;
}
.mainContent ol.A >li {
list-style-type: upper-alpha;
}
blockquote,q {
quotes:none
}
blockquote:before,blockquote:after,q:before,q:after {
content:'';
content:none;
width:100%
}
table {
border-collapse:collapse;
border-spacing:0;
margin-bottom:25px;
width:100%
}
a {
color:#5caa15;
text-decoration:none;
transition-duration:0.3s
}
a:hover {
color:#46a2da
}
.main,.navbar-header,#footerbar>div {
max-width:1280px;
width:95%;
margin:0 auto
}
.main {
margin-top:100px
}
.main_index {
background-color:#fff
}
.sectionlist {
margin-bottom:2em
}
[class*="col-"] {
letter-spacing:normal
}
.landing,.main_index .row {
letter-spacing:-0.31em
}
.main_index .row>div {
letter-spacing:normal
}
.col-1,.context {
width:80%;
display:inline-block;
background-color:#fff;
padding:35px;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box
}
.col-1 h2 {
font-size:2.1875em;
font-weight:300;
line-height:1.1;
margin-bottom:0.83em;
margin-top:1em
}
.icons1of3 img {
display:inline-block;
float:left;
margin-right:0.75em;
margin-top:-5px;
width:2.75em
}
div.multi-column {
position:relative
}
div.multi-column div {
display:-moz-inline-box;
display:inline-block;
vertical-align:top;
margin-top:1em;
margin-right:2em;
width:16em
}
.sidebar {
display:block;
float:right;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box;
width:20%;
padding-left:30px
}
.toc,.sectionlist {
padding:35px;
background-color:#fff;
margin-bottom:2em
}
.sidebar-content:empty {
display:none;
visibility:hidden
}
.col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 {
font-weight:400;
margin-bottom:2em
}
.toc h3 a {
color:#404244
}
.title {
font-size:3em;
font-weight:300;
letter-spacing:-1px;
line-height:1.15em;
margin-bottom:0.5em;
word-wrap:break-word
}
.navigationbar,col-1 h2 {
font-size:0.75em
}
.navigationbar h1 {
font-size:3.125em;
margin-bottom:1em;
margin-top:1em
}
.navigationbar li {
display:inline-block;
margin-right:5px;
position:relative;
padding-right:10px;
color:#585a5c
}
.navigationbar li a {
color:#58585c
}
body {
background-color:#eee;
color:#404244
}
.sectionlist li {
margin-bottom:5px
}
dd {
padding-bottom:0.25em;
padding-left:2em
}
.col-1 ul {
margin-bottom:1.56em
}
.mainContent li {
margin-top:0.8em;
line-height:1.25em
}
.mainContent li.level2 {
margin-left:10px;
margin-top:0.4em;
font-size:0.9375em;
line-height:1.15em;
}
.mainContent p {
line-height:1.56em;
margin-bottom:1.5em;
color:#404244;
max-width:85%
}
.mainContent b {
font-weight:600
}
.context ul,.context ol {
margin-bottom:1.5em
}
.mainContent ul ul {
margin-top:0.5em
}
.mainContent .naviNextPrevious {
margin-top:25px;
max-width:100%
}
.naviNextPrevious.headerNavi {
display:none
}
.nextPage {
float:right
}
.prevPage:before {
content:"< "
}
.nextPage:after {
content:" >"
}
.navigationbar li:after {
color:#404244;
content:"›";
display:inline-block;
font-size:1.5em;
line-height:1;
position:absolute;
right:-2px;
top:-4px
}
.navigationbar ul:last li a {
color:#80c342
}
.sub-navigation {
margin-top:10px
}
.navigationbar li:last-child:after,.sub-navigation li:after {
content:none
}
.navigationbar {
margin-bottom:10px
}
#buildversion {
font-style:italic;
font-size:small;
float:right
}
.copy-notice {
width:65%;
font-size:0.75em;
margin-top:50px;
margin-bottom:25px;
line-height:1.75em;
color:#585a5c
}
li a.active {
color:#585a5c
}
.flowList {
padding:25px
}
.flowListDiv dl {
-webkit-column-count:1;
-moz-column-count:1;
column-count:1
}
.flowList dd {
display:inline-block;
margin-left:10px;
width:90%;
line-height:1.15em;
overflow-x:hidden;
text-overflow:ellipsis
}
.alphaChar {
font-size:2em;
position:absolute
}
.flowList.odd {
background-color:#f9f9f9
}
.context ul>li,.doc-column ul>li {
list-style-image:url("list_arrow.png");
margin-left:15px;
color:#404244;
line-height:1.16em
}
.mainContent table p {
margin:0px;
padding:0px;
max-width:initial;
min-height:2em
}
.mainContent table p.centerAlign {
text-align:center
}
.context h2 {
font-size:2.1875em
}
.context h3 {
font-size:1.75em
}
.context h4 {
font-size:1.375em
}
.context p img {
margin-top:0.75em;
max-width:100%
}
.context table {
vertical-align:initial
}
table .odd {
background-color:#f9f9f9
}
table thead {
text-align:left;
padding-left:20px
}
table,table td,table th {
border:1px solid #eee
}
table td,table th {
padding:5px 20px;
line-height:1.3
}
table.alignedsummary,table.propsummary {
width:initial
}
table.valuelist td.tblval {
font-size:0.75em
}
div.main_index .row {
border-bottom:1px solid #eee
}
div.main_index .row {
position:relative
}
div.main_index .row>div {
display:inline-block;
width:50%;
vertical-align:top;
padding:50px;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box
}
div.main_index h2 {
font-size:2.1875em;
margin-bottom:1em
}
#search_bar {
width:40%;
float:right
}
div.main_index .row:after {
content:"";
position:absolute;
top:0;
right:50%;
height:100%;
width:1px;
background-color:#eee
}
div.table {
overflow-x:auto
}
.context tr > td > pre {
font-size:0.85em
}
p.qt_commercial {
border:3px solid #5caa15;
margin:0 auto;
padding:15px;
width:28%;
text-align:center;
clear:both
}
h1.qt_commercial {
padding:20px;
background-color:#5caa15;
display:inline;
float:right;
font-size:1.25em;
line-height:1.25em;
height:1.25em;
color:#fff
}
div.qt_commercial {
border-top:5px solid #5caa15;
margin-bottom:50px
}
pre, .LegaleseLeft {
background-color:#404244;
color:#fff;
display:block;
font-family:"Droid Sans Mono";
line-height:1.5;
overflow-x:auto;
margin-bottom:25px;
padding:25px;
margin-top:0.75em
}
.mainContent .LegaleseLeft p {
color:#fff;
white-space: pre-wrap
}
.copy_text {
background-color:#46a2da;
color:#fff;
border:2px solid #46a2da;
padding:10px 16px;
margin-left:-10px;
margin-top:-50px;
position:absolute;
opacity:0;
cursor:pointer;
float:right
}
.copy_text:hover {
background-color:#fff;
color:#46a2da
}
code,.codelike {
font-family:"Droid Sans Mono"
}
h3.fn code {
font-size:0.75em;
float:right;
background-color:#eee;
padding:3px;
margin: 3px 0 0 20px
}
pre:hover>.copy_text {
display:inline-block;
opacity:1;
transition:0.5s ease
}
#main_title_bar {
letter-spacing:-0.31em
}
#main_title_bar .search_bar {
letter-spacing:normal;
width:50%;
display:inline-block;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box;
vertical-align:middle
}
#main_title_bar h1 {
letter-spacing:normal;
width:50%;
display:inline-block;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box;
vertical-align:middle
}
#main_title_bar .search_bar * {
letter-spacing:normal;
padding:0;
margin:0;
border:none
}
#sidebar-toggle,#toc-toggle {
display:none
}
@media (max-width: 980px) {
body {
font-size:calc-em(14px)
}
#main_title_bar {
letter-spacing:-0.31em;
width:100%
}
#main_title_bar>h1,#main_title_bar .search_bar {
display:block;
width:100%
}
#main_title_bar .search_bar {
margin-bottom:15px
}
.main {
margin-top:0px
}
.main_index .row {
border:none !important
}
.title {
font-size:1.5em;
font-weight:400;
word-wrap:break-word
}
.col-1,.context,.naviNextPrevious,.sidebar {
padding:10px
}
.sidebar {
padding-top:0
}
.search .sidebar {
display:none;
visibility:hidden
}
.col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 {
text-align:center;
margin-bottom:0
}
div.main_index .row:after {
content:none
}
div.main_index .row>div {
display:block !important;
width:100%;
padding:0;
margin:0
}
.context,.sidebar,.col-1 {
width:100%
}
.main_index h2,h1 {
text-align:center
}
.context h4,.context h3,.context h2 {
text-align:center
}
.sidebar-content,.col-2,.toc {
background-color:#fff;
margin-bottom:1em;
padding:20px
}
#sidebar-toggle,#toc-toggle {
display:block
}
#sidebar-toggle.collapsed + h2 {
display:block
}
.mainContent p {
line-height:1.56em;
margin-bottom:1em;
max-width:100%
}
table td,table th {
padding:5px 5px
}
.sectionlist {
padding:0
}
}
[id]:target,[name]:target,[name]:target+* {
-webkit-animation:highlighter 3s;
animation:highlighter 3s
}
@-webkit-keyframes highlighter {
25% {
background-color:#d1e8f6;
color:#444
}
75% {
background-color:#d1e8f6;
color:#444
}
}
@keyframes highlighter {
25% {
background-color:#d1e8f6;
color:#444
}
75% {
background-color:#d1e8f6;
color:#444
}
}
@-webkit-keyframes copypaste {
25% {
opacity:1
}
100% {
border-radius:10px;
margin-top:-50px;
opacity:1
}
}
@keyframes copypaste {
25% {
opacity:1
}
100% {
border-radius:10px;
margin-top:-50px;
opacity:1
}
}
#footer {
clear:both
}
.menuextraslanguages {
display:none;
visibility:hidden
}
form.gsc-search-box {
font-size: 25px !important;
margin-top: 0 !important;
margin-right: 0 !important;
margin-bottom: 4px !important;
margin-left: 0 !important;
width: 100% !important;
}
table.gsc-search-box {
border-style: none !important;
border-width: 0 !important;
border-spacing: 0 0 !important;
width: 100% !important;
margin-bottom: 2px !important;
}
table.gsc-search-box td {
vertical-align: middle !important;
}
table.gsc-search-box td.gsc-input {
padding-right: 0px !important;
}
table.gsc-search-box td.gsc-input input {
background-position: 15px center !important;
}
td.gsc-search-button {
width: 1% !important;
}
td.gsc-clear-button {
width: 14px !important;
visibility:hidden !important;
display:none !important;
}
table.gsc-branding td,
table.gsc-branding {
margin: 0 0 0 0 !important;
padding: 0 0 0 0 !important;
border: none !important;
}
table.gsc-branding {
border-style: none !important;
border-width: 0 !important;
border-spacing: 0 0 !important;
width: 100% !important;
}
.gsc-branding-text {
color: #676767 !important;
}
td.gsc-branding-text {
vertical-align: top !important;
}
td.gsc-branding-text div.gsc-branding-text {
padding-bottom: 2px !important;
text-align: right !important;
font-size: 11px !important;
margin-right: 2px !important;
}
td.gsc-branding-img {
width: 65px !important;
vertical-align: bottom !important;
}
img.gsc-branding-img {
padding-top: 1px !important;
margin: 0 0 0 0 !important;
padding-right: 0 !important;
padding-left: 0 !important;
padding-bottom: 0 !important;
border: none !important;
display: inline !important;
}
input.gsc-search-button {
background-color: white !important;
height: 35px !important;
width: 25px !important;
color: transparent !important;
background-image: url("doc_search.png") !important;
background-size: 25px auto;
background-position: 0px 5px;
background-repeat: no-repeat;
margin-left: -43px !important;
overflow: hidden;
min-width: 20px !important;
}
input.gsc-search-button:hover {
cursor: pointer;
}
input.gsc-search-button:focus {
outline: none;
box-shadow: none;
}
.gsc-search-box-tools .gsc-clear-button {
display: none !important;
visibility: none !important;
}
.gsc-overflow-hidden {
overflow: hidden !important;
}
input.gsc-input {
background-color: #fff !important;
border: 1px solid #d6d6d6 !important;
border-radius: 5px !important;
box-sizing: border-box !important;
-moz-box-sizing: border-box !important;
color: #868482 !important;
outline: 0 none !important;
padding: 9px 10px 10px !important;
transition: color 0.5s ease 0s, box-shadow 0.5s ease 0s, background-color 0.5s ease 0s !important;
}
input {
font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
line-height: 1.5 !important;
font-weight: 300 !important;
vertical-align:middle
}
input:focus {
border-color: #46a2da;
box-shadow: 0 0 5px #46a2da;
color: #000;
}
a.qa-mark:target:before {
content: "***";
color: #ff0000;
}
/*!
\page tbaseutil-index.html
\title tbaseutil
\l {tbaseutil C++ Classes}
*/
/*!
\module tbaseutil
\title tbaseutil C++ Classes
*/
TEMPLATE = aux
TargetName=tmqtt
HELPGENERATOR = $$shell_path($$[QT_INSTALL_BINS]/qhelpgenerator)
QDOC_BIN = $$shell_path($$[QT_INSTALL_BINS]/qdoc)
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]/src
QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
QHP_FILE = $$PWD/html/$${TargetName}.qhp
QCH_FILE = $$PWD/$${TargetName}.qch
doc_generate.TARGET = $$TargetName.qhp
doc_generate.commands = $$QDOC_BIN $$PWD/config/doc.qdocconf -indexdir $${QDOC_INDEX_DIR}
qch_docs.TARGET=$$TargetName.qch
qch_docs.commands = $$HELPGENERATOR -o $$QCH_FILE $$QHP_FILE
qch_docs.depends += doc_generate
QMAKE_EXTRA_TARGETS += doc_generate qch_docs
PRE_TARGETDEPS += qch_docs
DISTFILES += \
config/doc.qdocconf \
global/compat.qdocconf \
global/config.qdocconf \
global/externalsites.qdocconf \
global/fileextensions.qdocconf \
global/html-config.qdocconf \
global/html-footer.qdocconf \
global/html-header-offline.qdocconf \
global/macros.qdocconf \
global/manifest-meta.qdocconf \
global/qt-cpp-defines.qdocconf \
global/qt-html-templates-offline-simple.qdocconf \
global/qt-html-templates-offline.qdocconf \
global/qt-module-defaults-offline.qdocconf \
src/tmqtt.qdoc \
src/tmqtt-index.qdoc
@echo off
sincpm update --os=windows --arch=x86 --compiler=msvc2015 --qt=5.6.3
\ No newline at end of file
[
{
"name": "topikm6-mqtt",
"version": "0.0.1",
"os": "windows",
"arch": "x86",
"compiler": "msvc2015",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
},
"prefix": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dependencies": {
},
"packageFiles": [
"bin/qmqtt.dll",
"bin/qmqtt.lib",
"bin/tmqtt.dll",
"bin/tmqtt.lib",
"bin/tmqtt.pdb"
]
},
{
"name": "topikm6-mqtt",
"version": "0.0.1",
"os": "linux",
"arch": "x64",
"compiler": "gcc",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
},
"prefix": "dist/topikm/qt5.6.3-linuxx86_64/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-linuxx86_64/",
"dependencies": {
},
"packageFiles": [
]
},
{
"name": "topikm6-mqtt-debug",
"version": "0.0.1",
"os": "windows",
"arch": "x86",
"compiler": "msvc2015",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
},
"prefix": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dependencies": {
},
"packageFiles": [
"bin/qmqttd.dll",
"bin/qmqttd.lib",
"bin/tmqttd.dll",
"bin/tmqttd.lib",
"bin/tmqttd.pdb"
]
}
]
############################### COPYRIGHT ##################################
# #
# Copyright (c) 2009-2020 TopLinker Co.,Ltd. (http://www.toplinker.net) #
# ALL RIGHTS RESERVED #
# #
# The entire contents of this file is protected by copyright law and #
# international treaties. Unauthorized reproduction, reverse-engineering #
# and distribution of all or any portion of the code contained in this #
# file is strictly prohibited and may result in severe civil and #
# criminal penalties and will be prosecuted to the maximum extent #
# possible under the law. #
# #
# RESTRICTIONS #
# #
# THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED #
# FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE #
# COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE #
# AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT #
# AND PERMISSION FROM DEVELOPER MACHINES #
# #
# CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON #
# ADDITIONAL RESTRICTIONS. #
# #
#############################################################################
#----------------动态库编译设定----------------------------------------------
###设定编译后的动态库名称
TARGET = $$qtLibraryTarget(ecma_twidget)
###添加QT库依赖库
QT += core sql script xml network gui widgets
###设定依赖的库列表
LIB_LIST = tbaseutil twidget
#-----------------File List--------------------------------------------
SOURCES += \
tfiledialog_ecmabinding.cpp \
tmessagebox_ecmabinding.cpp \
ttableviewdialog_ecmabinding.cpp \
twidgetecmaplugin.cpp
HEADERS += \
tfiledialog_ecmabinding.h \
tmessagebox_ecmabinding.h \
ttableviewdialog_ecmabinding.h \
twidgetecmaplugin.h
#----------------其它编译设定-----------------------
###设定编译成动态库
TEMPLATE = lib
###获取编译平台
TOPIKM_PLATFORM=$$(TOPIKM_PLATFORM)
isEmpty(TOPIKM_PLATFORM){
TOPIKM_PLATFORM=unknown
win32 {
TOPIKM_PLATFORM=win32
win32-g++ {
TOPIKM_PLATFORM=win32-mingw
}
win32-msvc2013 {
TOPIKM_PLATFORM=win32-msvc2013
}
win32-msvc2015 {
TOPIKM_PLATFORM=win32-msvc2015
}
}
macx {
TOPIKM_PLATFORM=macx
}
linux {
TOPIKM_PLATFORM=linux$$QMAKE_HOST.arch
}
}
###SDK目录
TOPIKM_SDKPATH=$$PWD/../../dist/topikm/qt$$[QT_VERSION]-$${TOPIKM_PLATFORM}
###include头文件Path
INCLUDEPATH += $${TOPIKM_SDKPATH}/include
###支持C++11语法
CONFIG += c++11
###根据不同的系统,Release或Debug版本设定不同的编译目录及动态库后缀
CONFIG += debug_and_release
CONFIG(debug, debug | release) {
DESTDIR = $${TOPIKM_SDKPATH}/bin_dbg
win32 {
DEBUG_SUFFIX = d
}
macx {
DEBUG_SUFFIX = _debug
}
} else {
DESTDIR = $${TOPIKM_SDKPATH}/bin
DEBUG_SUFFIX =
}
###载入需链接的动态库
LIBS += -L$$DESTDIR
for(lib, LIB_LIST) {
LIBS += -l$${lib}$${DEBUG_SUFFIX}
}
DESTDIR = $${DESTDIR}/script
#版本信息
CONFIG += skip_target_version_ext
VERSION = 6.0.34.0
QMAKE_TARGET_PRODUCT = topikm6-ecma-twidget
QMAKE_TARGET_COMPANY = TopLinker Co.,Ltd.
QMAKE_TARGET_COPYRIGHT = Copyright(C) 2020 TopLinker
#include "tfiledialog_ecmabinding.h"
#include <QScriptEngine>
#include <QScriptContext>
#include <tbaseutil/tecmahelper.h>
#include <tbaseutil/terror.h>
#include <twidget/tfiledialog.h>
void TFileDialog_EcmaBinding::initBinding(QScriptEngine *iEngine)
{
iEngine->setDefaultPrototype(qMetaTypeId<TFileDialog*>(), QScriptValue());
QScriptValue proto = iEngine->newVariant(qVariantFromValue((TFileDialog*)0));
proto.setPrototype(iEngine->defaultPrototype(qMetaTypeId<TFileDialog*>()));
TEcmaHelper::registerQObjectMetaType<TFileDialog*>(iEngine);
QScriptValue ctor = iEngine->newFunction(create, proto);
iEngine->globalObject().setProperty("TFileDialog", ctor, QScriptValue::SkipInEnumeration);
}
QScriptValue TFileDialog_EcmaBinding::create(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
if (iContext->thisObject().strictlyEquals
(iContext->engine()->globalObject()))
{
return TEcmaHelper::throwError_ForgetNew("TFileDialog", iContext);
}
int argCount = iContext->argumentCount();
switch(argCount) {
case 0:
return iContext->engine()->newQObject(iContext->thisObject(),
new TFileDialog(),
QScriptEngine::AutoOwnership);
break;
case 1:
{
QString captionStr = iContext->argument(0).toString();
return iContext->engine()->newQObject(iContext->thisObject(),
new TFileDialog(captionStr),
QScriptEngine::AutoOwnership);
}
break;
case 2:
{
QString captionStr = iContext->argument(0).toString();
QString directoryStr = iContext->argument(1).toString();
return iContext->engine()->newQObject(iContext->thisObject(),
new TFileDialog(captionStr,
directoryStr),
QScriptEngine::AutoOwnership);
}
break;
case 3:
{
QString captionStr = iContext->argument(0).toString();
QString directoryStr = iContext->argument(1).toString();
QString filterStr = iContext->argument(2).toString();
return iContext->engine()->newQObject(iContext->thisObject(),
new TFileDialog(captionStr,
directoryStr,
filterStr),
QScriptEngine::AutoOwnership);
}
break;
case 4:
{
QString captionStr = iContext->argument(0).toString();
QString directoryStr = iContext->argument(1).toString();
QString filterStr = iContext->argument(2).toString();
QWidget *parent = qobject_cast<QWidget *>
(iContext->argument(0).toQObject());
return iContext->engine()->newQObject(iContext->thisObject(),
new TFileDialog(captionStr,
directoryStr,
filterStr,
parent),
QScriptEngine::AutoOwnership);
}
break;
default:
return TEcmaHelper::throwError_CtorNotFound("TFileDialog", iContext);
break;
}
}
#ifndef TFILEDIALOG_ECMABINDING_H
#define TFILEDIALOG_ECMABINDING_H
class QScriptEngine;
class QScriptContext;
class QScriptValue;
class TFileDialog_EcmaBinding
{
public:
static void initBinding(QScriptEngine *iEngine);
static QScriptValue create(QScriptContext *iContext, QScriptEngine *iEngine);
};
#endif // TFILEDIALOG_ECMABINDING_H
#include "tmessagebox_ecmabinding.h"
#include <tbaseutil/tecmahelper.h>
#include <twidget/tmessagebox.h>
Q_DECLARE_METATYPE(TMessageBox*)
void TMessageBox_EcmaBinding::initBinding(QScriptEngine *iEngine)
{
iEngine->setDefaultPrototype(qMetaTypeId<TMessageBox*>(), QScriptValue());
QScriptValue proto = iEngine->newVariant(qVariantFromValue((TMessageBox*)0));
proto.setPrototype(iEngine->defaultPrototype(qMetaTypeId<TMessageBox*>()));
TEcmaHelper::registerQObjectMetaType<TMessageBox*>(iEngine);
QScriptValue ctor = iEngine->newFunction(create, proto);
ctor.setProperty("msgbox", iEngine->newFunction(msgbox, QScriptValue::SkipInEnumeration));
ctor.setProperty("info", iEngine->newFunction(info, QScriptValue::SkipInEnumeration));
ctor.setProperty("ok", iEngine->newFunction(ok, QScriptValue::SkipInEnumeration));
ctor.setProperty("warning", iEngine->newFunction(warning, QScriptValue::SkipInEnumeration));
ctor.setProperty("error", iEngine->newFunction(error, QScriptValue::SkipInEnumeration));
ctor.setProperty("question", iEngine->newFunction(question, QScriptValue::SkipInEnumeration));
iEngine->globalObject().setProperty("TMessageBox", ctor, QScriptValue::SkipInEnumeration);
}
QScriptValue TMessageBox_EcmaBinding::create(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
if (iContext->thisObject().strictlyEquals(iContext->engine()->globalObject()))
{
return TEcmaHelper::throwError_ForgetNew("TMessageBox", iContext);
}
if (iContext->argumentCount() == 0)
{
return iContext->engine()->newQObject(iContext->thisObject(), new TMessageBox(), QScriptEngine::AutoOwnership);
}
else if (iContext->argumentCount() == 1)
{
QWidget *parent = qobject_cast<QWidget *>(iContext->argument(0).toQObject());
return iContext->engine()->newQObject(iContext->thisObject(), new TMessageBox(parent), QScriptEngine::AutoOwnership);
}
else
{
return TEcmaHelper::throwError_CtorNotFound("TMessageBox", iContext);
}
}
QScriptValue TMessageBox_EcmaBinding::msgbox(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::msgbox();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 6)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toString(),
iContext->argument(5).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 7)
{
resultStr = TMessageBox::msgbox(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toString(),
iContext->argument(5).toVariant().toStringList(),
iContext->argument(6).toString());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "msgbox",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iIconStr = 'Information', " \
"QString iTitleStr = 'Information', " \
"QStringList iButtonStrLst = ['Ok'], " \
"QString iDefaultBtnStr = ''",
iContext);
}
QScriptValue TMessageBox_EcmaBinding::info(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::info();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::info(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::info(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::info(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::info(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::info(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "info",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iTitleStr = '', " \
"QStringList iButtonStrLst = ['Ok'], ",
iContext);
}
QScriptValue TMessageBox_EcmaBinding::ok(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::ok();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::ok(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::ok(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::ok(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::ok(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::ok(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "ok",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iTitleStr = '', " \
"QStringList iButtonStrLst = ['Ok'], ",
iContext);
}
QScriptValue TMessageBox_EcmaBinding::warning(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::warning();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::warning(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::warning(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::warning(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::warning(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::warning(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "warning",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iTitleStr = '', " \
"QStringList iButtonStrLst = ['Ok'], ",
iContext);
}
QScriptValue TMessageBox_EcmaBinding::error(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::error();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::error(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::error(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::error(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::error(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::error(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "error",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iTitleStr = '', " \
"QStringList iButtonStrLst = ['Ok'], ",
iContext);
}
QScriptValue TMessageBox_EcmaBinding::question(QScriptContext *iContext, QScriptEngine *iEngine)
{
Q_UNUSED(iEngine);
int argCountInt = iContext->argumentCount();
QString resultStr = "";
if (argCountInt == 0)
{
resultStr = TMessageBox::question();
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 1)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)));
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 2)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 3)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 4)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 5)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList());
return QScriptValue(iContext->engine(), resultStr);
}
else if (argCountInt == 6)
{
resultStr = TMessageBox::question(qscriptvalue_cast<QWidget *>(iContext->argument(0)),
iContext->argument(1).toString(),
iContext->argument(2).toString(),
iContext->argument(3).toString(),
iContext->argument(4).toVariant().toStringList(),
iContext->argument(5).toString());
return QScriptValue(iContext->engine(), resultStr);
}
return TEcmaHelper::throwError_FuncDisMatch("TMessageBox", "error",
"QWidget iParent = 0, " \
"QString iTextStr = '', " \
"QString iDetailStr = '', " \
"QString iTitleStr = '', " \
"QStringList iButtonStrLst = ['Yes','No'], " \
"QString iDefaultBtnStr = ''",
iContext);
}
#ifndef TMESSAGEBOX_ECMABINDING_H
#define TMESSAGEBOX_ECMABINDING_H
class QScriptEngine;
class QScriptContext;
class QScriptValue;
class TMessageBox_EcmaBinding
{
public:
static void initBinding(QScriptEngine *iEngine);
static QScriptValue create(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue msgbox(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue info(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue ok(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue warning(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue error(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue question(QScriptContext *iContext, QScriptEngine *iEngine);
};
#endif // TMESSAGEBOX_ECMABINDING_H
#include <tbaseutil/tecmahelper.h>
#include <tbaseutil/terror.h>
#include <twidget/ttableviewdialog.h>
#include <QScriptEngine>
#include <QScriptContext>
#include "ttableviewdialog_ecmabinding.h"
Q_DECLARE_METATYPE(QAbstractItemView::SelectionMode)
void TTableViewDialog_EcmaBinding::initBinding(QScriptEngine *iEngine)
{
iEngine->setDefaultPrototype(qMetaTypeId<TTableViewDialog*>(), QScriptValue());
QScriptValue proto = iEngine->newVariant(qVariantFromValue((TTableViewDialog*)0));
proto.setPrototype(iEngine->defaultPrototype(qMetaTypeId<TTableViewDialog*>()));
TEcmaHelper::registerQObjectMetaType<TTableViewDialog*>(iEngine);
qScriptRegisterMetaType(iEngine, toScriptValue, fromScriptValue);
TECMA_BIND_METHOD_FUNCTION(setSelectionMode, 1);
QScriptValue ctor = iEngine->newFunction(create, proto);
iEngine->globalObject().setProperty("TTableViewDialog", ctor, QScriptValue::SkipInEnumeration);
}
QScriptValue TTableViewDialog_EcmaBinding::create(QScriptContext *iContext,
QScriptEngine *iEngine)
{
Q_UNUSED(iEngine)
if (iContext->thisObject().strictlyEquals(iContext->engine()->globalObject())) {
return TEcmaHelper::throwError_ForgetNew("TTableViewDialog", iContext);
}
if (iContext->argumentCount() == 0) {
return iContext->engine()->newQObject(iContext->thisObject(),
new TTableViewDialog,
QScriptEngine::AutoOwnership);
}
else if(iContext->argumentCount() == 1) {
QWidget *parent = qobject_cast<QWidget *>(iContext->argument(0).toQObject());
return iContext->engine()->newQObject(iContext->thisObject(),
new TTableViewDialog(parent),
QScriptEngine::AutoOwnership);
}
else
{
return TEcmaHelper::throwError_CtorNotFound("TTableViewDialog", iContext);
}
}
QScriptValue TTableViewDialog_EcmaBinding::toScriptValue(QScriptEngine *iEngine,
const QAbstractItemView::SelectionMode &iMode)
{
return iEngine->newVariant(iMode);
}
void TTableViewDialog_EcmaBinding::fromScriptValue(const QScriptValue &iValue,
QAbstractItemView::SelectionMode &iMode)
{
qint32 tmpInt = iValue.toInt32();
switch(tmpInt){
case 0: iMode = QAbstractItemView::NoSelection;
break;
case 1:
iMode = QAbstractItemView::SingleSelection;
break;
case 2:
iMode = QAbstractItemView::MultiSelection;
break;
case 3:
iMode = QAbstractItemView::ExtendedSelection;
break;
case 4:
iMode = QAbstractItemView::ContiguousSelection;
break;
default:
iMode = QAbstractItemView::NoSelection;
}
}
QScriptValue TTableViewDialog_EcmaBinding::setSelectionMode(QScriptContext *iContext,
QScriptEngine *iEngine)
{
Q_UNUSED(iEngine)
TECMA_BIND_CHECK_SELF(TTableViewDialog);
if (iContext->argumentCount() == 1)
{
cSelf->setSelectionMode(static_cast<QAbstractItemView::SelectionMode>
(iContext->argument(0).toInt32()));
}
else
{
return TEcmaHelper::throwError_FuncDisMatch("TTableViewDialog", "setSelectionMode","Invalid ArgumentCount",iContext);
}
return iContext->engine()->undefinedValue();
}
#ifndef TTABLEVIEWDIALOG_ECMABINDING_H
#define TTABLEVIEWDIALOG_ECMABINDING_H
#include <QAbstractItemView>
class QScriptEngine;
class QScriptContext;
class QScriptValue;
class QAbstractItemView;
class TTableViewDialog_EcmaBinding
{
public:
static void initBinding(QScriptEngine *iEngine);
static QScriptValue create(QScriptContext *iContext, QScriptEngine *iEngine);
static QScriptValue toScriptValue(QScriptEngine *iEngine,
const QAbstractItemView::SelectionMode &iMode);
static void fromScriptValue(const QScriptValue &iValue,
QAbstractItemView::SelectionMode &iMode);
static QScriptValue setSelectionMode(QScriptContext *iContext, QScriptEngine *iEngine);
};
#endif // TTABLEVIEWDIALOG_ECMABINDING_H
/****************************************************************************
**
** Copyright (c) 2009-2016 TopLinker Co.,Ltd. (http://www.toplinker.net)
** ALL RIGHTS RESERVED
**
** The entire contents of this file is protected by copyright law and
** international treaties. Unauthorized reproduction, reverse-engineering
** and distribution of all or any portion of the code contained in this
** file is strictly prohibited and may result in severe civil and
** criminal penalties and will be prosecuted to the maximum extent
** possible under the law.
**
** RESTRICTIONS
**
** THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED
** FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE
** COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE
** AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT
** AND PERMISSION FROM DEVELOPER MACHINES
**
** CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON
** ADDITIONAL RESTRICTIONS.
**
****************************************************************************/
#include "twidgetecmaplugin.h"
#include <QDebug>
#include <QMessageBox>
#include <QScriptEngine>
#include <tbaseutil/tecmahelper.h>
#include <twidget/tuiloader.h>
#include <twidget/tuiloaderdialog.h>
#include <twidget/ttableview.h>
#include <twidget/ttreeviewdialog.h>
#include <twidget/tcombobox.h>
#include <twidget/tdateedit.h>
#include <twidget/tdatetimeedit.h>
#include <twidget/tlineedit.h>
#include <twidget/tlabel.h>
#include <twidget/tradiobox.h>
#include <twidget/tplaintextedit.h>
#include <twidget/ttextedit.h>
#include <twidget/tpushbutton.h>
#include <twidget/tsearchentry.h>
#include <twidget/ttreeview.h>
#include <twidget/tcheckbox.h>
#include <twidget/ttableviewdialog.h>
#include <twidget/ttablechooserdialog.h>
#include "tmessagebox_ecmabinding.h"
#include "tfiledialog_ecmabinding.h"
#include "ttableviewdialog_ecmabinding.h"
QScriptValue qtscript_create_QMessageBox_class(QScriptEngine *engine);
QStringList TWidgetEcmaPlugin::keys() const
{
return QStringList() << "ikm" << "ikm.widgets";
}
void TWidgetEcmaPlugin::initialize(const QString &key, QScriptEngine *engine)
{
if (key == "ikm.widgets") {
TMessageBox_EcmaBinding::initBinding(engine);
TFileDialog_EcmaBinding::initBinding(engine);
TTableViewDialog_EcmaBinding::initBinding(engine);
TEcmaHelper::registerQWidget<TUiLoader>("TUiloader", engine);
TEcmaHelper::registerQWidget<TUiloaderDialog>("TUiloaderDialog", engine);
TEcmaHelper::registerQWidget<TTableView>("TTableView", engine);
TEcmaHelper::registerQWidget<TComboBox>("TComboBox", engine);
TEcmaHelper::registerQWidget<TDateEdit>("TDateEdit", engine);
TEcmaHelper::registerQWidget<TDateTimeEdit>("TDateTimeEdit", engine);
TEcmaHelper::registerQWidget<TLineEdit>("TLineEdit", engine);
TEcmaHelper::registerQWidget<TLabel>("TLabel", engine);
TEcmaHelper::registerQWidget<TRadioBox>("TRadioBox", engine);
TEcmaHelper::registerQWidget<TPlainTextEdit>("TPlainTextEdit", engine);
TEcmaHelper::registerQWidget<TPushButton>("TPushButton", engine);
TEcmaHelper::registerQWidget<TSearchEntry>("TSearchEntry", engine);
TEcmaHelper::registerQWidget<TTreeView>("TTreeView", engine);
TEcmaHelper::registerQWidget<TCheckBox>("TCheckBox", engine);
TEcmaHelper::registerQWidget<TTableChooserDialog>("TTableChooserDialog", engine);
TEcmaHelper::registerQWidget<TTreeViewDialog>("TTreeViewDialog", engine);
}
}
#ifndef TWIDGETECMAPLUGIN_H
#define TWIDGETECMAPLUGIN_H
/****************************************************************************
**
** Copyright (c) 2009-2016 TopLinker Co.,Ltd. (http://www.toplinker.net)
** ALL RIGHTS RESERVED
**
** The entire contents of this file is protected by copyright law and
** international treaties. Unauthorized reproduction, reverse-engineering
** and distribution of all or any portion of the code contained in this
** file is strictly prohibited and may result in severe civil and
** criminal penalties and will be prosecuted to the maximum extent
** possible under the law.
**
** RESTRICTIONS
**
** THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED
** FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE
** COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE
** AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT
** AND PERMISSION FROM DEVELOPER MACHINES
**
** CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON
** ADDITIONAL RESTRICTIONS.
**
****************************************************************************/
#include <QScriptExtensionPlugin>
class TWidgetEcmaPlugin : public QScriptExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "net.toplinker.ecmaplugin")
public:
QStringList keys() const;
void initialize(const QString &key, QScriptEngine *engine);
};
#endif // TWIDGETECMAPLUGIN_H
# #
# Copyright (c) 2009-2020 TopLinker Co.,Ltd. (http://www.toplinker.net) #
# ALL RIGHTS RESERVED #
# #
# The entire contents of this file is protected by copyright law and #
# international treaties. Unauthorized reproduction, reverse-engineering #
# and distribution of all or any portion of the code contained in this #
# file is strictly prohibited and may result in severe civil and #
# criminal penalties and will be prosecuted to the maximum extent #
# possible under the law. #
# #
# RESTRICTIONS #
# #
# THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED #
# FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE #
# COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE #
# AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT #
# AND PERMISSION FROM DEVELOPER MACHINES #
# #
# CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON #
# ADDITIONAL RESTRICTIONS. #
# #
#############################################################################
###设定编译后的动态库名称
TARGET = $$qtLibraryTarget(tmqtt)
###设定编译成动态库
TEMPLATE = lib
DEFINES += TMQTT_LIBRARY
QT += core network
###设定头文件导出目标Path
HEADER_INSTALL = tmqtt
###设定依赖的库列表
LIB_LIST = qmqtt
SOURCES += \
witmqttclient.cpp
HEADERS += \
tmqtt_global.h \
witmqttclient.h
DIST_DIR = $$PWD/../../dist
include(../shared/shared.pri)
###查看SDK头文件目标路径是否存在,不存在则创建
SDK_HEADER_PATH = $$system_path($${TOPIKM_SDKPATH}/include/$${HEADER_INSTALL})
!exists($${SDK_HEADER_PATH}) {
mkpath($${SDK_HEADER_PATH})
}
include ($$PWD/../../party3/qmqtt/qmqtt.pri)
INCLUDEPATH += $$PWD/../../party3/qmqtt/include/
###导出header
win32 {
system(copy *.h $${SDK_HEADER_PATH})
} else {
system(cp *.h $${SDK_HEADER_PATH})
}
#版本信息
CONFIG += skip_target_version_ext
VERSION = 0.0.1.0
QMAKE_TARGET_PRODUCT = topikm6-mqtt
QMAKE_TARGET_COMPANY = TopLinker Co.,Ltd.
QMAKE_TARGET_COPYRIGHT = Copyright(C) 2020 TopLinker
#ifndef TMQTT_GLOBAL_H
#define TMQTT_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(TMQTT_LIBRARY)
# define TMQTTSHARED_EXPORT Q_DECL_EXPORT
#else
# define TMQTTSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // TMQTT_GLOBAL_H
#include "witmqttclient.h"
#include <QFile>
#include <QDebug>
#include <QTimer>
//#include <top8/common/logger.h>
static char CRLF_SEP[] = "\r\n\r\n";
static int SEP_LEN = 4;
class WitMqttRpcEventLoopPrivate {
Q_DECLARE_PUBLIC(WitMqttRpcEventLoop)
public:
explicit WitMqttRpcEventLoopPrivate(WitMqttRpcEventLoop *qptr):
q_ptr(qptr){}
~WitMqttRpcEventLoopPrivate(){}
QString uid;
QByteArray data;
QTimer timer;
protected:
WitMqttRpcEventLoop * const q_ptr;
};
WitMqttRpcEventLoop::WitMqttRpcEventLoop(const QString &iUid, int iTimeout, QObject *parent) : QEventLoop(parent),
d_ptr(new WitMqttRpcEventLoopPrivate(this))
{
Q_D(WitMqttRpcEventLoop);
d->uid = iUid;
d->timer.setSingleShot(true);
d->timer.setInterval(iTimeout);
connect(&d->timer, &QTimer::timeout, this, &WitMqttRpcEventLoop::onTimeout);
}
WitMqttRpcEventLoop::~WitMqttRpcEventLoop()
{
}
void WitMqttRpcEventLoop::quit(const QString &iUid, const QByteArray &iData)
{
Q_D(WitMqttRpcEventLoop);
if (d->uid == iUid) {
d->data = iData;
QEventLoop::quit();
}
}
void WitMqttRpcEventLoop::setUid(const QString &iUid)
{
Q_D(WitMqttRpcEventLoop);
d->uid = iUid;
}
QString WitMqttRpcEventLoop::uid() const
{
Q_D(const WitMqttRpcEventLoop);
return d->uid;
}
QByteArray WitMqttRpcEventLoop::data() const
{
Q_D(const WitMqttRpcEventLoop);
return d->data;
}
void WitMqttRpcEventLoop::exec(QEventLoop::ProcessEventsFlags flags)
{
Q_D(WitMqttRpcEventLoop);
d->timer.start();
QEventLoop::exec(flags);
}
void WitMqttRpcEventLoop::onTimeout()
{
Q_D(WitMqttRpcEventLoop);
if (this->isRunning()) {
WitMqttRpcRepMessage rep;
rep.data = QVariantMap {
{"errCode", "TIMEOUT"},
{"errText", "Timeout"},
};
d->data = rep.toByteArray();
QEventLoop::quit();
}
}
class WitMqttClientPrivate
{
Q_DECLARE_PUBLIC(WitMqttClient)
public:
explicit WitMqttClientPrivate(WitMqttClient *qptr) : q_ptr(qptr){}
~WitMqttClientPrivate() {
for (const QString &k : fileMap.keys()) {
delete fileMap[k];
}
fileMap.clear();
}
quint64 fileTransPackageSize {1024 * 512};
int fileTransTimeout {1000 * 60};
QString fileTempDir {QDir::tempPath()};
QMap<QString, QFile *> fileMap;
QMap<QString, QTimer *> fileTimer;
bool canceled {false};
protected:
WitMqttClient * const q_ptr;
};
WitMqttClient::WitMqttClient(const QString &iHost, qint16 iPort, QObject *parent):
QMQTT::Client(QHostAddress(iHost), iPort, parent),
d_ptr(new WitMqttClientPrivate(this))
{
connect(this, &WitMqttClient::connected, this, &WitMqttClient::onConnected);
connect(this, &WitMqttClient::subscribed, this, &WitMqttClient::onSubscribed);
connect(this, &WitMqttClient::received, this, &WitMqttClient::onReceived);
}
WitMqttClient::~WitMqttClient()
{
}
QVariantMap WitMqttClient::rpcRequest(const QString &iTarget, const QString &iFunc, const QVariantMap &iParam, int iTimeout)
{
WitMqttRpcReqMessage req;
req.from = this->clientId();
req.to = iTarget;
req.func = iFunc;
req.param = iParam;
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(req.to).arg(WIT_MQTT_TOPIC_REQ));
qmsg.setQos(1);
qmsg.setPayload(req.toByteArray());
this->publish(qmsg);
if (iTimeout > 0) {
WitMqttRpcEventLoop loop(req.uid, iTimeout);
connect(this, &WitMqttClient::rpcResponseReceived, &loop, &WitMqttRpcEventLoop::quit);
loop.exec();
WitMqttRpcRepMessage rep(loop.data());
return rep.data;
}
return QVariantMap();
}
void WitMqttClient::sendRpcReply(const WitMqttRpcRepMessage &iMsg)
{
QMQTT::Message repmsg;
repmsg.setTopic(QString("%1/%2").arg(iMsg.to).arg(WIT_MQTT_TOPIC_REP));
repmsg.setQos(1);
repmsg.setPayload(iMsg.toByteArray());
this->publish(repmsg);
}
bool WitMqttClient::sendFile(const QString &iTargetClientId, const QString &iSrcFilePath, const QString &iTargetFileName)
{
Q_D(WitMqttClient);
QFile file(iSrcFilePath);
if (!file.exists()) return false;
int maxsize = d->fileTransPackageSize;
int timeout = d->fileTransTimeout;
QString fileuid = QUuid::createUuid().toString();
QVariantMap progressInfo;
progressInfo.insert("uid", fileuid);
progressInfo.insert("to", iTargetClientId);
progressInfo.insert("distFile", iTargetFileName);
progressInfo.insert("srcFile", iSrcFilePath);
//请求开始传输文件
{
WitMqttFileMessage fmsg;
fmsg.uid = fileuid;
fmsg.state = 2;
fmsg.from = this->clientId();
fmsg.to = iTargetClientId;
fmsg.data = QVariantMap{{"target", iTargetFileName}};
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(fmsg.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
qmsg.setPayload(fmsg.toByteArray());
this->publish(qmsg);
WitMqttRpcEventLoop loop(fileuid, timeout);
connect(this, &WitMqttClient::fileAckReplied, &loop, &WitMqttRpcEventLoop::quit);
loop.exec();
if (!loop.data().isEmpty()){
progressInfo.insert("errCode", "TIMEOUT");
progressInfo.insert("errText", "Timeout");
emit fileSendProgress(progressInfo);
return false;
}
}
if (!file.open(QFile::ReadOnly)) return false;
auto fileSize = file.size();
progressInfo.insert("size", fileSize);
//传输文件内容
while (!file.atEnd() && !d->canceled) {
QByteArray data = file.read(maxsize);
WitMqttFileMessage fmsg;
fmsg.uid = fileuid;
fmsg.state = 3;
fmsg.from = this->clientId();
fmsg.to = iTargetClientId;
fmsg.data = QVariantMap{{"size", fileSize}, {"pos", file.pos()}};
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(fmsg.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
data.prepend(CRLF_SEP);
data.prepend(fmsg.toByteArray());
qmsg.setPayload(data);
this->publish(qmsg);
progressInfo.insert("pos", file.pos());
emit fileSendProgress(progressInfo);
WitMqttRpcEventLoop loop(fileuid, timeout);
connect(this, &WitMqttClient::fileAckReplied, &loop, &WitMqttRpcEventLoop::quit);
loop.exec();
if (!loop.data().isEmpty()){
progressInfo.insert("errCode", "TIMEOUT");
progressInfo.insert("errText", "Timeout");
emit fileSendProgress(progressInfo);
file.close();
return false;
}
}
file.close();
// 文件取消传输
if (d->canceled) {
QMQTT::Message req;
WitMqttFileMessage msg;
msg.uid = fileuid;
msg.state = 5;
msg.from = this->clientId();
msg.to = iTargetClientId;
req.setTopic(QString("%1/%2").arg(iTargetClientId).arg(WIT_MQTT_TOPIC_FILE));
req.setQos(1);
req.setPayload(msg.toByteArray());
this->publish(req);
progressInfo.insert("errText", "canceled");
emit fileSendProgress(progressInfo);
return false;
}
//文件传输完成
{
WitMqttFileMessage fmsg;
fmsg.uid = fileuid;
fmsg.state = 4;
fmsg.from = this->clientId();
fmsg.to = iTargetClientId;
fmsg.data = QVariantMap{};
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(fmsg.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
qmsg.setPayload(fmsg.toByteArray());
this->publish(qmsg);
WitMqttRpcEventLoop loop(fileuid, timeout);
connect(this, &WitMqttClient::fileAckReplied, &loop, &WitMqttRpcEventLoop::quit);
loop.exec();
if (!loop.data().isEmpty()){
progressInfo.insert("errCode", "TIMEOUT");
progressInfo.insert("errText", "Timeout");
emit fileSendProgress(progressInfo);
return false;
}
}
return true;
}
void WitMqttClient::setFileTempDir(const QString &iPath)
{
Q_D(WitMqttClient);
d->fileTempDir = iPath;
}
QString WitMqttClient::fileTempDir() const
{
Q_D(const WitMqttClient);
return d->fileTempDir;
}
void WitMqttClient::setFileTransPackageSize(quint64 iSize)
{
Q_D(WitMqttClient);
d->fileTransPackageSize = iSize;
}
quint64 WitMqttClient::fileTransPackageSize() const
{
Q_D(const WitMqttClient);
return d->fileTransPackageSize;
}
void WitMqttClient::setFileTransTimeout(int iTimeout)
{
Q_D(WitMqttClient);
d->fileTransTimeout = iTimeout;
}
int WitMqttClient::fileTransTimeout() const
{
Q_D(const WitMqttClient);
return d->fileTransTimeout;
}
void WitMqttClient::cancelFileTrans()
{
Q_D(WitMqttClient);
d->canceled = true;
}
void WitMqttClient::onConnected()
{
// TOP8LOG.info() << QString("client [%1] connected to mqtt broker [%2:%3].").arg(this->clientId()).arg(this->host().toString()).arg(this->port());
this->subscribe(QString("%1/%2").arg(this->clientId()).arg(WIT_MQTT_TOPIC_REQ), 1);
this->subscribe(QString("%1/%2").arg(this->clientId()).arg(WIT_MQTT_TOPIC_REP), 1);
this->subscribe(QString("%1/%2").arg(this->clientId()).arg(WIT_MQTT_TOPIC_FILE), 1);
this->subscribe(QString("%1/%2/#").arg(WIT_MQTT_TOPIC_PREFIX).arg(WIT_MQTT_TOPIC_BUS), 0);
}
void WitMqttClient::onSubscribed(const QString &iTopic, quint8 iQos)
{
Q_UNUSED(iTopic);
Q_UNUSED(iQos);
// TOP8LOG.info() << QString("client [%1] subscribed topic [%2] with qos [%3].").arg(this->clientId()).arg(iTopic).arg(iQos);
}
void WitMqttClient::onReceived(const QMQTT::Message &iMsg)
{
Q_D(WitMqttClient);
if (iMsg.topic().endsWith(WIT_MQTT_TOPIC_REQ)) {
WitMqttRpcReqMessage req(iMsg.payload());
// TOP8LOG.debug() << QString("[%1] receivce rpc request [%2].").arg(this->clientId()).arg(req.func);
emit rpcRequestReceived(req);
}
else if (iMsg.topic().endsWith(WIT_MQTT_TOPIC_REP)) {
WitMqttRpcRepMessage rep(iMsg.payload());
emit rpcResponseReceived(rep.uid, iMsg.payload());
}
else if (iMsg.topic().endsWith(WIT_MQTT_TOPIC_FILE)) {
QByteArray resp = iMsg.payload();
int idx = resp.indexOf(CRLF_SEP);
WitMqttFileMessage fmsg(idx < 0 ? resp : resp.left(idx));
//文件传输应答
if (fmsg.state == 1) {
emit fileAckReplied(fmsg.uid, "");
}
//请求开始传输文件
else if (fmsg.state == 2) {
if (d->fileMap.contains(fmsg.uid)) {
auto file = d->fileMap[fmsg.uid];
file->close();
file->remove();
delete file;
d->fileMap.remove(fmsg.uid);
delete d->fileTimer[fmsg.uid];
d->fileTimer.remove(fmsg.uid);
}
QString filepath = fmsg.data.value("target").toString();
auto file = new QFile(QDir(d->fileTempDir).absoluteFilePath(fmsg.uid), this);
file->setProperty("TARGET_PATH", filepath);
if (file->exists()) file->remove();
file->open(QFile::WriteOnly);
d->fileMap.insert(fmsg.uid, file);
auto timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, &QTimer::timeout, [=](){
if (d->fileMap.contains(fmsg.uid)) {
auto file = d->fileMap[fmsg.uid];
file->close();
file->remove();
delete file;
d->fileMap.remove(fmsg.uid);
d->fileTimer.remove(fmsg.uid);
timer->deleteLater();
QVariantMap progressInfo;
progressInfo.insert("uid", fmsg.uid);
progressInfo.insert("from", fmsg.from);
progressInfo.insert("distFile", filepath);
progressInfo.insert("errCode", "TIMEOUT");
progressInfo.insert("errText", "Timeout");
emit fileReceiveProgress(progressInfo);
}
});
d->fileTimer.insert(fmsg.uid, timer);
QVariantMap progressInfo;
progressInfo.insert("uid", fmsg.uid);
progressInfo.insert("from", fmsg.from);
progressInfo.insert("distFile", filepath);
emit fileReceiveProgress(progressInfo);
WitMqttFileMessage ack;
ack.uid = fmsg.uid;
ack.from = fmsg.to;
ack.to = fmsg.from;
ack.state = 1; //状态应答
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(ack.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
qmsg.setPayload(ack.toByteArray());
this->publish(qmsg);
timer->start(d->fileTransTimeout);
}
//文件内容传输
else if (fmsg.state == 3) {
if (d->fileMap.contains(fmsg.uid)) {
auto file = d->fileMap.value(fmsg.uid);
if (!file->isOpen()) file->open(QFile::WriteOnly);
int ridx = resp.size() - idx - SEP_LEN;
file->write(resp.right(ridx));
QVariantMap progressInfo;
progressInfo.insert("uid", fmsg.uid);
progressInfo.insert("from", fmsg.from);
progressInfo.insert("size", fmsg.data.value("size"));
progressInfo.insert("pos", fmsg.data.value("pos"));
emit fileReceiveProgress(progressInfo);
WitMqttFileMessage ack;
ack.uid = fmsg.uid;
ack.from = fmsg.to;
ack.to = fmsg.from;
ack.state = 1; //状态应答
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(ack.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
qmsg.setPayload(ack.toByteArray());
this->publish(qmsg);
d->fileTimer[fmsg.uid]->start(d->fileTransTimeout);
}
}
//文件传输完成
else if (fmsg.state == 4) {
if (d->fileMap.contains(fmsg.uid)) {
auto timer = d->fileTimer.value(fmsg.uid);
timer->stop();
delete timer;
d->fileTempDir.remove(fmsg.uid);
auto file = d->fileMap.value(fmsg.uid);
file->close();
auto filename = file->fileName();
auto targetpath = file->property("TARGET_PATH").toString();
delete file;
d->fileMap.remove(fmsg.uid);
WitMqttFileMessage ack;
ack.uid = fmsg.uid;
ack.from = fmsg.to;
ack.to = fmsg.from;
ack.state = 1; //状态应答
QMQTT::Message qmsg;
qmsg.setTopic(QString("%1/%2").arg(ack.to).arg(WIT_MQTT_TOPIC_FILE));
qmsg.setQos(1);
qmsg.setPayload(ack.toByteArray());
this->publish(qmsg);
emit fileReceiveFinished(filename, targetpath);
}
}
// 文件取消传输
else if (fmsg.state == 5) {
if (d->fileMap.contains(fmsg.uid)) {
auto timer = d->fileTimer.value(fmsg.uid);
timer->stop();
delete timer;
d->fileTempDir.remove(fmsg.uid);
auto file = d->fileMap.value(fmsg.uid);
file->remove();
delete file;
d->fileMap.remove(fmsg.uid);
}
} else {
QVariantMap err {
{"errText", "Invalid state"}
};
emit fileReceiveProgress(err);
}
}
else if (iMsg.topic().startsWith(QString("%1/%2").arg(WIT_MQTT_TOPIC_PREFIX).arg(WIT_MQTT_TOPIC_BUS))) {
emit busMessageReceived(iMsg);
}
}
#ifndef WITMQTTCLIENT_H
#define WITMQTTCLIENT_H
#include <QUuid>
#include <QDir>
#include <QEventLoop>
#include <QJsonDocument>
#include <QVariantMap>
#include "tmqtt_global.h"
#include "qmqtt/qmqtt.h"
#define WIT_MQTT_TOPIC_PREFIX "WIT"
#define WIT_MQTT_TOPIC_REQ "REQ"
#define WIT_MQTT_TOPIC_REP "REP"
#define WIT_MQTT_TOPIC_CHANNEL "CHA"
#define WIT_MQTT_TOPIC_LOG "LOG"
#define WIT_MQTT_TOPIC_BUS "BUS"
#define WIT_MQTT_TOPIC_DEVICE "DEV"
#define WIT_MQTT_TOPIC_NODE "NODE"
#define WIT_MQTT_TOPIC_FILE "FILE"
struct WitMqttRpcReqMessage {
QString uid {QUuid::createUuid().toString()}; //请求的唯一ID
QString from; //请求来源设备
QString to; //请求目标设备
QString func; //请求目标函数
QVariantMap param; //请求参数
QVariantMap toMap() const {
return QVariantMap {
{"uid", this->uid},
{"from", this->from},
{"to", this->to},
{"func", this->func},
{"param", this->param},
};
}
QByteArray toByteArray() const {
return QJsonDocument::fromVariant(this->toMap()).toJson();
}
explicit WitMqttRpcReqMessage(){}
explicit WitMqttRpcReqMessage(const QVariantMap &iData) {
this->uid = iData.value("uid").toString();
this->from = iData.value("from").toString();
this->to = iData.value("to").toString();
this->func = iData.value("func").toString();
this->param = iData.value("param").toMap();
}
explicit WitMqttRpcReqMessage(const QByteArray &iData) {
QVariantMap map = QJsonDocument::fromJson(iData).toVariant().toMap();
this->uid = map.value("uid").toString();
this->from = map.value("from").toString();
this->to = map.value("to").toString();
this->func = map.value("func").toString();
this->param = map.value("param").toMap();
}
};
struct WitMqttRpcRepMessage {
QString uid {QUuid::createUuid().toString()}; //请求的唯一ID
QString from; //回复的来源设备
QString to; //回复目标设备
QVariantMap data; //回复数据
QVariantMap toMap() const {
return QVariantMap {
{"uid", this->uid},
{"from", this->from},
{"to", this->to},
{"data", this->data},
};
}
QByteArray toByteArray() const {
return QJsonDocument::fromVariant(this->toMap()).toJson();
}
explicit WitMqttRpcRepMessage(){}
explicit WitMqttRpcRepMessage(const QVariantMap &iData) {
this->uid = iData.value("uid").toString();
this->from = iData.value("from").toString();
this->to = iData.value("to").toString();
this->data = iData.value("data").toMap();
}
explicit WitMqttRpcRepMessage(const QByteArray &iData) {
QVariantMap map = QJsonDocument::fromJson(iData).toVariant().toMap();
this->uid = map.value("uid").toString();
this->from = map.value("from").toString();
this->to = map.value("to").toString();
this->data = map.value("data").toMap();
}
};
struct WitMqttFileMessage {
QString uid {QUuid::createUuid().toString()}; //消息的唯一ID
int state {0}; //状态; 1=ACK应答; 2=请求开始传输文件; 3=文件内容传输; 4=文件传输完成; 5=取消文件传输;
QString from; //请求来源设备
QString to; //请求目标设备
QVariantMap data;
QVariantMap toMap() const {
return QVariantMap {
{"uid", this->uid},
{"from", this->from},
{"to", this->to},
{"state", this->state},
{"data", this->data},
};
}
QByteArray toByteArray() const {
return QJsonDocument::fromVariant(this->toMap()).toJson();
}
explicit WitMqttFileMessage(){}
explicit WitMqttFileMessage(const QVariantMap &iData) {
this->uid = iData.value("uid").toString();
this->from = iData.value("from").toString();
this->to = iData.value("to").toString();
this->state = iData.value("state").toInt();
this->data = iData.value("data").toMap();
}
explicit WitMqttFileMessage(const QByteArray &iData) {
QVariantMap map = QJsonDocument::fromJson(iData).toVariant().toMap();
this->uid = map.value("uid").toString();
this->from = map.value("from").toString();
this->to = map.value("to").toString();
this->state = map.value("state").toInt();
this->data = map.value("data").toMap();
}
};
class WitMqttRpcEventLoopPrivate;
class WitMqttRpcEventLoop : public QEventLoop
{
Q_OBJECT
public:
explicit WitMqttRpcEventLoop(const QString &iUid, int iTimeout, QObject *parent = nullptr);
~WitMqttRpcEventLoop();
signals:
public slots:
void quit(const QString &iUid, const QByteArray &iData);
void setUid(const QString &iUid);
QString uid() const;
QByteArray data() const;
void exec(ProcessEventsFlags flags = AllEvents);
private slots:
void onTimeout();
protected:
const QScopedPointer<WitMqttRpcEventLoopPrivate> d_ptr;
private:
Q_DISABLE_COPY(WitMqttRpcEventLoop)
Q_DECLARE_PRIVATE(WitMqttRpcEventLoop)
};
class WitMqttClientPrivate;
class TMQTTSHARED_EXPORT WitMqttClient : public QMQTT::Client
{
Q_OBJECT
public:
explicit WitMqttClient(const QString &iHost, qint16 iPort=1883, QObject *parent = nullptr);
~WitMqttClient();
signals:
void rpcRequestReceived(const WitMqttRpcReqMessage &iReq);
void rpcResponseReceived(const QString &iUid, const QByteArray &iPayload);
void busMessageReceived(const QMQTT::Message &iMsg);
void fileAckReplied(const QString &iUid, const QByteArray &iPayload);
void fileReceiveFinished(const QString &iTmpFile, const QString &iTarget);
void fileReceiveProgress(const QVariantMap &iData);
void fileSendProgress(const QVariantMap &iData);
public slots:
QVariantMap rpcRequest(const QString &iTarget, const QString &iFunc, const QVariantMap &iParam, int iTimeout=120000);
void sendRpcReply(const WitMqttRpcRepMessage &iMsg);
bool sendFile(const QString &iTargetClientId, const QString &iSrcFilePath, const QString &iTargetFileName);
void setFileTempDir(const QString &iPath);
QString fileTempDir() const;
void setFileTransPackageSize(quint64 iSize);
quint64 fileTransPackageSize() const;
void setFileTransTimeout(int iTimeout);
int fileTransTimeout() const;
void cancelFileTrans();
private slots:
void onConnected();
void onSubscribed(const QString &iTopic, quint8 iQos);
void onReceived(const QMQTT::Message &iMsg);
protected:
const QScopedPointer<WitMqttClientPrivate> d_ptr;
private:
Q_DISABLE_COPY(WitMqttClient)
Q_DECLARE_PRIVATE(WitMqttClient)
};
#endif // WITMQTTCLIENT_H
# set QTBIN
TEMPNAME = $${QMAKE_QMAKE}
QTBIN = $$dirname(TEMPNAME)
# never use foreach or Q_FOREACH
DEFINES += QT_NO_FOREACH
win32-msvc* {
# support windows xp
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
# generating pdb in release mode
# QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINGO
# QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE += /Zi
QMAKE_LFLAGS_RELEASE += /DEBUG
}
# get platform
TOPIKM_PLATFORM=$$(TOPIKM_PLATFORM)
isEmpty(TOPIKM_PLATFORM){
TOPIKM_PLATFORM=unknown
win32 {
TOPIKM_PLATFORM=win32
win32-g++ {
TOPIKM_PLATFORM=win32-mingw
}
win32-msvc2013 {
TOPIKM_PLATFORM=win32-msvc2013
}
win32-msvc2015 {
TOPIKM_PLATFORM=win32-msvc2015
}
}
macx {
TOPIKM_PLATFORM=macx
}
linux {
TOPIKM_PLATFORM=linux$$QMAKE_HOST.arch
}
}
# topikm sdk path
TOPIKM_SDKPATH=$$DIST_DIR/topikm/qt$$[QT_VERSION]-$${TOPIKM_PLATFORM}
# include topikm headers
INCLUDEPATH += $${TOPIKM_SDKPATH}/include
# support c++11
CONFIG += c++11
# debug suffix
CONFIG += debug_and_release
CONFIG(debug, debug | release) {
DESTDIR = $${TOPIKM_SDKPATH}/bin_dbg
win32 {
DEBUG_SUFFIX = d
}
macx {
DEBUG_SUFFIX = _debug
}
} else {
DESTDIR = $${TOPIKM_SDKPATH}/bin
DEBUG_SUFFIX =
}
# libs
LIBS += -L$$DESTDIR
for (lib, LIB_LIST) {
LIBS += -l$${lib}$${DEBUG_SUFFIX}
}
linux {
QMAKE_RPATHDIR += .
QMAKE_RPATHDIR += ./party3libs/pg
}
TEMPLATE = subdirs
SUBDIRS += \
lib \
# ecmabinding
CONFIG += ordered
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment