55 Q_PROPERTY(
bool isFixedHeight READ isFixedHeight NOTIFY geometryUpdated)
56 Q_PROPERTY(
bool isFixedWidth READ isFixedWidth NOTIFY geometryUpdated)
58 using Core::
View::close;
59 using Core::
View::height;
60 using Core::
View::rect;
61 using Core::
View::resize;
62 using Core::
View::width;
64 explicit
View(Core::Controller *controller, Core::ViewType type,
65 QQuickItem *parent =
nullptr,
Qt::WindowFlags windowFlags = {});
69 QSize minSize()
const override;
70 QSize maxSizeHint()
const override;
71 QRect geometry()
const override;
72 QRect normalGeometry()
const override;
73 void setNormalGeometry(
QRect geo);
74 void setGeometry(
QRect)
override;
75 void setMaximumSize(
QSize sz)
override;
77 bool isVisible()
const override;
78 bool isExplicitlyHidden()
const override;
79 void setVisible(
bool is)
override;
81 void move(
int x,
int y)
override;
82 void setSize(
int w,
int h)
override final;
84 void setWidth(
int w)
override;
85 void setHeight(
int h)
override;
86 void setFixedWidth(
int w)
override;
87 void setFixedHeight(
int h)
override;
88 void setFixedSize(Size);
91 void updateGeometry();
92 void update()
override;
94 void setParent(QQuickItem *parent);
95 static void raiseAndActivate(QQuickItem *);
96 void raiseAndActivate()
override;
97 void activateWindow()
override;
98 void raise()
override;
99 static bool isRootView(
const QQuickItem *);
100 bool isRootView() const override final;
101 QQuickView *quickView() const;
105 void setWindowOpacity(
double v) override;
107 static
bool close(QQuickItem *);
108 bool close() override;
109 void setFlag(
Qt::WindowType f,
bool on = true) override;
110 void enableAttribute(
Qt::WidgetAttribute attr,
bool enable = true) override;
111 bool hasAttribute(
Qt::WidgetAttribute attr) const override;
112 Qt::WindowFlags flags() const override;
114 void setWindowTitle(const
QString &title) override;
115 void setWindowIcon(const
QIcon &icon) override;
116 bool isActiveWindow() const override;
118 Q_INVOKABLE
void redirectMouseEvents(QQuickItem *from);
119 Q_INVOKABLE
void showNormal() override;
120 Q_INVOKABLE
void showMinimized() override;
121 Q_INVOKABLE
void showMaximized() override;
123 bool isMinimized() const override;
124 bool isMaximized() const override;
126 std::shared_ptr<Core::Window> window() const override;
127 std::shared_ptr<Core::
View> childViewAt(
QPoint p) const override;
128 std::shared_ptr<Core::
View> rootView() const override;
129 std::shared_ptr<Core::
View> parentView() const override;
131 std::shared_ptr<Core::
View> asWrapper() override;
133 void grabMouse() override;
134 void releaseMouse() override;
135 void releaseKeyboard() override;
136 void setFocus(
Qt::FocusReason reason) override;
137 Qt::FocusPolicy focusPolicy() const override;
138 bool hasFocus() const override;
139 void setFocusPolicy(
Qt::FocusPolicy) override;
140 QString viewName() const override;
141 void setMinimumSize(
QSize sz) override;
143 void setCursor(
Qt::CursorShape shape) override;
144 void setMouseTracking(
bool enable) override;
146 int zOrder() const override;
147 void setZOrder(
int) override;
148 virtual QQuickItem *visualItem() const;
152 bool isFixedWidth() const;
153 bool isFixedHeight() const;
156 static
void makeItemFillParent(QQuickItem *item);
159 static QQuickItem *createItem(QQmlEngine *engine, const
QString &filename, QQmlContext *context =
nullptr);
163 static QQuickItem *createItem(const
QString &filename, QQuickItem *parent, QQmlContext *ctx =
nullptr);
165 static
std::shared_ptr<Core::
View> parentViewFor(const QQuickItem *);
166 static
std::shared_ptr<Core::
View> asQQuickWrapper(QQuickItem *item);
169 void geometryUpdated();
170 void itemGeometryChanged();
174 void QQUICKITEMgeometryChanged(const
QRectF &newGeometry, const
QRectF &oldGeometry) override;
175 void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override;
177 bool event(
QEvent *) override;
186 friend class MouseEventRedirector;
187 void updateNormalGeometry();
188 void sendVisibleChangeEvent();
189 void _setSize(
QSize);
190 bool m_inSetParent = false;
191 Qt::WindowFlags m_windowFlags;
192 int m_widgetAttributes = 0;
193 Qt::FocusPolicy m_focusPolicy =
Qt::NoFocus;
194 bool m_mouseTrackingEnabled = false;
195 QRect m_normalGeometry;
197 MouseEventRedirector *m_mouseEventRedirector =
nullptr;