File indexing completed on 2024-12-15 04:00:59
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef GLAXNIMATE_ANDROID_BASEDIALOG_HPP 0008 #define GLAXNIMATE_ANDROID_BASEDIALOG_HPP 0009 0010 #include <QDialog> 0011 0012 namespace glaxnimate::android { 0013 0014 class BaseDialog : public QDialog 0015 { 0016 public: 0017 BaseDialog(QWidget* parent = nullptr); 0018 0019 int exec() override; 0020 0021 protected: 0022 void paintEvent(QPaintEvent* ev) override; 0023 void keyReleaseEvent(QKeyEvent *) override; 0024 bool eventFilter(QObject * object, QEvent * event) override; 0025 }; 0026 0027 0028 class DialogFixerFilter : public QObject 0029 { 0030 public: 0031 explicit DialogFixerFilter(QDialog *target = nullptr); 0032 0033 void set_target(QDialog* target); 0034 0035 protected: 0036 bool eventFilter(QObject *object, QEvent *event) override; 0037 0038 private: 0039 QDialog* target = nullptr; 0040 }; 0041 0042 0043 } // namespace glaxnimate::android 0044 0045 #endif // GLAXNIMATE_ANDROID_BASEDIALOG_HPP