File indexing completed on 2026-05-19 08:21:07
0001
0002
0003
0004
0005 #ifndef QTESTSUPPORT_WIDGETS_H
0006 #define QTESTSUPPORT_WIDGETS_H
0007
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtGui/qtestsupport_gui.h>
0010
0011 QT_BEGIN_NAMESPACE
0012
0013 class QPointingDevice;
0014 class QWidget;
0015
0016 namespace QTest {
0017
0018 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowActive(QWidget *widget, int timeout);
0019 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowActive(QWidget *widget, QDeadlineTimer timeout);
0020 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowActive(QWidget *widget);
0021
0022 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowFocused(QWidget *widget, QDeadlineTimer timeout);
0023 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowFocused(QWidget *widget);
0024
0025 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowExposed(QWidget *widget, int timeout);
0026 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowExposed(QWidget *widget, QDeadlineTimer timeout);
0027 [[nodiscard]] Q_WIDGETS_EXPORT bool qWaitForWindowExposed(QWidget *widget);
0028
0029 class Q_WIDGETS_EXPORT QTouchEventWidgetSequence : public QTouchEventSequence
0030 {
0031 public:
0032 ~QTouchEventWidgetSequence() override;
0033 QTouchEventWidgetSequence& press(int touchId, const QPoint &pt, QWidget *widget = nullptr);
0034 QTouchEventWidgetSequence& move(int touchId, const QPoint &pt, QWidget *widget = nullptr);
0035 QTouchEventWidgetSequence& release(int touchId, const QPoint &pt, QWidget *widget = nullptr);
0036 QTouchEventWidgetSequence& stationary(int touchId) override;
0037
0038 bool commit(bool processEvents = true) override;
0039
0040 private:
0041 QTouchEventWidgetSequence(QWidget *widget, QPointingDevice *aDevice, bool autoCommit);
0042
0043 QPoint mapToScreen(QWidget *widget, const QPoint &pt);
0044
0045 QWidget *targetWidget = nullptr;
0046
0047 friend QTouchEventWidgetSequence touchEvent(QWidget *widget, QPointingDevice *device, bool autoCommit);
0048 };
0049
0050 }
0051
0052 QT_END_NAMESPACE
0053
0054 #endif