2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef CONTROLLERWINDOW_H
|
|
|
|
#define CONTROLLERWINDOW_H
|
|
|
|
|
2016-11-16 11:34:00 +00:00
|
|
|
#include <QPlainTextEdit>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#include "previewwindow.h"
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QCheckBox;
|
|
|
|
class QGroupBox;
|
|
|
|
class QLabel;
|
|
|
|
class QPushButton;
|
|
|
|
class QRadioButton;
|
|
|
|
class QMainWindow;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2012-04-20 11:54:52 +00:00
|
|
|
class HintControl;
|
|
|
|
class WindowStatesControl;
|
|
|
|
class TypeControl;
|
|
|
|
|
2016-11-16 11:34:00 +00:00
|
|
|
class ControllerWidget : public QWidget
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
explicit ControllerWidget(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-07-18 08:10:01 +00:00
|
|
|
virtual bool eventFilter(QObject *o, QEvent *e);
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
private slots:
|
|
|
|
void updatePreview();
|
2012-07-18 08:10:01 +00:00
|
|
|
void updateStateControl();
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
2017-06-22 13:43:31 +00:00
|
|
|
void updatePreview(QWindow *);
|
|
|
|
void updatePreview(QWidget *);
|
2011-04-27 10:05:43 +00:00
|
|
|
void createTypeGroupBox();
|
|
|
|
QCheckBox *createCheckBox(const QString &text);
|
|
|
|
QRadioButton *createRadioButton(const QString &text);
|
|
|
|
|
|
|
|
QMainWindow *parentWindow;
|
2017-06-22 13:43:31 +00:00
|
|
|
|
|
|
|
QWindow *previewWindow;
|
|
|
|
PreviewWidget *previewWidget;
|
2011-04-27 10:05:43 +00:00
|
|
|
PreviewDialog *previewDialog;
|
2017-06-22 13:43:31 +00:00
|
|
|
|
|
|
|
QWindow *activePreview;
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
QGroupBox *widgetTypeGroupBox;
|
|
|
|
QGroupBox *additionalOptionsGroupBox;
|
2012-04-20 11:54:52 +00:00
|
|
|
TypeControl *typeControl;
|
|
|
|
HintControl *hintsControl;
|
|
|
|
WindowStatesControl *statesControl;
|
|
|
|
|
2017-06-22 13:43:31 +00:00
|
|
|
QRadioButton *previewWindowButton;
|
2011-04-27 10:05:43 +00:00
|
|
|
QRadioButton *previewWidgetButton;
|
|
|
|
QRadioButton *previewDialogButton;
|
|
|
|
QCheckBox *modalWindowCheckBox;
|
|
|
|
QCheckBox *fixedSizeWindowCheckBox;
|
|
|
|
};
|
|
|
|
|
2016-11-16 11:34:00 +00:00
|
|
|
class LogWidget : public QPlainTextEdit
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
explicit LogWidget(QWidget *parent = nullptr);
|
2016-11-16 11:34:00 +00:00
|
|
|
~LogWidget();
|
|
|
|
|
|
|
|
static LogWidget *instance() { return m_instance; }
|
|
|
|
static void install();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void appendText(const QString &);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static QString startupMessage();
|
|
|
|
|
|
|
|
static LogWidget *m_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ControllerWindow : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ControllerWindow();
|
|
|
|
|
|
|
|
void registerEventFilter();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONTROLLERWINDOW_H
|