void Widget::on_pushButton_6_clicked()
{
QTimer::singleShot(4000,
this,
SLOT(clickAction
()));
}
void Widget::clickAction()
{
QPoint point
(cur.
pos().
x(), cur.
pos().
y());
ui
->plainTextEdit
->appendPlainText
("X:" + QString::number(cur.
pos().
x()) + " Y:" + QString::number(cur.
pos().
y()));
}
void Widget::on_pushButton_6_clicked()
{
QTimer::singleShot(4000, this, SLOT(clickAction()));
}
void Widget::clickAction()
{
QObject *desk = QApplication::activeWindow();
QPoint point(cur.pos().x(), cur.pos().y());
ui->plainTextEdit->appendPlainText("X:" + QString::number(cur.pos().x()) + " Y:" + QString::number(cur.pos().y()));
QApplication::postEvent(desk, new QMouseEvent(QMouseEvent::MouseButtonPress,point,Qt::RightButton, Qt::RightButton,Qt::NoModifier));
QApplication::postEvent(desk, new QMouseEvent(QMouseEvent::MouseButtonRelease,point,Qt::RightButton, Qt::RightButton,Qt::NoModifier));
}
To copy to clipboard, switch view to plain text mode
Bookmarks