2022-06-08 11:30:04 +00:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-12-09 14:27:12 +00:00
|
|
|
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2024-01-05 07:12:46 +00:00
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
#include <QWidget>
|
2011-12-09 14:27:12 +00:00
|
|
|
|
2017-12-20 14:38:06 +00:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QMouseEvent)
|
2011-12-09 14:27:12 +00:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QUrl)
|
2017-12-20 14:38:06 +00:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QString)
|
2021-06-08 16:30:15 +00:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QScreen)
|
2011-12-09 14:27:12 +00:00
|
|
|
|
2021-06-08 16:30:15 +00:00
|
|
|
class MainWindow : public QWidget
|
2011-12-09 14:27:12 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void displayAnnotatedUrl(const QUrl &url, const QString &title, const QPixmap &pixmap);
|
2021-06-08 10:18:58 +00:00
|
|
|
void nfcStateChanged(bool enabled);
|
2021-06-09 09:45:59 +00:00
|
|
|
void showTagError(const QString &message);
|
2011-12-09 14:27:12 +00:00
|
|
|
|
|
|
|
protected:
|
2021-05-28 11:01:34 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
2021-06-08 16:30:15 +00:00
|
|
|
void moveEvent(QMoveEvent *event) override;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateWidgetLayout(Qt::ScreenOrientation orientation);
|
2011-12-09 14:27:12 +00:00
|
|
|
|
|
|
|
private:
|
2021-06-08 16:30:15 +00:00
|
|
|
void handleScreenChange();
|
|
|
|
|
|
|
|
QLabel *m_titleLabel;
|
|
|
|
QLabel *m_infoLabel;
|
|
|
|
QLabel *m_uriLabel;
|
|
|
|
QLabel *m_landscapeIconLabel;
|
|
|
|
QLabel *m_portraitIconLabel;
|
|
|
|
QScreen *m_screen = nullptr;
|
|
|
|
QPixmap m_pixmap;
|
2011-12-09 14:27:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|