mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-09 20:42:47 +01:00
f9d2c9ca1b
Change Qt version to 5.15 for better qdoc analysis Remove no longer used fixWindowsPath function
137 lines
13 KiB
HTML
137 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<!-- util.cpp -->
|
|
<title>Util Class | ScreenPlay</title>
|
|
<link rel="stylesheet" type="text/css" href="../css/style.css"/> <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
|
|
</head>
|
|
<body>
|
|
<div class="container-fullwidth nav"><div class="container navWrapper"><a href="../index.html"><span class="logo">ScreenPlay Generated Docs </span></a><span class="navHome"><a href="../index.html">Home</a></span></div></div> <div id= mainWrapper class="wrapper container ">
|
|
<li>Util</li>
|
|
<div class="sidebar">
|
|
<div class="toc">
|
|
<h3><a name="toc">Contents</a></h3>
|
|
<ul>
|
|
<li class="level1"><a href="#public-functions">Public Functions</a></li>
|
|
<li class="level1"><a href="#public-slots">Public Slots</a></li>
|
|
<li class="level1"><a href="#signals">Signals</a></li>
|
|
<li class="level1"><a href="#details">Detailed Description</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="sidebar-content" id="sidebar-content"></div></div>
|
|
<h1 class="title">Util Class</h1>
|
|
<span class="small-subtitle">class <a href="screenplay.html">ScreenPlay</a>::Util</span>
|
|
<!-- $$$Util-brief -->
|
|
<p>Easy to use global object to use when certain functionality is not available in QML. <a href="#details">More...</a></p>
|
|
<!-- @@@Util -->
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Util></span>
|
|
</td></tr></table></div><ul>
|
|
<li><a href="screenplay-util-members.html">List of all members, including inherited members</a></li>
|
|
</ul>
|
|
<a name="public-functions"></a>
|
|
<h2 id="public-functions">Public Functions</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#Util">Util</a></b>(QNetworkAccessManager *<i>networkAccessManager</i>, QObject *<i>parent</i> = nullptr)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> ScreenPlay::Util::AquireFFMPEGStatus </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#aquireFFMPEGStatus-prop">aquireFFMPEGStatus</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#debugMessages-prop">debugMessages</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#ffmpegAvailable-prop">ffmpegAvailable</a></b>() const</td></tr>
|
|
</table></div>
|
|
<a name="public-slots"></a>
|
|
<h2 id="public-slots">Public Slots</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#copyToClipboard">copyToClipboard</a></b>(const QString &<i>text</i>) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#downloadFFMPEG">downloadFFMPEG</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#generateRandomString">generateRandomString</a></b>(quint32 <i>length</i> = 32)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#getVersionNumberFromString">getVersionNumberFromString</a></b>(<i>const QString &</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#logToGui">logToGui</a></b>(QtMsgType <i>type</i>, const QMessageLogContext &<i>context</i>, const QString &<i>msg</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#openFolderInExplorer">openFolderInExplorer</a></b>(const QString &<i>url</i>) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#openJsonFileToObject">openJsonFileToObject</a></b>(<i>const QString &</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#openJsonFileToString">openJsonFileToString</a></b>(<i>const QString &</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#parseQByteArrayToQJsonObject">parseQByteArrayToQJsonObject</a></b>(<i>const QByteArray &</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#requestAllLicenses">requestAllLicenses</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#requestDataProtection">requestDataProtection</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#toString">toString</a></b>(const QStringList &<i>list</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#writeJsonObjectToFile">writeJsonObjectToFile</a></b>(const QString &<i>absoluteFilePath</i>, const QJsonObject &<i>object</i>, bool <i>truncate</i> = true)</td></tr>
|
|
</table></div>
|
|
<a name="signals"></a>
|
|
<h2 id="signals">Signals</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#aquireFFMPEGStatus-prop">aquireFFMPEGStatusChanged</a></b>(ScreenPlay::Util::AquireFFMPEGStatus <i>aquireFFMPEGStatus</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#debugMessages-prop">debugMessagesChanged</a></b>(QString <i>debugMessages</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#ffmpegAvailable-prop">ffmpegAvailableChanged</a></b>(bool <i>ffmpegAvailable</i>)</td></tr>
|
|
</table></div>
|
|
<a name="details"></a>
|
|
<!-- $$$Util-description -->
|
|
<div class="descr">
|
|
<h2 id="details">Detailed Description</h2>
|
|
</div>
|
|
<!-- @@@Util -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$Util[overload1]$$$UtilQNetworkAccessManager*QObject* -->
|
|
<h3 class="fn" id="Util"><a name="Util"></a>Util::<span class="name">Util</span>(<span class="type">QNetworkAccessManager</span> *<i>networkAccessManager</i>, <span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
|
|
<p>Constructor.</p>
|
|
<!-- @@@Util -->
|
|
<!-- $$$copyToClipboard[overload1]$$$copyToClipboardconstQString& -->
|
|
<h3 class="fn" id="copyToClipboard"><a name="copyToClipboard"></a><code>[slot] </code><span class="type">void</span> Util::<span class="name">copyToClipboard</span>(const <span class="type">QString</span> &<i>text</i>) const</h3>
|
|
<p>Copies the given string to the clipboard.</p>
|
|
<!-- @@@copyToClipboard -->
|
|
<!-- $$$downloadFFMPEG[overload1]$$$downloadFFMPEG -->
|
|
<h3 class="fn" id="downloadFFMPEG"><a name="downloadFFMPEG"></a><code>[slot] </code><span class="type">void</span> Util::<span class="name">downloadFFMPEG</span>()</h3>
|
|
<p>Downloads and extracts ffmpeg static version from https://ffmpeg.zeranoe.com The progress is tracked via setAquireFFMPEGStatus(AquireFFMPEGStatus);</p>
|
|
<!-- @@@downloadFFMPEG -->
|
|
<!-- $$$generateRandomString[overload1]$$$generateRandomStringquint32 -->
|
|
<h3 class="fn" id="generateRandomString"><a name="generateRandomString"></a><code>[static slot] </code><span class="type">QString</span> Util::<span class="name">generateRandomString</span>(<span class="type">quint32</span> <i>length</i> = 32)</h3>
|
|
<p>Generates a (non secure) random string with the default length of 32. Can contain:</p>
|
|
<ul>
|
|
<li>A-Z</li>
|
|
<li>a-z</li>
|
|
<li>0-9</li>
|
|
</ul>
|
|
<!-- @@@generateRandomString -->
|
|
<!-- $$$getVersionNumberFromString[overload1]$$$getVersionNumberFromStringconstQString& -->
|
|
<h3 class="fn" id="getVersionNumberFromString"><a name="getVersionNumberFromString"></a><code>[static slot] </code><span class="type">int</span> Util::<span class="name">getVersionNumberFromString</span>(<i>const QString &</i>)</h3>
|
|
<p>Parses a version from a given QString. The QString must be looke like this: 1.0.0 - Major.Minor.Patch. A fixed position is used for parsing (at 0,2,4). Return std::nullopt when not successful.</p>
|
|
<!-- @@@getVersionNumberFromString -->
|
|
<!-- $$$logToGui[overload1]$$$logToGuiQtMsgTypeconstQMessageLogContext&constQString& -->
|
|
<h3 class="fn" id="logToGui"><a name="logToGui"></a><code>[static slot] </code><span class="type">void</span> Util::<span class="name">logToGui</span>(<span class="type">QtMsgType</span> <i>type</i>, const <span class="type">QMessageLogContext</span> &<i>context</i>, const <span class="type">QString</span> &<i>msg</i>)</h3>
|
|
<p>Basic logging to the GUI. No logging is done to a log file for now. This string can be copied in the settings tab in the UI.</p>
|
|
<!-- @@@logToGui -->
|
|
<!-- $$$openFolderInExplorer[overload1]$$$openFolderInExplorerconstQString& -->
|
|
<h3 class="fn" id="openFolderInExplorer"><a name="openFolderInExplorer"></a><code>[slot] </code><span class="type">void</span> Util::<span class="name">openFolderInExplorer</span>(const <span class="type">QString</span> &<i>url</i>) const</h3>
|
|
<p>Opens a native folder window on the given path. Windows and Mac only for now!</p>
|
|
<!-- @@@openFolderInExplorer -->
|
|
<!-- $$$openJsonFileToObject[overload1]$$$openJsonFileToObjectconstQString& -->
|
|
<h3 class="fn" id="openJsonFileToObject"><a name="openJsonFileToObject"></a><code>[static slot] </code><span class="type">int</span> Util::<span class="name">openJsonFileToObject</span>(<i>const QString &</i>)</h3>
|
|
<p>Opens a json file (absolute path) and tries to convert it to a QJsonObject. Returns std::nullopt when not successful.</p>
|
|
<!-- @@@openJsonFileToObject -->
|
|
<!-- $$$openJsonFileToString[overload1]$$$openJsonFileToStringconstQString& -->
|
|
<h3 class="fn" id="openJsonFileToString"><a name="openJsonFileToString"></a><code>[static slot] </code><span class="type">int</span> Util::<span class="name">openJsonFileToString</span>(<i>const QString &</i>)</h3>
|
|
<p>Opens a json file (absolute path) and tries to convert it to a QString. Returns std::nullopt when not successful.</p>
|
|
<!-- @@@openJsonFileToString -->
|
|
<!-- $$$parseQByteArrayToQJsonObject[overload1]$$$parseQByteArrayToQJsonObjectconstQByteArray& -->
|
|
<h3 class="fn" id="parseQByteArrayToQJsonObject"><a name="parseQByteArrayToQJsonObject"></a><code>[static slot] </code><span class="type">int</span> Util::<span class="name">parseQByteArrayToQJsonObject</span>(<i>const QByteArray &</i>)</h3>
|
|
<p>Parses a QByteArray to a QJsonObject. If returns and std::nullopt on failure.</p>
|
|
<!-- @@@parseQByteArrayToQJsonObject -->
|
|
<!-- $$$requestAllLicenses[overload1]$$$requestAllLicenses -->
|
|
<h3 class="fn" id="requestAllLicenses"><a name="requestAllLicenses"></a><code>[slot] </code><span class="type">void</span> Util::<span class="name">requestAllLicenses</span>()</h3>
|
|
<p>Loads all content of the legal folder in the qrc into a property string of this class. allLicenseLoaded is emited when loading is finished.</p>
|
|
<!-- @@@requestAllLicenses -->
|
|
<!-- $$$requestDataProtection[overload1]$$$requestDataProtection -->
|
|
<h3 class="fn" id="requestDataProtection"><a name="requestDataProtection"></a><code>[slot] </code><span class="type">void</span> Util::<span class="name">requestDataProtection</span>()</h3>
|
|
<p>Loads all dataprotection of the legal folder in the qrc into a property string of this class. allDataProtectionLoaded is emited when loading is finished.</p>
|
|
<!-- @@@requestDataProtection -->
|
|
<!-- $$$toString[overload1]$$$toStringconstQStringList& -->
|
|
<h3 class="fn" id="toString"><a name="toString"></a><code>[static slot] </code><span class="type">QString</span> Util::<span class="name">toString</span>(const <span class="type">QStringList</span> &<i>list</i>)</h3>
|
|
<p>Helper function to append a QStringList into a QString with a space between the items.</p>
|
|
<!-- @@@toString -->
|
|
<!-- $$$writeJsonObjectToFile[overload1]$$$writeJsonObjectToFileconstQString&constQJsonObject&bool -->
|
|
<h3 class="fn" id="writeJsonObjectToFile"><a name="writeJsonObjectToFile"></a><code>[static slot] </code><span class="type">bool</span> Util::<span class="name">writeJsonObjectToFile</span>(const <span class="type">QString</span> &<i>absoluteFilePath</i>, const <span class="type">QJsonObject</span> &<i>object</i>, <span class="type">bool</span> <i>truncate</i> = true)</h3>
|
|
<p>Writes a given QJsonObject to a file. The path must be absolute. When truncate is set to true the exsisting json file will be overriten.</p>
|
|
<!-- @@@writeJsonObjectToFile -->
|
|
</div>
|
|
<div id= license class="footer center"><p>This documentation is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p></div> <script src="../js/mermaid.min.js"></script> <script>var config = {startOnLoad:true,flowchart:{useMaxWidth:true,htmlLabels:true}};mermaid.initialize(config);</script></body>
|
|
</html>
|