Merge pull request #93 from daleglass-overte/add-qt-version-numbers

Implement Qt WebEngine and Chromium versions
This commit is contained in:
Dale Glass 2022-06-21 21:20:59 +02:00 committed by GitHub
commit 53225b9a55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 194 additions and 5 deletions

View file

@ -21,7 +21,7 @@ set(CUSTOM_INTERFACE_QRC_PATHS "")
find_package(
Qt5 COMPONENTS
Gui Widgets Multimedia Network Qml Quick Script Svg
Gui Widgets Multimedia Network Qml Quick Script Svg WebEngineCore WebEngineWidgets
${PLATFORM_QT_COMPONENTS}
WebChannel WebSockets
)
@ -292,7 +292,7 @@ target_link_libraries(
${TARGET_NAME}
Qt5::Gui Qt5::Network Qt5::Multimedia Qt5::Widgets
Qt5::Qml Qt5::Quick Qt5::Script Qt5::Svg
Qt5::WebChannel
Qt5::WebChannel Qt5::WebEngineCore Qt5::WebEngineWidgets
${PLATFORM_QT_LIBRARIES}
)

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
id="svg44"
width="511.98489"
height="511.98489"
viewBox="0 0 511.98489 511.98489"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs18">
<linearGradient
xlink:href="#linearGradient4975"
id="linearGradient4633"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(231.62575,0,0,231.62472,111.11013,159.99363)"
x2="0.5565635"
x1="0.46521288"
y1="-0.67390651"
y2="0.81129867" />
<linearGradient
id="linearGradient4975">
<stop
style="stop-color:#1972e7"
offset="0"
id="stop4971" />
<stop
style="stop-color:#1969d5"
offset="1"
id="stop4973" />
</linearGradient>
<linearGradient
xlink:href="#3"
id="linearGradient1331"
x1="101.74381"
y1="33.726189"
x2="101.59915"
y2="135.466"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.7794235,0,0,3.7794067,0.00151555,0.00377865)" />
<linearGradient
id="3"
x2="1"
gradientTransform="matrix(61.286,0,0,61.286,29.399,42.333)"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
id="stop1397"
style="stop-color:#afccfb" />
<stop
offset="1"
id="stop1399"
style="stop-color:#8bb5f8" />
</linearGradient>
<linearGradient
xlink:href="#1"
id="linearGradient2962"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(94.931559,164.42687,-164.4276,94.931137,97.555991,173.61083)"
x2="1.7695541"
x1="0.018202547"
y1="-0.51170158"
y2="0.4994337" />
<linearGradient
id="1"
x2="1"
gradientTransform="matrix(25.118,43.506,-43.506,25.118,25.812,45.935)"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
id="stop3122"
style="stop-color:#659cf6" />
<stop
offset="1"
id="stop3124"
style="stop-color:#4285f4" />
</linearGradient>
<linearGradient
xlink:href="#2"
id="linearGradient2688"
x1="67.452377"
y1="40.320694"
x2="67.733002"
y2="95.25"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.7794235,0,0,3.7794067,0.00150043,0.00377865)" />
<linearGradient
id="2">
<stop
style="stop-color:#3680f0"
offset="0"
id="stop2682" />
<stop
style="stop-color:#2678ec"
offset="1"
id="stop2684" />
</linearGradient>
</defs>
<path
d="m 255.99319,255.99433 110.85049,63.99671 -110.85049,191.99385 c 141.38068,0 255.9917,-114.61051 255.9917,-255.99056 0,-46.64165 -12.53559,-90.3316 -34.33115,-127.99716 h -221.6632 z"
id="path34-4"
style="fill:url(#linearGradient1331)" />
<path
d="M 255.99054,0 C 161.2404,0 78.576848,51.513314 34.31224,128.0274 l 110.82781,191.96363 110.85049,-63.9967 V 127.99717 h 221.6632 C 433.38157,51.501975 350.72936,0 255.99054,0 Z"
id="path36-1"
style="fill:url(#linearGradient4633)" />
<path
d="m 0.00151177,255.99433 c 0,141.38005 114.60723823,255.99056 255.99168823,255.99056 L 366.84368,319.99103 255.9932,255.99433 145.14271,319.99103 34.314897,128.0274 C 12.531434,165.68239 0,209.35646 0,255.99056"
id="path38-7"
style="fill:url(#linearGradient2962)" />
<path
d="m 383.99094,255.99433 c 0,70.69003 -57.30741,127.99717 -127.99775,127.99717 -70.69034,0 -127.99773,-57.30714 -127.99773,-127.99717 0,-70.69002 57.30739,-127.99716 127.99773,-127.99716 70.69034,0 127.99775,57.30714 127.99775,127.99716"
fill="#ffffff"
id="path40" />
<path
d="m 359.99158,255.99433 c 0,57.43565 -46.56249,103.99794 -103.99839,103.99794 -57.4359,0 -103.9984,-46.56229 -103.9984,-103.99794 0,-57.43564 46.5625,-103.99793 103.9984,-103.99793 57.4359,0 103.99839,46.56229 103.99839,103.99793"
id="path42-5"
style="fill:url(#linearGradient2688)" />
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -98,6 +98,47 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
}
Item { height: 1; width: 15 }
Image {
sourceSize.width: 34
sourceSize.height: 25
source: "../../../images/about-qt.png"
MouseArea {
anchors.fill: parent
onClicked: {
About.openUrl("https://www.qt.io/");
}
}
}
RalewayRegular {
color: "white"
text: "Qt WebEngine " + About.qtWebEngineVersion
size: 12
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: 5
Image {
sourceSize.width: 25
sourceSize.height: 25
source: "../../../images/about-chromium.svg"
MouseArea {
anchors.fill: parent
onClicked: {
About.openUrl("https://www.chromium.org/");
}
}
}
RalewayRegular {
color: "white"
text: "Chromium " + About.qtChromiumVersion
size: 12
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: 5
Image {
sourceSize.width: 70
sourceSize.height: 26
@ -109,9 +150,7 @@ Rectangle {
size: 12
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: 5
Image {
sourceSize.width: 34
sourceSize.height: 25

View file

@ -16,6 +16,8 @@
#include <ui/TabletScriptingInterface.h>
#include <OffscreenQmlDialog.h>
#include <qtwebenginecoreversion.h>
#include <QWebEngineProfile>
#include "BuildInfo.h"
#include "DependencyManager.h"
@ -49,6 +51,26 @@ QString AboutUtil::getQtVersion() const {
return qVersion();
}
QString AboutUtil::getQtWebEngineVersion() const {
return QTWEBENGINECORE_VERSION_STR;
}
QString AboutUtil::getQtChromiumVersion() const {
// Qt unfortunately doesn't provide a conventient way of getting the Chromium version,
// and it seems internally it gets it from a constant specified on the compiler's command-line.
//
// It does include this constant into the default user agent though, so we can extract it from there.
QString version;
QString user_agent = QWebEngineProfile::defaultProfile()->httpUserAgent();
for(const QString & text : user_agent.split(" ")){
if(text.startsWith(QStringLiteral("Chrome/"))){
version = text.mid(QStringLiteral("Chrome/").length());
}
}
return version;
}
void AboutUtil::openUrl(const QString& url) const {
auto abboutUtilInstance = AboutUtil::getInstance();
if (!abboutUtilInstance) {

View file

@ -32,6 +32,9 @@
* @property {string} buildVersion - The build version of Interface that is currently running. <em>Read-only.</em>
* @property {string} releaseName - The release codename of the version that Interface is currently running. <em>Read-only.</em>
* @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
* @property {string} qtWebEngineVersion - The Qt WebEngine version used in Interface that is currently running. <em>Read-only.</em>
* @property {string} qtChromiumVersion - The Qt Chromium version used in Interface that is currently running. <em>Read-only.</em>
*
*
* @example <caption>Report information on the version of Interface currently running.</caption>
* print("Interface platform: " + About.platform);
@ -70,6 +73,9 @@ class AboutUtil : public QObject {
Q_PROPERTY(QString buildVersion READ getBuildVersion CONSTANT)
Q_PROPERTY(QString releaseName READ getReleaseName CONSTANT)
Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT)
Q_PROPERTY(QString qtWebEngineVersion READ getQtWebEngineVersion CONSTANT)
Q_PROPERTY(QString qtChromiumVersion READ getQtChromiumVersion CONSTANT)
public:
static AboutUtil* getInstance();
~AboutUtil() {}
@ -79,6 +85,8 @@ public:
QString getBuildVersion() const;
QString getReleaseName() const;
QString getQtVersion() const;
QString getQtWebEngineVersion() const;
QString getQtChromiumVersion() const;
public slots: