資源簡介
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
評論
共有 條評論