9#ifndef MCRL2_UTILITIES_QT_TOOL_H
10#define MCRL2_UTILITIES_QT_TOOL_H
14#include <QApplication>
16#include <QDesktopServices>
29#ifdef MCRL2_PLATFORM_WINDOWS
55 HelpMenu(QMainWindow* window,
const std::string& name,
const std::string& author,
const std::string& description,
const std::string& manualUrl):
56 QMenu(window->menuBar()),
58 m_name(QString::fromStdString(name)),
59 m_author(QString::fromStdString(author)),
89 description.replace(
"\n",
"<br>");
91 message +=
"<h1>" +
m_name +
"</h1>";
92 message +=
"<p>" + description +
"</p>";
93 message +=
"<p>Written by " +
m_author +
"</p>";
95 message +=
"<p>Version: " + version +
"</p>";
101void myMessageOutput(QtMsgType type,
const QMessageLogContext &context,
const QString &msg)
103 QByteArray localMsg = msg.toLocal8Bit();
106 fprintf(stderr,
"Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
109 fprintf(stderr,
"Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
112 fprintf(stderr,
"Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
115 fprintf(stderr,
"Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
118 fprintf(stderr,
"Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
123template <
typename Tool>
135 const std::string& author,
136 const std::string& what_is,
137 const std::string& tool_description,
138 const std::string& about_description,
139 const std::string& manual_url,
140 std::string known_issues =
""
142 : Tool(name, author, what_is, tool_description, known_issues),
152#ifdef MCRL2_PLATFORM_WINDOWS
153 if (GetConsoleWindow() == 0)
155 if (AttachConsole(ATTACH_PARENT_PROCESS) == 0)
163 return Tool::execute(argc, argv);
168#ifdef MCRL2_PLATFORM_WINDOWS
170 qputenv(
"QT_QPA_PLATFORM",
"windows:darkmode=0");
180 m_application = std::unique_ptr<QApplication>(
new QApplication(argc, argv));
181#ifdef MCRL2_PLATFORM_WINDOWS
195 window.menuBar()->addAction(menu.menuAction());
196 window.menuBar()->setNativeMenuBar(
true);
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
std::string get_toolset_version()
Get the toolset revision.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...