37#include "Utils/Macros.h"
40 #define scast(x, y) static_cast<x>(y)
41 #define dcast(x, y) dynamic_cast<x>(y)
42 #define rcast(x, y) reinterpret_cast<x>(y)
52 uint64_t currentDateToInt();
53 uint64_t dateToInt(
const QDateTime& dateTime);
54 QDateTime intToDate(uint64_t date);
78 QString
msToString(MilliSeconds msec,
const QString& format);
80 QString convertNotNull(
const QString& str);
97 const QString& target);
102 const QString& target);
128 QStringList imageExtensions(
bool withAsterisk=
true);
139 using Extensions=uint16_t;
158 QString randomString(
int max_chars);
191 QByteArray convertPixmapToByteArray(
const QPixmap& pm);
192 QByteArray convertPixmapToByteArray(
const QPixmap& pm,
const char* format);
193 QPixmap convertByteArrayToPixmap(
const QByteArray& arr);
201 void unsetEnvironment(
const QString& key);
202 QString getEnvironment(
const char* key);
Helper functions.
Definition: Utils.h:38
QString stringToFirstUpper(const QString &str)
Transform all letters after a space to upper case.
QStringList playlistExtensions(bool withAsterisk=true)
get all supported playlist file extensions
QByteArray calcHash(const QByteArray &data)
calculate a md5 hashsum
QStringList soundfileExtensions(bool withAsterisk=true)
get all supported sound file extensions
QStringList ipAddresses()
get all ip addresses of the host
void sleepMs(uint64_t ms)
sleep
QString stringToVeryFirstUpper(const QString &str)
Transform only first letter to upper case.
int randomNumber(int min, int max)
get a random val between min max
QString getFileFilter(Extensions extensions, const QString &name)
get filter for file chooser dialog based on extensions
QString easyTagFinder(const QString &tag, const QString &xmlDocument)
gets value out of tag
QString msToString(MilliSeconds msec, const QString &format)
Convert milliseconds to string.
QString soundfileFilter()
get filter for file reader or file chooser
QStringList podcastExtensions(bool withAsterisk=true)
get all supported podcast file extensions
QString createLink(const QString &name, bool dark=true, bool underline=true)
create a link string
void setEnvironment(const QString &key, const QString &value)
set an environment variable. This function is platform independent