Skip to content

Commit

Permalink
chore(qt)[sc-97670]: add Q_OBJECT macro to fix assertion error on fin…
Browse files Browse the repository at this point in the history
…dChildren<QCursorMark*>()
  • Loading branch information
brstrutt committed Jul 10, 2024
1 parent 80fa53d commit 252f55d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/webdriver/extension_qt/web_view_visualizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,31 +238,6 @@ void QWebViewVisualizerSourceCommand::DownloadFinished() {

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

class QCursorMark : public QWidget
{
public:
explicit QCursorMark(QWidget* parent)
: QWidget(parent)
{
resize(2 * RADIUS, 2 * RADIUS);
}

virtual void paintEvent(QPaintEvent *event) {
QPainter painter(this);
painter.setPen(QPen(Qt::red));

QBrush brush = painter.brush();
brush.setColor(Qt::red);
brush.setStyle(Qt::SolidPattern);
painter.setBrush(brush);

painter.drawEllipse(QPoint(RADIUS, RADIUS), RADIUS, RADIUS);
}

private:
static const int RADIUS = 5;
};

QWebViewVisualizerShowPointCommand::QWebViewVisualizerShowPointCommand(yasper::ptr<QWebkitProxy> webkitProxy, Session* session, QWebView* view)
: webkitProxy_(webkitProxy), session_(session), view_(view)
{}
Expand Down
26 changes: 26 additions & 0 deletions src/webdriver/extension_qt/web_view_visualizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@ class QWebViewVisualizerShowPointCommand {
QWebView* view_;
};

class QCursorMark : public QWidget
{
Q_OBJECT
public:
explicit QCursorMark(QWidget* parent)
: QWidget(parent)
{
resize(2 * RADIUS, 2 * RADIUS);
}

virtual void paintEvent(QPaintEvent *event) {
QPainter painter(this);
painter.setPen(QPen(Qt::red));

QBrush brush = painter.brush();
brush.setColor(Qt::red);
brush.setStyle(Qt::SolidPattern);
painter.setBrush(brush);

painter.drawEllipse(QPoint(RADIUS, RADIUS), RADIUS, RADIUS);
}

private:
static const int RADIUS = 5;
};

} // namespace webdriver

#endif // WEB_VIEW_VISUALIZER_H

0 comments on commit 252f55d

Please sign in to comment.