Qt Utilities: misc/desktoputils.h Source File

Qt Utilities 6.21.3 Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models

Loading...
Searching...
No Matches
desktoputils.h
Go to the documentation of this file.
1#ifndef DESKTOP_UTILS_DESKTOPSERVICES_H
2#define DESKTOP_UTILS_DESKTOPSERVICES_H
3
4#include "../global.h"
5
6#include <QMetaObject>
7#include <QPalette>
8
9#include <functional>
10#include <optional>
11
12QT_FORWARD_DECLARE_CLASS(QObject)
13QT_FORWARD_DECLARE_CLASS(QString)
14
15namespace QtUtilities {
16
17 QT_UTILITIES_EXPORT bool openLocalFileOrDir(const QString &path);
18 QT_UTILITIES_EXPORT bool isPaletteDark(const QPalette &palette = QPalette());
19 QT_UTILITIES_EXPORT std::optional<bool> isDarkModeEnabled();
20 QT_UTILITIES_EXPORT QMetaObject::Connection onDarkModeChanged(
21 std::function<void(bool)> &&darkModeChangedCallback, QObject *context = nullptr, bool invokeImmediately = true);
22
23} // namespace QtUtilities
24
25#endif // DESKTOP_UTILS_DESKTOPSERVICES_H
global.h
QT_UTILITIES_EXPORT
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
Definition global.h:14
QtUtilities
!
Definition trylocker.h:8
QtUtilities::onDarkModeChanged
QT_UTILITIES_EXPORT QMetaObject::Connection onDarkModeChanged(std::function< void(bool)> &&darkModeChangedCallback, QObject *context=nullptr, bool invokeImmediately=true)
Invokes the specified callback when the color scheme changed.
Definition desktoputils.cpp:102
QtUtilities::isDarkModeEnabled
QT_UTILITIES_EXPORT std::optional< bool > isDarkModeEnabled()
Returns whether dark mode is enabled.
Definition desktoputils.cpp:80
QtUtilities::isPaletteDark
QT_UTILITIES_EXPORT bool isPaletteDark(const QPalette &palette=QPalette())
Returns whether palette is dark.
Definition desktoputils.cpp:70
QtUtilities::openLocalFileOrDir
QT_UTILITIES_EXPORT bool openLocalFileOrDir(const QString &path)
Shows the specified file or directory using the default file browser.
Definition desktoputils.cpp:37