Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosplatformtheme.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOHOSPLATFORMTHEME_H
5#define QOHOSPLATFORMTHEME_H
6
7#include <QtCore/qfileinfo.h>
8#include <QtCore/qhash.h>
9#include <QtCore/qmap.h>
10#include <QtGui/qicon.h>
11#include <QtGui/qpalette.h>
12#include <qohosplugincore.h>
13#include <qpa/qplatformtheme.h>
14#include <qpa/qplatformdialoghelper.h>
15
16
18
19template<typename T>
20using QOhosSupplier = std::function<T()>;
21
23{
24public:
25
26 static constexpr int defaultWheelScrollLines = 3;
27
29
30 void requestColorScheme(Qt::ColorScheme scheme) override;
31 Qt::ColorScheme colorScheme() const override;
32
33 QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
34 bool usePlatformNativeDialog(DialogType type) const override;
35 QVariant themeHint(ThemeHint hint) const override;
36
37 const QPalette *palette(Palette type) const override;
38 const QFont *font(Font type) const override;
39 void setWheelScrollLines(int wheelScrollLines);
40
42
43 QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override;
44
45private:
47 QHash<Font, QFont> m_fonts;
48 int m_wheelScrollLines;
49 QOhosSupplier<QOhosOptional<bool>> m_ohosConfigDarkModeFlagSupplier;
50};
51
52QT_END_NAMESPACE
53
54#endif // QOHOSPLATFORMTHEME_H
void onMouseWheelEvent(const QOhosWheelEvent &event, QWindow *window)
void onNonClientAreaTouchEvents(QWindow *targetWindow, std::vector< QOhosWindowProxy::NonClientAreaTouchEvent > eventBatch)
void onHoverEvent(const QOhosHoverEvent &hoverEvent)
void onMouseEvent(const QOhosMouseEvent &mouseEvent)
void onGestureEventFromNativeNode(const QOhosGestureEvent &gestureEvent)
void onTouchEventFromXComponent(QWindow *targetWindow, std::chrono::nanoseconds timeStamp, const std::vector< QOhosTouchEventTouchPointData > &touchPoints, QInputDevice::DeviceType deviceType, QFlags< OhosKeyboardModifier > modifiers)
void onNonClientAreaMouseEvents(QWindow *targetWindow, std::vector< QOhosWindowProxy::NonClientAreaMouseEvent > eventBatch)
void onKeyEvent(const QOhosKeyEvent &keyEvent, QWindow *targetWindow)
static QOhosPlatformIntegration * instance()
bool usePlatformNativeDialog(DialogType type) const override
void requestColorScheme(Qt::ColorScheme scheme) override
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override
Return an icon for fileInfo, observing iconOptions.
Qt::ColorScheme colorScheme() const override
void setWheelScrollLines(int wheelScrollLines)
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
const QFont * font(Font type) const override
const QPalette * palette(Palette type) const override
Return a color palette for type type.
QPlatformSystemTrayIcon * createPlatformSystemTrayIcon() const override
Factory function for QSystemTrayIcon.
static constexpr int defaultWheelScrollLines
QVariant themeHint(ThemeHint hint) const override
Combined button and popup list for selecting options.
QRectF calculateTouchPointArea(const QPointF &clickPoint)
QPoint determineScreenGlobalDisplayOffset(QWindow *qWindow)
QPoint makeWindowLocalPosition(const QPoint &globalPosition, QWindow *qWindow)
QPointF calculateTouchPointNormalPosition(QWindow *targetWindow, const QPointF &clickPoint)
QInputDevice * createTouchDevice(QInputDevice::DeviceType deviceType)
std::shared_ptr< void > registerObjectDestroyedSignalHandler(QObject *object, QObject *context, std::function< void()> signalHandler)
QOhosOptional< QEventPoint::State > tryMapXComponentTouchEventTypeToQt(::OH_NativeXComponent_TouchEventType eventType)
std::nullopt_t makeEmptyQOhosOptional()