diff options
| author | Eike Ziller <eike.ziller@qt.io> | 2025-11-24 09:18:53 +0100 |
|---|---|---|
| committer | Eike Ziller <eike.ziller@qt.io> | 2025-11-24 13:03:17 +0000 |
| commit | 5876f945e4879cda2f3d9d4e76fcfd401078a781 (patch) | |
| tree | de1bdec54f5bf042ce4b82fe4b16fce955ec8eca /src/plugins/python/pythonrunconfiguration.cpp | |
| parent | 81563ffb7c4fb90f8303efd2320c180a558c9a33 (diff) | |
Python: Unify the installation option from the issues view
Makes the style of the link for installing the missing package with pip
similar to the new CMake package one in
ac901e047bff7a86c709ddb78b6ac40056d87dc1
i.e. adapt the text, make the whole line a link, and use the Task API
for setting that up.
Change-Id: I1f7b82e0e95f633a3718ebdf44897671355ae7d6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/plugins/python/pythonrunconfiguration.cpp')
| -rw-r--r-- | src/plugins/python/pythonrunconfiguration.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index a0b710f0a2b..32995b06099 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -83,17 +83,11 @@ private: } else { // The actual exception. This ends the traceback. Task exception{Task::Error, text, {}, -1, category}; - const QString detail = Tr::tr("Install %1 (requires pip)"); + const QString detail = Tr::tr("👉 Click here to install %1 (requires pip)"); const QString pySide6Text = Tr::tr("PySide6"); const QString link = QString("pysideinstall:") + QUrl::toPercentEncoding(m_python.toFSPathString()); - exception.addToDetails(detail.arg(pySide6Text)); - QTextCharFormat format; - format.setAnchor(true); - format.setAnchorHref(link); - const int offset = exception.summary().size() + detail.indexOf("%1") + 1; - exception.setFormats( - {QTextLayout::FormatRange{offset, int(pySide6Text.size()), format}}); + exception.addLinkDetail(link, detail.arg(pySide6Text)); TaskHub::addTask(exception); for (auto rit = m_tasks.crbegin(), rend = m_tasks.crend(); rit != rend; ++rit) TaskHub::addTask(*rit); |
