资源简介
1、程序主窗口上有个数值框,是用来调节主窗口透明度的。把程序窗口的透明度调低一些,让主窗口透明一些。以便能够透过控件窗口看到后面的其它窗口。
2、用主窗口覆盖你想要点击的其它任何程序或网页的按钮部位,鼠标点击主窗口相应位置,会获取相应的坐标值。然后点击“固定坐标”按钮。此时,测试按钮、开始按钮都可以使用了。
3、你点击测试按钮,5秒后,会自动点击你刚才指定的位置。注意,要先把你的Qt程序窗口挪开,不要遮挡点击位置。
4、设置点击间隔,点击开始后,会每隔XX分钟后自动点击相应位置。
2、用主窗口覆盖你想要点击的其它任何程序或网页的按钮部位,鼠标点击主窗口相应位置,会获取相应的坐标值。然后点击“固定坐标”按钮。此时,测试按钮、开始按钮都可以使用了。
3、你点击测试按钮,5秒后,会自动点击你刚才指定的位置。注意,要先把你的Qt程序窗口挪开,不要遮挡点击位置。
4、设置点击间隔,点击开始后,会每隔XX分钟后自动点击相应位置。

代码片段和文件信息
#include “dialog.h“
#include
#include
Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
setWindowFlags (Qt::Window);
mouseAct = new MouseActs(this) ;
QFontMetrics fm(font());
single_width = fm.horizontalAdvance (“例“);
single_height = fm.height () ;
title_label = new QLabel(“欢迎使用鼠标自动点击工具\n“
“ (唐都工作室) “) ;
QFont titleFont(“黑体“ 16 QFont::Bold);
title_label->setFont (titleFont) ;
title_label->setFixedHeight (single_height*8) ;
opacity_label = new QLabel(“窗口透明度“) ;
opacity_spinbox = new QSpinBox ;
opacity_spinbox -> setValue (100) ;
opacity_spinbox -> setSingleStep (5) ;
opacity_spinbox -> setMaximum (100) ;
opacity_spinbox -> setMinimum (40) ;
connect(opacity_spinboxSIGNAL(valueChanged(int))
thisSLOT(setTheOpacity(int))) ;
position_label = new QLabel(“点击位置“) ;
fixBtn = new QPushButton(“固定坐标“) ;
connect(fixBtnSIGNAL(clicked(bool))thisSLOT(setPosFixed())) ;
x_label = new QLabel(“X坐标“) ;
y_label = new QLabel(“Y坐标“) ;
x_LE = new QLineEdit ;y_LE = new QLineEdit ;
x_LE -> setEnabled (false) ;y_LE -> setEnabled (false) ;
interval_label = new QLabel(“点击间隔(分钟)“) ;
interval_spinbox = new QSpinBox ;
interval_spinbox -> setValue (1) ;
interval_spinbox -> setSingleStep (1) ;
interval_spinbox -> setMaximum (100) ;
interval_spinbox -> setMinimum (1) ;
press_type_label = new QLabel(“点击类型:“);
singlePressRB = new QRadioButton(“左键单击“) ;
doublePressRB = new QRadioButton(“左键双击“) ;
doublePressRB -> setChecked (true) ;
rbtnGp = new QButtonGroup ;
rbtnGp -> addButton (singlePressRB1) ;
rbtnGp -> addButton (doublePressRB2) ;
startBtn = new QPushButton(“开始“) ;
startBtn->setEnabled (false) ;//固定坐标后才可以开始。
connect(startBtnSIGNAL(clicked(bool))thisSLOT(startAct())) ;
cancelBtn = new QPushButton(“取消“) ;
connect(cancelBtnSIGNAL(clicked(bool))thisSLOT(cancelAct())) ;
testBtn = new QPushButton(“测试“) ;
testBtn -> setEnabled (false) ;
connect(testBtnSIGNAL(clicked(bool))thisSLOT(testAct())) ;
info_label = new QLabel(“准备开始!“) ;
timer = new QTimer(this) ;
connect(timerSIGNAL(timeout())thisSLOT(doPressAct())) ;
testTimer = new QTimer(this) ;
leftTime_timer = new QTimer(this) ;//在测试testAct()函数中使用。
leftTime_timer -> setInterval (10);
connect(leftTime_timerSIGNAL(timeout())thisSLOT(setLeftTimeLabel())) ;
leftTime_label = new QLabel(“剩余时间:“);
mainLayout = new QGridLayout(this) ;
QHBoxLayout *titleLayout = new QHBoxLayout ;
titleLayout -> addStretch () ;
titleLayout -> addWidget (title_label) ;
titleLayout -> addStretch () ;
QHBoxLayout *btnLayout = new QHBoxLayout ;
btnLayout -> addStretch () ;
btnLayout -> addWidget (testBtn) ;
btnLayout -> addWidget (startBtn) ;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1044 2020-03-08 15:34 autopressmouse\autopressmouse.pro
文件 25428 2020-03-08 13:31 autopressmouse\autopressmouse.pro.user
文件 8921 2020-03-08 21:35 autopressmouse\dialog.cpp
文件 2033 2020-03-08 16:04 autopressmouse\dialog.h
文件 270398 2020-03-08 15:33 autopressmouse\favicon.ico
文件 175 2020-03-08 09:52 autopressmouse\main.cpp
文件 892 2020-03-08 14:37 autopressmouse\mouseacts.cpp
文件 617 2020-03-08 13:06 autopressmouse\mouseacts.h
目录 0 2020-03-08 21:35 autopressmouse
----------- --------- ---------- ----- ----
309508 9
相关资源
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- Mini6410 Qt4和Qtopia编程开发指南
- Qt实现Code39条形码
- qt_ffmpeg_mp4_export_and_import.zip
- QT5.5入门与项目实战
- Huffman Compress 霍夫曼编码 压缩 解压缩
- 基于QT的黑白棋游戏设计和实现
评论
共有 条评论