• R/O
  • SSH

libqttools: Commit

This library contains code that extends and simplifies different operations
for C++ language based programs which use Qt5 framework as well


Commit MetaInfo

Revision460ccb1e156f025db9d55e85ff73e7a4abbd0866 (tree)
Time2017-10-07 23:06:50
Authors.gusarov
Commiters.gusarov

Log Message

Added types.h, defined QByteArrayList for Qt 5.3 and before

Change Summary

Incremental Difference

diff -r eef0411c7f30 -r 460ccb1e156f include/qttools/types.hpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/qttools/types.hpp Sat Oct 07 17:06:50 2017 +0300
@@ -0,0 +1,29 @@
1+/*
2+ * @author Sergey Gusarov <laborer2008 (at) gmail.com>
3+ * @section LICENSE
4+ * This Source Code Form is subject to the terms of the Mozilla Public
5+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+ *
8+ * @section DESCRIPTION
9+ *
10+ */
11+
12+#pragma once
13+
14+#include <ctools/predef/external_headers.h>
15+
16+CT_BEGIN_EXTERNAL_HEADERS
17+# include <QByteArray>
18+# include <QtGlobal>
19+# include <QList>
20+CT_END_EXTERNAL_HEADERS
21+
22+
23+QT_BEGIN_NAMESPACE
24+
25+#if QT_VERSION < 0x050400
26+typedef QList<QByteArray> QByteArrayList;
27+#endif
28+
29+QT_END_NAMESPACE
diff -r eef0411c7f30 -r 460ccb1e156f tests/src/test_types.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/src/test_types.cpp Sat Oct 07 17:06:50 2017 +0300
@@ -0,0 +1,43 @@
1+/*
2+ * @author Sergey Gusarov <laborer2008 (at) gmail.com>
3+ * @section LICENSE
4+ * This Source Code Form is subject to the terms of the Mozilla Public
5+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+ *
8+ * @section DESCRIPTION
9+ */
10+
11+#include <qttools/types.hpp>
12+
13+CT_BEGIN_EXTERNAL_HEADERS
14+# include <QtTest>
15+CT_END_EXTERNAL_HEADERS
16+
17+#include "tests/defines.hpp"
18+#include "tests/external_headers.hpp"
19+
20+#include <ctools/unused.h>
21+
22+
23+class Types : public QObject
24+{
25+ Q_OBJECT
26+ QTT_TEST_DEFAULT_CONSTRUCTOR(Types)
27+
28+private slots:
29+ void compile();
30+};
31+
32+void Types::compile()
33+{
34+ QByteArrayList byteArrayList;
35+
36+ CT_UNUSED(byteArrayList);
37+}
38+
39+QTEST_GUILESS_MAIN(Types)
40+
41+QTT_BEGIN_TEST_EXTERNAL_HEADERS
42+# include "test_types.moc"
43+QTT_END_TEST_EXTERNAL_HEADERS
Show on old repository browser