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/qhash.h>
8#include <QtCore/qmap.h>
9#include <QtGui/qpalette.h>
10#include <qohosplugincore.h>
11#include <qpa/qplatformtheme.h>
12#include <qpa/qplatformdialoghelper.h>
13
14
16
17template<typename T>
18using QOhosSupplier = std::function<T()>;
19
20template <typename T>
21class QOhosOptional;
22
24{
25public:
26
27 static constexpr int defaultWheelScrollLines = 3;
28
30
31 void requestColorScheme(Qt::ColorScheme scheme) override;
32 Qt::ColorScheme colorScheme() const override;
33
34 QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
35 bool usePlatformNativeDialog(DialogType type) const override;
36 QVariant themeHint(ThemeHint hint) const override;
37
38 const QPalette *palette(Palette type) const override;
39 const QFont *font(Font type) const override;
40 void setWheelScrollLines(int wheelScrollLines);
41
43
44private:
46 QHash<Font, QFont> m_fonts;
47 int m_wheelScrollLines;
48 QOhosSupplier<QOhosOptional<bool>> m_ohosConfigDarkModeFlagSupplier;
49};
50
51QT_END_NAMESPACE
52
53#endif // QOHOSPLATFORMTHEME_H
void onMouseWheelEvent(const QOhosWheelEvent &event, QWindow *window)
void onNonClientAreaTouchEvents(QWindow *targetWindow, std::vector< QOhosWindowProxy::NonClientAreaTouchEvent > eventBatch)
void onGestureEventFromNativeNode(QWindow *targetWindow, std::int64_t timestamp, qreal value, QPointF localPosition, QPointF screenPosition, Qt::NativeGestureType gestureType, QInputDevice::DeviceType deviceType)
void onMouseEvent(const QOhosMouseEvent &mouseEvent)
void onTouchEventFromXComponent(QWindow *targetWindow, std::chrono::nanoseconds timeStamp, const std::vector< QOhosTouchEventTouchPointData > &touchPoints, QInputDevice::DeviceType deviceType)
void onHoverEvent(bool isHover, const QPointF &local, const QPointF &global, QWindow *window)
void onNonClientAreaMouseEvents(QWindow *targetWindow, std::vector< QOhosWindowProxy::NonClientAreaMouseEvent > eventBatch)
void onKeyEvent(const QOhosKeyEvent &keyEvent, QWindow *targetWindow)
virtual QOhosOptional< QOhosQtKeyEvent > tryConvertToQOhosQtKeyEvent() const =0
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
static QOhosPlatformIntegration * instance()
bool usePlatformNativeDialog(DialogType type) const override
void requestColorScheme(Qt::ColorScheme scheme) override
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)
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)
QOhosOptional< void > makeEmptyQOhosOptional()