WindowsFramelessDialog.h 936 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef WINDOWSFRAMELESSDIALOG_H
  2. #define WINDOWSFRAMELESSDIALOG_H
  3. #include <QDialog>
  4. class WindowsWindowEffect;
  5. class TitleBar;
  6. class WindowsFramelessDialog : public QDialog
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit WindowsFramelessDialog(QWidget *parent = nullptr);
  11. void setTitleBar(TitleBar *tBar);
  12. void setResizeEnabled(bool isEnabled);
  13. bool getResizeEnabled() const;
  14. WindowsWindowEffect *getWindowEffect() const;
  15. TitleBar *getTitleBar() const;
  16. protected:
  17. virtual QString effectType() const { return ""; };
  18. private:
  19. WindowsWindowEffect *windowEffect;
  20. TitleBar *titleBar;
  21. bool isResizeEnabled;
  22. private slots:
  23. void onScreenChanged(QScreen *screen);
  24. signals:
  25. // QWidget interface
  26. protected:
  27. void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
  28. bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
  29. };
  30. #endif // WINDOWSFRAMELESSDIALOG_H