3#include <QDesktopServices>
23 QUrl url(QStringLiteral(
"file://"));
28 tmp.replace(QChar(
'\\'), QChar(
'/'));
31 if (QFileInfo(path).isAbsolute()) {
32 tmp = QStringLiteral(
"/") + tmp;
34 url.setPath(tmp, QUrl::DecodedMode);
37 url.setPath(path, QUrl::DecodedMode);
39 return QDesktopServices::openUrl(url);
48 return palette.color(QPalette::WindowText).lightness() > palette.color(QPalette::Window).lightness();
QT_UTILITIES_EXPORT bool isPaletteDark(const QPalette &palette=QPalette())
Returns whether palette is dark.
QT_UTILITIES_EXPORT bool openLocalFileOrDir(const QString &path)
Shows the specified file or directory using the default file browser.