1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
ScreenPlay/Docs/html/screenplay-util.html

128 lines
12 KiB
HTML
Raw Normal View History

2019-12-05 15:24:12 +01:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- util.cpp -->
2020-01-30 15:47:04 +01:00
<title>Util Class | ScreenPlay</title>
2019-12-05 15:24:12 +01:00
<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 ">
2019-12-05 15:24:12 +01:00
<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>
2019-12-05 15:24:12 +01:00
<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">(<a href="screenplay-util.html">ScreenPlay::Util</a>)<br/></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>
2019-12-05 15:24:12 +01:00
<!-- @@@Util -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;Util&gt;</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">
2020-01-30 15:47:04 +01:00
<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>
2019-12-05 15:24:12 +01:00
<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 &amp;<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 &amp;</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 &amp;<i>context</i>, const QString &amp;<i>msg</i>)</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 &amp;</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 &amp;</i>)</td></tr>
2020-01-30 15:47:04 +01:00
<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 &amp;</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>
2020-01-30 15:47:04 +01:00
<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"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-util.html#writeJsonObjectToFile">writeJsonObjectToFile</a></b>(const QString &amp;<i>absoluteFilePath</i>, const QJsonObject &amp;<i>object</i>, bool <i>truncate</i> = true)</td></tr>
</table></div>
2019-12-05 15:24:12 +01:00
<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>
2020-01-30 15:47:04 +01:00
<!-- $$$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> &amp;<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 &amp;</i>)</h3>
<p>Parses a version from a given QString. The QString must be looke like this: 1.0&#x2e;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> &amp;<i>context</i>, const <span class="type">QString</span> &amp;<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 -->
<!-- $$$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 &amp;</i>)</h3>
<p>Opens a json file (absolute path) and tries to convert it to a QJsonObject. Return 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 &amp;</i>)</h3>
<p>Opens a json file (absolute path) and tries to convert it to a QString. Return std::nullopt when not successful.</p>
<!-- @@@openJsonFileToString -->
2020-01-30 15:47:04 +01:00
<!-- $$$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 &amp;</i>)</h3>
<p>Opens a native folder window on the given path. Windows and Mac only for now!</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 -->
2020-01-30 15:47:04 +01:00
<!-- $$$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 -->
<!-- $$$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> &amp;<i>absoluteFilePath</i>, const <span class="type">QJsonObject</span> &amp;<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>
2019-12-05 15:24:12 +01:00
</html>