From b9f44867a72bcd03e2b93ea7cd18de4a70612d07 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 19 Jan 2017 10:27:05 +0100 Subject: [PATCH] Initial commit rough sketch to get started --- .gitattributes | 4 + .gitignore | 342 ++++++++++++++++++++++++++++++++ .qmake.conf | 4 + .tag | 1 + qtmqtt.pro | 6 + src/mqtt/doc/qtmqtt.qdocconf | 34 ++++ src/mqtt/doc/src/index.qdoc | 29 +++ src/mqtt/doc/src/module.qdoc | 26 +++ src/mqtt/doc/style/style.css | 137 +++++++++++++ src/mqtt/mqtt.pro | 17 ++ src/mqtt/qmqttglobal.h | 24 +++ src/src.pro | 3 + sync.profile | 7 + tests/auto/auto.pro | 2 + tests/auto/cmake/CMakeLists.txt | 14 ++ tests/auto/cmake/cmake.pro | 6 + tests/tests.pro | 2 + 17 files changed, 658 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .qmake.conf create mode 100644 .tag create mode 100644 qtmqtt.pro create mode 100644 src/mqtt/doc/qtmqtt.qdocconf create mode 100644 src/mqtt/doc/src/index.qdoc create mode 100644 src/mqtt/doc/src/module.qdoc create mode 100644 src/mqtt/doc/style/style.css create mode 100644 src/mqtt/mqtt.pro create mode 100644 src/mqtt/qmqttglobal.h create mode 100644 src/src.pro create mode 100644 sync.profile create mode 100644 tests/auto/auto.pro create mode 100644 tests/auto/cmake/CMakeLists.txt create mode 100644 tests/auto/cmake/cmake.pro create mode 100644 tests/tests.pro diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1a045fa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +.tag export-subst +.gitignore export-ignore +.gitattributes export-ignore +.commit-template export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..375501e --- /dev/null +++ b/.gitignore @@ -0,0 +1,342 @@ +# Prerequisites +*.d + +# Compiled Object files +*.o +*.ko +*.obj +*.elf +*.slo +*.lo + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Compiled Static libraries +*.a +*.la +*.lai +*.lib + +# Compiled Dynamic libraries +*.so +*.so.* +*.dll +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Qt-es + +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +qrc_*.cpp +ui_*.h +Makefile* +*build-* + +## QtCreator +*.autosave + +# QtCtreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCtreator CMake +CMakeLists.txt.user* + +## Visual Studio +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config diff --git a/.qmake.conf b/.qmake.conf new file mode 100644 index 0000000..556f554 --- /dev/null +++ b/.qmake.conf @@ -0,0 +1,4 @@ +load(qt_build_config) +CONFIG += warning_clean + +MODULE_VERSION = 5.8.0 diff --git a/.tag b/.tag new file mode 100644 index 0000000..6828f88 --- /dev/null +++ b/.tag @@ -0,0 +1 @@ +$Format:%H$ diff --git a/qtmqtt.pro b/qtmqtt.pro new file mode 100644 index 0000000..80a860c --- /dev/null +++ b/qtmqtt.pro @@ -0,0 +1,6 @@ +lessThan(QT_MAJOR_VERSION, 5) { + error("Cannot build current Qt MQTT sources with Qt version $${QT_VERSION}.") +} + +load(configure) +load(qt_parts) diff --git a/src/mqtt/doc/qtmqtt.qdocconf b/src/mqtt/doc/qtmqtt.qdocconf new file mode 100644 index 0000000..fac732a --- /dev/null +++ b/src/mqtt/doc/qtmqtt.qdocconf @@ -0,0 +1,34 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtMqtt +description = Qt MQTT Reference Documentation +version = $QT_VERSION + +qhp.projects = QtMqtt + +qhp.QtMqtt.file = qtmqtt.qhp +qhp.QtMqtt.namespace = org.qt-project.qtmqtt.$QT_VERSION_TAG +qhp.QtMqtt.virtualFolder = qtmqtt +qhp.QtMqtt.indexTitle = Qt MQTT +qhp.QtMqtt.indexRoot = + +qhp.QtMqtt.filterAttributes = qtmqtt $QT_VERSION qtrefdoc +qhp.QtMqtt.customFilters.Qt.name = QtMqtt $QT_VERSION +qhp.QtMqtt.customFilters.Qt.filterAttributes = qtmqtt $QT_VERSION + +qhp.QtMqtt.subprojects = classes + +qhp.QtMqtt.subprojects.classes.title = C++ Classes +qhp.QtMqtt.subprojects.classes.indexTitle = Qt MQTT C++ Classes +qhp.QtMqtt.subprojects.classes.selectors = class fake:headerfile +qhp.QtMqtt.subprojects.classes.sortPages = true + +headerdirs += .. +sourcedirs += .. +imagedirs += images +excludedirs += ../qt4support + +depends += qtcore qtdoc qtnetwork qmake + +navigation.landingpage = "Qt MQTT" +navigation.cppclassespage = "Qt MQTT C++ Classes" diff --git a/src/mqtt/doc/src/index.qdoc b/src/mqtt/doc/src/index.qdoc new file mode 100644 index 0000000..648db7d --- /dev/null +++ b/src/mqtt/doc/src/index.qdoc @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +****************************************************************************/ + +/*! + \page qtmqtt-index.html + \title Qt MQTT + \brief Provides an API to make MQTT programming simple and portable. + + To use these classes in your application, use the following include statement: + + \code + #include + \endcode + + To link against the module, add this line to your \l qmake \c .pro file: + + \code + QT += mqtt + \endcode + + \section1 Related Information + \list + \li \l{Qt MQTT C++ Classes}{C++ Classes} + \endlist +*/ diff --git a/src/mqtt/doc/src/module.qdoc b/src/mqtt/doc/src/module.qdoc new file mode 100644 index 0000000..bb7fcff --- /dev/null +++ b/src/mqtt/doc/src/module.qdoc @@ -0,0 +1,26 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +****************************************************************************/ + +/*! + \module QtMqtt + \title Qt MQTT C++ Classes + \ingroup modules + \qtvariable mqtt + \brief List of C++ classes that enable sending messages via the MQTT protocol. + + To use these classes in your application, use the following include statement: + + \code + #include + \endcode + + To link against the module, add this line to your \l qmake \c .pro file: + + \code + QT += mqtt + \endcode +*/ diff --git a/src/mqtt/doc/style/style.css b/src/mqtt/doc/style/style.css new file mode 100644 index 0000000..df84049 --- /dev/null +++ b/src/mqtt/doc/style/style.css @@ -0,0 +1,137 @@ +a:link, a:visited { + color: #00732F; + text-decoration: none; + font-weight: bold; +} + +body { + font: normal 400 14px/1.2 Arial; + margin-top: 85px; +} + +h1 { + margin: 0; +} + +h2 { + font: 500 20px/1.2 Arial; +} + +h3.fn, span.fn { + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + background-color: #F6F6F6; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + word-spacing: 3px; + padding: 3px 5px; +} + +table, pre { + -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; + font-size: 12px; + line-height: 1.2; + margin-bottom: 25px; + margin-left: 15px; +} + +table td { + padding: 3px 15px 3px 20px; +} + +table tr.even { + background-color: white; + color: #66666E; +} + +table tr.odd { + background-color: #F6F6F6; + color: #66666E; +} + +li { + margin-bottom: 10px; + padding-left: 12px; +} + +.cpp { + display: block; + margin: 10; + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + padding: 20px 0 20px 0; +} + +.footer { + margin-top: 50px; +} + +.memItemLeft { + padding-right: 3px; +} + +.memItemRight { + padding: 3px 15px 3px 0; +} + +.qml { + display: block; + margin: 10; + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + padding: 20px 0 20px 0; +} + +.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; +} + +.title { + background-color: white; + color: #44A51C; + font-family: Verdana; + font-size: 35px; + font-weight: normal; + left: 0; + padding-bottom: 5px; + padding-left: 16px; + padding-top: 20px; + position: absolute; + right: 0; + top: 0; +} + +.toc { + float: right; + -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 #DDD; + margin: 0 20px 10px 10px; + padding: 20px 15px 20px 20px; + height: auto; + width: 200px; +} diff --git a/src/mqtt/mqtt.pro b/src/mqtt/mqtt.pro new file mode 100644 index 0000000..004b0ab --- /dev/null +++ b/src/mqtt/mqtt.pro @@ -0,0 +1,17 @@ +TARGET = QtMqtt + +CONFIG += c++11 +QT_FOR_PRIVATE = network + +QMAKE_DOCS = $$PWD/doc/qtmqtt.qdocconf + +PUBLIC_HEADERS += \ + qmqttglobal.h + +PRIVATE_HEADERS += + +SOURCES += + +HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS + +load(qt_module) diff --git a/src/mqtt/qmqttglobal.h b/src/mqtt/qmqttglobal.h new file mode 100644 index 0000000..033f8ff --- /dev/null +++ b/src/mqtt/qmqttglobal.h @@ -0,0 +1,24 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +****************************************************************************/ + +#pragma once + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_STATIC +# if defined(QT_BUILD_MQTT_LIB) +# define Q_MQTT_EXPORT Q_DECL_EXPORT +# else +# define Q_MQTT_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_MQTT_EXPORT +#endif + +QT_END_NAMESPACE diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 0000000..a85b90c --- /dev/null +++ b/src/src.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs + +SUBDIRS = mqtt diff --git a/sync.profile b/sync.profile new file mode 100644 index 0000000..77d0e2e --- /dev/null +++ b/sync.profile @@ -0,0 +1,7 @@ +%modules = ( + "QtMqtt" => "$basedir/src/mqtt", +); + +%dependencies = ( + "qtbase" => "" +); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro new file mode 100644 index 0000000..e792a61 --- /dev/null +++ b/tests/auto/auto.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS += cmake diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt new file mode 100644 index 0000000..d89ee84 --- /dev/null +++ b/tests/auto/cmake/CMakeLists.txt @@ -0,0 +1,14 @@ + +cmake_minimum_required(VERSION 2.8) + +project(qmake_cmake_files) + +enable_testing() + +find_package(Qt5Core REQUIRED) + +include("${_Qt5CTestMacros}") + +test_module_includes( + Mqtt QMqtt +) diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro new file mode 100644 index 0000000..472f253 --- /dev/null +++ b/tests/auto/cmake/cmake.pro @@ -0,0 +1,6 @@ +# Cause make to do nothing. +TEMPLATE = subdirs + +CMAKE_QT_MODULES_UNDER_TEST = mqtt + +CONFIG += ctest_testcase diff --git a/tests/tests.pro b/tests/tests.pro new file mode 100644 index 0000000..157ef34 --- /dev/null +++ b/tests/tests.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS += auto