qt5base-lts/tests/baseline/shared/qwidgetbaselinetest.h
Santhosh Kumar f9aaa3e163 Update base line test case for widgets
Added baseline test case for menu (popup), combobox, command link and
lcd number.

New API takeScreenSnapshot() has been added for screen capture and
it serves to capture pop up windows

Change-Id: I5c1e46df270d94faf5c53431cddbd07532c256ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-06 14:51:29 +01:00

42 lines
742 B
C++

// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QObject>
#include <QImage>
QT_BEGIN_NAMESPACE
class QWidget;
class QWidgetBaselineTest : public QObject
{
Q_OBJECT
public:
QWidgetBaselineTest();
void takeStandardSnapshots();
QWidget *testWindow() const { return window; }
protected:
virtual void doInit() {}
virtual void doCleanup() {}
private slots:
void initTestCase();
void init();
void cleanup();
protected:
void makeVisible();
QImage takeSnapshot();
QImage takeScreenSnapshot(const QRect& rect = QRect());
private:
QWidget *window = nullptr;
};
QT_END_NAMESPACE