summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/messagehandlermodel.cpp9
-rw-r--r--qt-models/messagehandlermodel.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/qt-models/messagehandlermodel.cpp b/qt-models/messagehandlermodel.cpp
index be077a1a3..78497f5bc 100644
--- a/qt-models/messagehandlermodel.cpp
+++ b/qt-models/messagehandlermodel.cpp
@@ -51,6 +51,15 @@ void MessageHandlerModel::addLog(QtMsgType type, const QString& message)
#endif
}
+const QString MessageHandlerModel::logAsString()
+{
+ QString copyString;
+
+ // Loop through m_data and build big string to be put on the clipboard
+ for(const MessageData &data: m_data)
+ copyString += data.message + "\n";
+ return copyString;
+}
QVariant MessageHandlerModel::data(const QModelIndex& idx, int role) const
{
switch(role) {
diff --git a/qt-models/messagehandlermodel.h b/qt-models/messagehandlermodel.h
index b59a4eca3..3addee95f 100644
--- a/qt-models/messagehandlermodel.h
+++ b/qt-models/messagehandlermodel.h
@@ -14,6 +14,7 @@ public:
QVariant data(const QModelIndex& idx, int role) const override;
QHash<int, QByteArray> roleNames() const override;
void addLog(QtMsgType type, const QString& message);
+ const QString logAsString();
/* call this to clear the debug data */
Q_INVOKABLE void reset();