summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2023-05-24 22:03:37 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2023-06-01 09:20:00 +0000
commit8d1bcf9eb29cb0a6dd8422a0e6b55bfecce0d170 (patch)
treeab2aff69f59453e6d9be76bf14c24dea74894438
parent4f27c8a046ca549a9d83f6f4a193df76711a4daa (diff)
Convert to cmake
There are two modules: one to generate traces at runtime, and one containing components used in the generated QML, needed to view the traces. We use add_subdirectory; there is some redundancy between the CMakeLists.txt in the subdirectories, but they are difficult to combine because of the use of per-module variables like module_dir, module_uri and module_version. We use PLUGIN_TARGET to get the backing code linked into the plugins (as was normal in Qt 5): Qt.labs.UmlQuick.Trace is a development-oriented module, generally used with temporarily-instrumented QML files, not meant for application deployment. Generated QML traces are generally viewed with the qml tool, so again it doesn't seem beneficial to have Qt.labs.UmlQuick.Sequence available in a separate backing library. Task-number: QTBUG-111946 Change-Id: Ia0f0b3bd43f64d0e0cfc67dd1e93165626a8c28b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--CMakeLists.txt5
-rw-r--r--imports/CMakeLists.txt83
-rw-r--r--imports/UmlQuick/Sequence/qmldir6
-rw-r--r--imports/UmlQuick/UmlQuick.pro12
-rw-r--r--imports/imports.pro2
-rw-r--r--src/src.pro3
-rw-r--r--src/trace/CMakeLists.txt84
-rw-r--r--src/trace/messagetrace.cpp (renamed from src/trace/qmlmessagetrace.cpp)68
-rw-r--r--src/trace/messagetrace_p.h (renamed from src/trace/qmlmessagetrace_p.h)14
-rw-r--r--src/trace/plugin.cpp55
-rw-r--r--src/trace/qmldir2
-rw-r--r--src/trace/trace.pro24
-rw-r--r--umlquick.pro2
13 files changed, 214 insertions, 146 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..b64c66b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.16)
+project(umlquick VERSION 1.0 LANGUAGES CXX)
+
+add_subdirectory(src/trace)
+add_subdirectory(imports)
diff --git a/imports/CMakeLists.txt b/imports/CMakeLists.txt
new file mode 100644
index 0000000..bdc79b2
--- /dev/null
+++ b/imports/CMakeLists.txt
@@ -0,0 +1,83 @@
+cmake_minimum_required(VERSION 3.16)
+project(sequencecomponents VERSION 1.0 LANGUAGES CXX)
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
+qt_policy(SET QTP0001 NEW)
+qt_standard_project_setup(REQUIRES 6.2)
+
+set(CMAKE_AUTOMOC ON)
+
+qt_add_qml_module(sequencecomponents
+ URI Qt.labs.UmlQuick.Sequence
+ PLUGIN_TARGET sequencecomponents
+ OUTPUT_DIRECTORY Qt/labs/UmlQuick/Sequence
+ VERSION 1.0
+ QML_FILES
+ UmlQuick/Sequence/MessageRepeated.qml
+ UmlQuick/Sequence/Message.qml
+ UmlQuick/Sequence/Return.qml
+ UmlQuick/Sequence/ObjectInstance.qml
+ UmlQuick/Sequence/UmlSequenceDiagram.qml
+ RESOURCES
+ UmlQuick/common/images/vdash5.png
+ UmlQuick/common/images/hdash5.png
+)
+
+qt_query_qml_module(sequencecomponents
+ URI module_uri
+ VERSION module_version
+ PLUGIN_TARGET module_plugin_target
+ TARGET_PATH module_target_path
+ QMLDIR module_qmldir
+ TYPEINFO module_typeinfo
+ QML_FILES module_qml_files
+ QML_FILES_DEPLOY_PATHS qml_files_deploy_paths
+ RESOURCES module_resources
+ RESOURCES_DEPLOY_PATHS resources_deploy_paths
+)
+
+cmake_path(APPEND qtlibdir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_LIBS}")
+cmake_path(APPEND qtbindir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_BINS}")
+cmake_path(APPEND qtqmldir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_QML}")
+
+cmake_path(APPEND module_dir "${qtqmldir}" "${module_target_path}")
+
+# Install the QML module backing library
+install(TARGETS sequencecomponents
+ ARCHIVE DESTINATION "${qtlibdir}"
+ LIBRARY DESTINATION "${module_dir}"
+ RUNTIME DESTINATION "${qtbindir}"
+)
+
+message(STATUS "===> ${module_uri} ${module_version} installed to ${module_dir}")
+message(STATUS " ${qml_files_deploy_paths}")
+
+# allow the installed plugin to find its backing library
+cmake_path(SET plugin2backinglibpath ${qtlibdir})
+cmake_path(RELATIVE_PATH plugin2backinglibpath BASE_DIRECTORY ${module_dir})
+set_property(
+ TARGET "${module_plugin_target}"
+ APPEND PROPERTY INSTALL_RPATH "\${ORIGIN}/${plugin2backinglibpath}"
+)
+
+# Install the QML module runtime loadable plugin
+install(TARGETS "${module_plugin_target}"
+ LIBRARY DESTINATION "${module_dir}"
+ RUNTIME DESTINATION "${module_dir}"
+)
+
+# Install the QML module meta information.
+install(FILES "${module_qmldir}" DESTINATION "${module_dir}")
+install(FILES "${module_typeinfo}" DESTINATION "${module_dir}")
+
+# Install QML files, possibly renamed.
+foreach(src_file deploy_path IN ZIP_LISTS qml_files_deploy_paths qml_files_deploy_paths)
+ get_filename_component(dst_name "${deploy_path}" NAME)
+ install(FILES "${src_file}" DESTINATION "${module_dir}" RENAME "${dst_name}")
+endforeach()
+
+# Install resources, possibly renamed.
+foreach(src_file deploy_path IN ZIP_LISTS module_resources resources_deploy_paths)
+ get_filename_component(dst_name "${deploy_path}" NAME)
+ install(FILES "${src_file}" DESTINATION "${module_dir}" RENAME "${dst_name}")
+endforeach()
diff --git a/imports/UmlQuick/Sequence/qmldir b/imports/UmlQuick/Sequence/qmldir
deleted file mode 100644
index 72dd5a2..0000000
--- a/imports/UmlQuick/Sequence/qmldir
+++ /dev/null
@@ -1,6 +0,0 @@
-UmlSequenceDiagram 1.0 UmlSequenceDiagram.qml
-ObjectInstance 1.0 ObjectInstance.qml
-Message 1.0 Message.qml
-MessageRepeated 1.0 MessageRepeated.qml
-Return 1.0 Return.qml
-
diff --git a/imports/UmlQuick/UmlQuick.pro b/imports/UmlQuick/UmlQuick.pro
deleted file mode 100644
index 5c6ff7b..0000000
--- a/imports/UmlQuick/UmlQuick.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = aux
-TARGETPATH = Qt/labs
-IMPORT_VERSION = 1.0
-
-sequence.files = Sequence/*.qml Sequence/qmldir
-sequence.path = $$[QT_INSTALL_QML]/$$TARGETPATH/UmlQuick/Sequence/
-
-images.files = common/images/*
-images.path = $$[QT_INSTALL_QML]/$$TARGETPATH/UmlQuick/common/images/
-
-OTHER_FILES += Sequence/*.qml
-INSTALLS += images sequence
diff --git a/imports/imports.pro b/imports/imports.pro
deleted file mode 100644
index 6ef674c..0000000
--- a/imports/imports.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = UmlQuick
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644
index 2018864..0000000
--- a/src/src.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- trace
diff --git a/src/trace/CMakeLists.txt b/src/trace/CMakeLists.txt
new file mode 100644
index 0000000..38ba6e9
--- /dev/null
+++ b/src/trace/CMakeLists.txt
@@ -0,0 +1,84 @@
+cmake_minimum_required(VERSION 3.16)
+project(trace VERSION 1.0 LANGUAGES CXX)
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
+qt_policy(SET QTP0001 NEW)
+qt_standard_project_setup(REQUIRES 6.2)
+
+set(CMAKE_AUTOMOC ON)
+
+qt_add_qml_module(trace
+ URI Qt.labs.UmlQuick.Trace
+ PLUGIN_TARGET trace
+ OUTPUT_DIRECTORY Qt/labs/UmlQuick/Trace
+ VERSION 1.0
+ SOURCES
+ messagetrace.cpp messagetrace_p.h
+)
+
+target_link_libraries(trace PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Quick
+ Qt::QuickPrivate
+)
+
+qt_query_qml_module(trace
+ URI module_uri
+ VERSION module_version
+ PLUGIN_TARGET module_plugin_target
+ TARGET_PATH module_target_path
+ QMLDIR module_qmldir
+ TYPEINFO module_typeinfo
+ QML_FILES module_qml_files
+ QML_FILES_DEPLOY_PATHS qml_files_deploy_paths
+ RESOURCES module_resources
+ RESOURCES_DEPLOY_PATHS resources_deploy_paths
+)
+
+cmake_path(APPEND qtlibdir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_LIBS}")
+cmake_path(APPEND qtbindir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_BINS}")
+cmake_path(APPEND qtqmldir "${QT6_INSTALL_PREFIX}" "${QT6_INSTALL_QML}")
+
+cmake_path(APPEND module_dir "${qtqmldir}" "${module_target_path}")
+
+# Install the QML module backing library
+install(TARGETS trace
+ ARCHIVE DESTINATION "${qtlibdir}"
+ LIBRARY DESTINATION "${module_dir}"
+ RUNTIME DESTINATION "${qtbindir}"
+)
+
+message(STATUS "===> ${module_uri} ${module_version} installed to ${module_dir}")
+
+# allow the installed plugin to find its backing library
+cmake_path(SET plugin2backinglibpath ${qtlibdir})
+cmake_path(RELATIVE_PATH plugin2backinglibpath BASE_DIRECTORY ${module_dir})
+set_property(
+ TARGET "${module_plugin_target}"
+ APPEND PROPERTY INSTALL_RPATH "\${ORIGIN}/${plugin2backinglibpath}"
+)
+
+# Install the QML module runtime loadable plugin
+install(TARGETS "${module_plugin_target}"
+ LIBRARY DESTINATION "${module_dir}"
+ RUNTIME DESTINATION "${module_dir}"
+)
+
+# Install the QML module meta information.
+install(FILES "${module_qmldir}" DESTINATION "${module_dir}")
+install(FILES "${module_typeinfo}" DESTINATION "${module_dir}")
+
+# Install QML files, possibly renamed.
+foreach(src_file deploy_path IN ZIP_LISTS qml_files_deploy_paths qml_files_deploy_paths)
+ get_filename_component(dst_name "${deploy_path}" NAME)
+ get_filename_component(dest_dir "${deploy_path}" DIRECTORY)
+ install(FILES "${src_file}" DESTINATION "${module_dir}/${dest_dir}" RENAME "${dst_name}")
+endforeach()
+
+# Install resources, possibly renamed.
+foreach(src_file deploy_path IN ZIP_LISTS module_resources resources_deploy_paths)
+ get_filename_component(dst_name "${deploy_path}" NAME)
+ get_filename_component(dest_dir "${deploy_path}" DIRECTORY)
+ install(FILES "${src_file}" DESTINATION "${module_dir}/${dest_dir}" RENAME "${dst_name}")
+endforeach()
diff --git a/src/trace/qmlmessagetrace.cpp b/src/trace/messagetrace.cpp
index 3e9eeb0..781f352 100644
--- a/src/trace/qmlmessagetrace.cpp
+++ b/src/trace/messagetrace.cpp
@@ -36,7 +36,7 @@
****************************************************************************/
-#include "qmlmessagetrace_p.h"
+#include "messagetrace_p.h"
#include <QCoreApplication>
#include <QDateTime>
#include <QDebug>
@@ -45,10 +45,10 @@
#include <private/qobject_p.h>
/*!
- \class QmlMessageTrace
+ \class MessageTrace
\inmodule UmlQuick
- \brief The QmlMessageTrace class provides an output stream for rendering
+ \brief The MessageTrace class provides an output stream for rendering
a UML \l {https://en.wikipedia.org/wiki/Sequence_diagram}{Sequence diagram}
(also known as a Message Trace diagram). The outputFormat property specifies
what syntax to use for that.
@@ -152,17 +152,17 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-QHash<QByteArray, QList<QmlMessageTrace*> > QmlMessageTrace::m_categoryInstances;
-QtMessageHandler QmlMessageTrace::m_parentMessageHandler(nullptr);
-QHash<void*, QObject*> QmlMessageTrace::m_objects;
+QHash<QByteArray, QList<MessageTrace*> > MessageTrace::m_categoryInstances;
+QtMessageHandler MessageTrace::m_parentMessageHandler(nullptr);
+QHash<void*, QObject*> MessageTrace::m_objects;
// Regex for stuff like QQuickMouseArea(0x16b9cf0, name="outerMA", parent=0x16fc070, geometry=0,0 100x400)
// Captures only the part outside parentheses and the part inside
-QRegularExpression QmlMessageTrace::m_regexObjectFormatted(QStringLiteral(
+QRegularExpression MessageTrace::m_regexObjectFormatted(QStringLiteral(
"([\\w_]+)\\((.+)\\)"));
// Regex for pointers like 0x16ec750
-QRegularExpression QmlMessageTrace::m_regexPointer(QStringLiteral(
+QRegularExpression MessageTrace::m_regexPointer(QStringLiteral(
"0[xX]([0-9a-fA-F]+)"));
static const double BacktraceContinuationTimeLimit = 0.01;
@@ -183,7 +183,7 @@ static QString pointerHash(void* ptr)
return QLatin1String(ret);
}
-QString QmlMessageTrace::objectId(void *obj)
+QString MessageTrace::objectId(void *obj)
{
QString ret;
QObject *qo = m_objects.value(obj);
@@ -201,13 +201,13 @@ QString QmlMessageTrace::objectId(void *obj)
return ret;
}
-void QmlMessageTrace::messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &text)
+void MessageTrace::messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &text)
{
bool consumed = false;
if (m_categoryInstances.contains(context.category)) {
- QList<QmlMessageTrace *> instances = m_categoryInstances.value(context.category);
+ QList<MessageTrace *> instances = m_categoryInstances.value(context.category);
QString formatted = qFormatLogMessage(type, context, text);
- for (QmlMessageTrace *tracer : instances) {
+ for (MessageTrace *tracer : instances) {
tracer->log(type, context, formatted);
consumed = true;
}
@@ -217,7 +217,7 @@ void QmlMessageTrace::messageHandler(QtMsgType type, const QMessageLogContext &c
m_parentMessageHandler(type, context, text);
}
-QmlMessageTrace::QmlMessageTrace()
+MessageTrace::MessageTrace()
: QObject()
, m_previousTimestamp(0)
, m_enabled(true)
@@ -225,7 +225,7 @@ QmlMessageTrace::QmlMessageTrace()
, m_outputPrefix("messagetrace")
{
if (qEnvironmentVariableIsSet("QT_MESSAGE_PATTERN")) {
- qFatal("please unset the QT_MESSAGE_PATTERN env variable before trying to use QmlMessageTrace");
+ qFatal("please unset the QT_MESSAGE_PATTERN env variable before trying to use MessageTrace");
QCoreApplication::exit(-1);
}
qSetMessagePattern(QStringLiteral("%{time process}|%{backtrace depth=20}|%{message}"));
@@ -236,7 +236,7 @@ QmlMessageTrace::QmlMessageTrace()
});
}
-void QmlMessageTrace::setCategory(QString cat)
+void MessageTrace::setCategory(QString cat)
{
QByteArray category = cat.toUtf8();
if (m_category == category)
@@ -244,7 +244,7 @@ void QmlMessageTrace::setCategory(QString cat)
if (m_categoryInstances.isEmpty()) {
// first-use init
- QLoggingCategory::installFilter(&QmlMessageTrace::categoryFilter);
+ QLoggingCategory::installFilter(&MessageTrace::categoryFilter);
}
if (m_categoryInstances.contains(m_category))
@@ -252,7 +252,7 @@ void QmlMessageTrace::setCategory(QString cat)
if (m_categoryInstances.contains(category))
m_categoryInstances[category].append(this);
else
- m_categoryInstances.insert(category, QList<QmlMessageTrace *>() << this);
+ m_categoryInstances.insert(category, QList<MessageTrace *>() << this);
if (!m_parentMessageHandler) {
m_parentMessageHandler = qInstallMessageHandler(messageHandler);
}
@@ -261,7 +261,7 @@ void QmlMessageTrace::setCategory(QString cat)
emit categoryChanged();
}
-void QmlMessageTrace::setOutputPrefix(QString outputPrefix)
+void MessageTrace::setOutputPrefix(QString outputPrefix)
{
if (m_outputPrefix == outputPrefix)
return;
@@ -270,7 +270,7 @@ void QmlMessageTrace::setOutputPrefix(QString outputPrefix)
emit outputPrefixChanged();
}
-void QmlMessageTrace::setEnabled(bool enabled)
+void MessageTrace::setEnabled(bool enabled)
{
if (m_enabled == enabled)
return;
@@ -281,12 +281,12 @@ void QmlMessageTrace::setEnabled(bool enabled)
emit enabledChanged();
}
-QmlMessageTrace::OutputFormat QmlMessageTrace::outputFormat() const
+MessageTrace::OutputFormat MessageTrace::outputFormat() const
{
return m_outputFormat;
}
-void QmlMessageTrace::setOutputFormat(OutputFormat fmt)
+void MessageTrace::setOutputFormat(OutputFormat fmt)
{
if (m_outputFormat == fmt)
return;
@@ -295,7 +295,7 @@ void QmlMessageTrace::setOutputFormat(OutputFormat fmt)
emit outputFormatChanged();
}
-void QmlMessageTrace::categoryFilter(QLoggingCategory *cat)
+void MessageTrace::categoryFilter(QLoggingCategory *cat)
{
if (m_categoryInstances.contains(cat->categoryName())) {
cat->setEnabled(QtDebugMsg, true);
@@ -306,7 +306,7 @@ void QmlMessageTrace::categoryFilter(QLoggingCategory *cat)
//MT_DEBUG("%s %d\n", cat->categoryName(), cat->isDebugEnabled());
}
-QString QmlMessageTrace::category() const
+QString MessageTrace::category() const
{
return QString::fromUtf8(m_category);
}
@@ -325,7 +325,7 @@ static void * stringToPointer(const QString &str) {
return ret;
}
-void QmlMessageTrace::parseClassAndMethod(const QString &classAndMethod, QString &className, QString &methodName)
+void MessageTrace::parseClassAndMethod(const QString &classAndMethod, QString &className, QString &methodName)
{
int scopingIdx = classAndMethod.indexOf(QStringLiteral("::"));
if (scopingIdx >= 0) {
@@ -341,7 +341,7 @@ void QmlMessageTrace::parseClassAndMethod(const QString &classAndMethod, QString
}
}
-void QmlMessageTrace::addObjectInstance(void *obj, const QString &objClass)
+void MessageTrace::addObjectInstance(void *obj, const QString &objClass)
{
QString id = obj ? pointerHash(obj) : QStringLiteral("ufo_") + objClass;
m_tracedObjectsById.insert(id, objClass);
@@ -355,7 +355,7 @@ void QmlMessageTrace::addObjectInstance(void *obj, const QString &objClass)
}
}
-void QmlMessageTrace::writeObjectInstanceQml(QFile &f, QObject *o)
+void MessageTrace::writeObjectInstanceQml(QFile &f, QObject *o)
{
if (!o)
return;
@@ -373,7 +373,7 @@ void QmlMessageTrace::writeObjectInstanceQml(QFile &f, QObject *o)
.arg(pointerHash(o)).arg(oName).arg(className).toUtf8());
}
-void QmlMessageTrace::writeObjectInstancePuml(QFile &f, QObject *o)
+void MessageTrace::writeObjectInstancePuml(QFile &f, QObject *o)
{
if (!o)
return;
@@ -394,7 +394,7 @@ void QmlMessageTrace::writeObjectInstancePuml(QFile &f, QObject *o)
.arg(className).arg(oName).toUtf8());
}
-void QmlMessageTrace::logBacktrace(QStringList trace)
+void MessageTrace::logBacktrace(QStringList trace)
{
if (trace.length() < 2)
return;
@@ -413,7 +413,7 @@ void QmlMessageTrace::logBacktrace(QStringList trace)
m_messages.append(m);
}
-void QmlMessageTrace::log(QtMsgType type, const QMessageLogContext &context, const QString &rawText)
+void MessageTrace::log(QtMsgType type, const QMessageLogContext &context, const QString &rawText)
{
if (type != QtDebugMsg)
return; // so far we don't handle warning and critical
@@ -553,7 +553,7 @@ void QmlMessageTrace::log(QtMsgType type, const QMessageLogContext &context, con
}
-void QmlMessageTrace::write()
+void MessageTrace::write()
{
QString filePath = m_outputPrefix + QDateTime::currentDateTime().toString(Qt::ISODate);
switch (m_outputFormat) {
@@ -566,7 +566,7 @@ void QmlMessageTrace::write()
}
}
-void QmlMessageTrace::writeQml(const QString &plainFilePath)
+void MessageTrace::writeQml(const QString &plainFilePath)
{
QString filePath = plainFilePath + u".qml"_s;
MT_DEBUG("-> %s\n", qPrintable(filePath));
@@ -607,7 +607,7 @@ void QmlMessageTrace::writeQml(const QString &plainFilePath)
}
}
-void QmlMessageTrace::writePuml(const QString &plainFilePath)
+void MessageTrace::writePuml(const QString &plainFilePath)
{
QString filePath = plainFilePath + u".puml"_s;
MT_DEBUG("-> %s\n", qPrintable(filePath));
@@ -648,7 +648,7 @@ void QmlMessageTrace::writePuml(const QString &plainFilePath)
}
}
-QString QmlMessageTrace::Message::toQml() const
+QString MessageTrace::Message::toQml() const
{
QString callerId = callerPointer ? pointerHash(callerPointer) : QStringLiteral("ufo_") + callerClass;
return QStringLiteral(
@@ -669,7 +669,7 @@ QString QmlMessageTrace::Message::toQml() const
Alice <-- Bob: Another authentication Response
@enduml
*/
-QString QmlMessageTrace::Message::toPuml() const
+QString MessageTrace::Message::toPuml() const
{
QString callerId = callerPointer ? objectId(callerPointer) : QStringLiteral("ufo_") + callerClass;
QString calleeId = calleePointer ? objectId(calleePointer) : QStringLiteral("ufo_") + calleeClass;
diff --git a/src/trace/qmlmessagetrace_p.h b/src/trace/messagetrace_p.h
index 3ca6a1d..44c6cfc 100644
--- a/src/trace/qmlmessagetrace_p.h
+++ b/src/trace/messagetrace_p.h
@@ -36,23 +36,25 @@
****************************************************************************/
-#ifndef QMLMESSAGETRACE_H
-#define QMLMESSAGETRACE_H
+#ifndef MESSAGETRACE_H
+#define MESSAGETRACE_H
#include <QFile>
#include <QHash>
#include <QLoggingCategory>
#include <QRegularExpression>
+#include <QQmlEngine>
QT_BEGIN_NAMESPACE
-class QmlMessageTrace : public QObject
+class MessageTrace : public QObject
{
Q_OBJECT
Q_PROPERTY(QString category READ category WRITE setCategory NOTIFY categoryChanged)
Q_PROPERTY(QString outputPrefix READ outputPrefix WRITE setOutputPrefix NOTIFY outputPrefixChanged)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(OutputFormat outputFormat READ outputFormat WRITE setOutputFormat NOTIFY outputFormatChanged)
+ QML_ELEMENT
public:
enum class OutputFormat {
@@ -61,7 +63,7 @@ public:
};
Q_ENUM(OutputFormat)
- QmlMessageTrace();
+ MessageTrace();
QString category() const;
void setCategory(QString category);
@@ -114,7 +116,7 @@ private:
QString toPuml() const;
};
- static QHash<QByteArray, QList<QmlMessageTrace*> > m_categoryInstances;
+ static QHash<QByteArray, QList<MessageTrace*> > m_categoryInstances;
static QtMessageHandler m_parentMessageHandler;
static QRegularExpression m_regexObjectFormatted;
@@ -137,4 +139,4 @@ private:
QT_END_NAMESPACE
-#endif // QMLMESSAGETRACE_H
+#endif // MESSAGETRACE_H
diff --git a/src/trace/plugin.cpp b/src/trace/plugin.cpp
deleted file mode 100644
index 0ae90b2..0000000
--- a/src/trace/plugin.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Shawn Rutledge
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Labs UmlQuick project.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <QtQml>
-
-#include "qmlmessagetrace_p.h"
-
-class TracePlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-
-public:
- void registerTypes(const char *uri)
- {
- qmlRegisterType<QmlMessageTrace>(uri, 1, 0, "MessageTrace");
- }
-};
-
-#include "plugin.moc"
diff --git a/src/trace/qmldir b/src/trace/qmldir
deleted file mode 100644
index 7cbebbb..0000000
--- a/src/trace/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module Qt.labs.UmlQuick.Trace
-plugin trace
diff --git a/src/trace/trace.pro b/src/trace/trace.pro
deleted file mode 100644
index fac422e..0000000
--- a/src/trace/trace.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-TEMPLATE = lib
-TARGET = trace
-
-QT += quick core_private
-
-CONFIG += qt plugin
-
-SOURCES += \
- plugin.cpp \
- qmlmessagetrace.cpp
-
-HEADERS += \
- qmlmessagetrace_p.h
-
-TARGETPATH = Qt/labs/UmlQuick/Trace
-
-OTHER_FILES = qmldir
-
-target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
-
-qmldir.files = qmldir
-qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
-
-INSTALLS = target qmldir
diff --git a/umlquick.pro b/umlquick.pro
deleted file mode 100644
index 856d402..0000000
--- a/umlquick.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += src imports