Skip to content

Commit e21529b

Browse files
committed
chore(qt)[sc-97670]: add Q_OBJECT macro to fix assertion error on findChildren<QCursorMark*>()
1 parent dff6372 commit e21529b

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

src/webdriver/extension_qt/web_view_visualizer.cc

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -238,31 +238,6 @@ void QWebViewVisualizerSourceCommand::DownloadFinished() {
238238

239239
const char QWebViewVisualizerSourceCommand::DATA_PROTOCOL[] = "data:";
240240

241-
class QCursorMark : public QWidget
242-
{
243-
public:
244-
explicit QCursorMark(QWidget* parent)
245-
: QWidget(parent)
246-
{
247-
resize(2 * RADIUS, 2 * RADIUS);
248-
}
249-
250-
virtual void paintEvent(QPaintEvent *event) {
251-
QPainter painter(this);
252-
painter.setPen(QPen(Qt::red));
253-
254-
QBrush brush = painter.brush();
255-
brush.setColor(Qt::red);
256-
brush.setStyle(Qt::SolidPattern);
257-
painter.setBrush(brush);
258-
259-
painter.drawEllipse(QPoint(RADIUS, RADIUS), RADIUS, RADIUS);
260-
}
261-
262-
private:
263-
static const int RADIUS = 5;
264-
};
265-
266241
QWebViewVisualizerShowPointCommand::QWebViewVisualizerShowPointCommand(yasper::ptr<QWebkitProxy> webkitProxy, Session* session, QWebView* view)
267242
: webkitProxy_(webkitProxy), session_(session), view_(view)
268243
{}

src/webdriver/extension_qt/web_view_visualizer.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,32 @@ class QWebViewVisualizerShowPointCommand {
8181
QWebView* view_;
8282
};
8383

84+
class QCursorMark : public QWidget
85+
{
86+
Q_OBJECT
87+
public:
88+
explicit QCursorMark(QWidget* parent)
89+
: QWidget(parent)
90+
{
91+
resize(2 * RADIUS, 2 * RADIUS);
92+
}
93+
94+
virtual void paintEvent(QPaintEvent *event) {
95+
QPainter painter(this);
96+
painter.setPen(QPen(Qt::red));
97+
98+
QBrush brush = painter.brush();
99+
brush.setColor(Qt::red);
100+
brush.setStyle(Qt::SolidPattern);
101+
painter.setBrush(brush);
102+
103+
painter.drawEllipse(QPoint(RADIUS, RADIUS), RADIUS, RADIUS);
104+
}
105+
106+
private:
107+
static const int RADIUS = 5;
108+
};
109+
84110
} // namespace webdriver
85111

86112
#endif // WEB_VIEW_VISUALIZER_H

0 commit comments

Comments
 (0)