更新代码

master
feiyangqingyun 2021-10-10 09:54:15 +08:00
parent 9b11b4be58
commit b8ab9d6a33
59 changed files with 9671 additions and 164 deletions

9401
QWidgetDemo.pro.user Normal file

File diff suppressed because it is too large Load Diff

BIN
bin/base64helper.exe Normal file

Binary file not shown.

BIN
bin/battery.exe Normal file

Binary file not shown.

BIN
bin/bgdemo.exe Normal file

Binary file not shown.

BIN
bin/colorwidget.exe Normal file

Binary file not shown.

BIN
bin/comtool.exe Normal file

Binary file not shown.

BIN
bin/countcode.exe Normal file

Binary file not shown.

BIN
bin/dbpage.exe Normal file

Binary file not shown.

BIN
bin/designer.exe Normal file

Binary file not shown.

BIN
bin/devicebutton.exe Normal file

Binary file not shown.

BIN
bin/devicesizetable.exe Normal file

Binary file not shown.

BIN
bin/emailtool.exe Normal file

Binary file not shown.

BIN
bin/ffmpegdemo.exe Normal file

Binary file not shown.

BIN
bin/flatui.exe Normal file

Binary file not shown.

BIN
bin/framelesswidget.exe Normal file

Binary file not shown.

BIN
bin/gifwidget.exe Normal file

Binary file not shown.

BIN
bin/imageswitch.exe Normal file

Binary file not shown.

BIN
bin/ipaddress.exe Normal file

Binary file not shown.

BIN
bin/lightbutton.exe Normal file

Binary file not shown.

BIN
bin/lineeditnext.exe Normal file

Binary file not shown.

BIN
bin/lunarcalendarwidget.exe Normal file

Binary file not shown.

BIN
bin/maskwidget.exe Normal file

Binary file not shown.

BIN
bin/miniblink.exe Normal file

Binary file not shown.

BIN
bin/moneytool.exe Normal file

Binary file not shown.

BIN
bin/mouseline.exe Normal file

Binary file not shown.

BIN
bin/movewidget.exe Normal file

Binary file not shown.

BIN
bin/mpvdemo.exe Normal file

Binary file not shown.

BIN
bin/navbutton.exe Normal file

Binary file not shown.

BIN
bin/netserver.exe Normal file

Binary file not shown.

11
bin/netserver.ini Normal file
View File

@ -0,0 +1,11 @@
[AppConfig1]
ListenPort1=6907
CmdStart1=76
CmdLen1=12
HexData1=false
[AppConfig2]
ListenPort2=6908
CmdStart2=76
CmdLen2=12
HexData2=false

BIN
bin/nettool.exe Normal file

Binary file not shown.

BIN
bin/ntpclient.exe Normal file

Binary file not shown.

BIN
bin/pngtool.exe Normal file

Binary file not shown.

BIN
bin/qwtdemo.exe Normal file

Binary file not shown.

BIN
bin/savelog.exe Normal file

Binary file not shown.

BIN
bin/saveruntime.exe Normal file

Binary file not shown.

BIN
bin/screenwidget.exe Normal file

Binary file not shown.

BIN
bin/smoothcurve.exe Normal file

Binary file not shown.

BIN
bin/styledemo.exe Normal file

Binary file not shown.

BIN
bin/videopanel.exe Normal file

Binary file not shown.

BIN
bin/videowidget.exe Normal file

Binary file not shown.

BIN
bin/vlcdemo.exe Normal file

Binary file not shown.

BIN
bin/zhtopy.exe Normal file

Binary file not shown.

View File

@ -204,6 +204,11 @@ void FramelessWidget2::setResizeEnable(bool resizeEnable)
this->resizeEnable = resizeEnable;
}
void FramelessWidget2::setMousePressed(bool mousePressed)
{
this->mousePressed = mousePressed;
}
void FramelessWidget2::setWidget(QWidget *widget)
{
if (this->widget == 0) {

View File

@ -56,6 +56,8 @@ public Q_SLOTS:
//设置是否可拖动+拉伸
void setMoveEnable(bool moveEnable);
void setResizeEnable(bool resizeEnable);
//修复部分控件不能自动识别 MouseButtonRelease 的BUG
void setMousePressed(bool mousePressed);
//设置要无边框的窗体
void setWidget(QWidget *widget);

View File

@ -4,12 +4,10 @@
#include "qlabel.h"
#include "qlineedit.h"
#include "qboxlayout.h"
#include "qregexp.h"
#include "qvalidator.h"
#include "qevent.h"
#include "qdebug.h"
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
#include "qregexp.h"
#endif
IPAddress::IPAddress(QWidget *parent) : QWidget(parent)
{
@ -55,15 +53,21 @@ IPAddress::IPAddress(QWidget *parent) : QWidget(parent)
txtIP4->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(txtIP4, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
//设置IP地址校验过滤
QRegExp regExp("(2[0-5]{2}|2[0-4][0-9]|1?[0-9]{1,2})");
QString pattern = "(2[0-5]{2}|2[0-4][0-9]|1?[0-9]{1,2})";
//确切的说 QRegularExpression QRegularExpressionValidator 从5.0 5.1开始就有
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
QRegularExpression regExp(pattern);
QRegularExpressionValidator *validator = new QRegularExpressionValidator(regExp, this);
#else
QRegExp regExp(pattern);
QRegExpValidator *validator = new QRegExpValidator(regExp, this);
#endif
txtIP1->setValidator(validator);
txtIP2->setValidator(validator);
txtIP3->setValidator(validator);
txtIP4->setValidator(validator);
#endif
//绑定事件过滤器,识别键盘按下
txtIP1->installEventFilter(this);
@ -157,13 +161,11 @@ QSize IPAddress::minimumSizeHint() const
void IPAddress::setIP(const QString &ip)
{
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
//先检测IP地址是否合法
QRegExp regExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
if (!regExp.exactMatch(ip)) {
return;
}
#endif
if (this->ip != ip) {
this->ip = ip;

View File

@ -2,7 +2,7 @@ QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
TARGET = mouseline
TARGET = moneytool
TEMPLATE = app
DESTDIR = $$PWD/../bin
CONFIG += warn_off

View File

@ -7,6 +7,7 @@ int AppConfig::ListenPort1 = 6907;
int AppConfig::CmdStart1 = 76;
int AppConfig::CmdLen1 = 12;
bool AppConfig::HexData1 = false;
int AppConfig::ListenPort2 = 6908;
int AppConfig::CmdStart2 = 76;
int AppConfig::CmdLen2 = 12;
@ -16,15 +17,18 @@ void AppConfig::readConfig()
{
QSettings set(AppConfig::ConfigFile, QSettings::IniFormat);
set.beginGroup("AppConfig");
AppConfig::ListenPort1 = set.value("ListenPort1").toInt();
AppConfig::CmdStart1 = set.value("CmdStart1").toInt();
AppConfig::CmdLen1 = set.value("CmdLen1").toInt();
AppConfig::HexData1 = set.value("HexData1").toBool();
AppConfig::ListenPort2 = set.value("ListenPort2").toInt();
AppConfig::CmdStart2 = set.value("CmdStart2").toInt();
AppConfig::CmdLen2 = set.value("CmdLen2").toInt();
AppConfig::HexData2 = set.value("HexData2").toBool();
set.beginGroup("AppConfig1");
AppConfig::ListenPort1 = set.value("ListenPort1", AppConfig::ListenPort1).toInt();
AppConfig::CmdStart1 = set.value("CmdStart1", AppConfig::CmdStart1).toInt();
AppConfig::CmdLen1 = set.value("CmdLen1", AppConfig::CmdLen1).toInt();
AppConfig::HexData1 = set.value("HexData1", AppConfig::HexData1).toBool();
set.endGroup();
set.beginGroup("AppConfig2");
AppConfig::ListenPort2 = set.value("ListenPort2", AppConfig::ListenPort2).toInt();
AppConfig::CmdStart2 = set.value("CmdStart2", AppConfig::CmdStart2).toInt();
AppConfig::CmdLen2 = set.value("CmdLen2", AppConfig::CmdLen2).toInt();
AppConfig::HexData2 = set.value("HexData2", AppConfig::HexData2).toBool();
set.endGroup();
//配置文件不存在或者不全则重新生成
@ -38,11 +42,14 @@ void AppConfig::writeConfig()
{
QSettings set(AppConfig::ConfigFile, QSettings::IniFormat);
set.beginGroup("AppConfig");
set.beginGroup("AppConfig1");
set.setValue("ListenPort1", AppConfig::ListenPort1);
set.setValue("CmdStart1", AppConfig::CmdStart1);
set.setValue("CmdLen1", AppConfig::CmdLen1);
set.setValue("HexData1", AppConfig::HexData1);
set.endGroup();
set.beginGroup("AppConfig2");
set.setValue("ListenPort2", AppConfig::ListenPort2);
set.setValue("CmdStart2", AppConfig::CmdStart2);
set.setValue("CmdLen2", AppConfig::CmdLen2);

View File

@ -37,7 +37,7 @@ void frmMain::initConfig()
{
ui->txtListenPort1->setText(QString::number(AppConfig::ListenPort1));
connect(ui->txtListenPort1, SIGNAL(textChanged(QString)), this, SLOT(saveConfig()));
qDebug()<<AppConfig::ListenPort1;
ui->txtListenPort2->setText(QString::number(AppConfig::ListenPort2));
connect(ui->txtListenPort2, SIGNAL(textChanged(QString)), this, SLOT(saveConfig()));
}

View File

@ -13,139 +13,208 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="txtMain1">
<property name="readOnly">
<bool>true</bool>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame1">
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0" colspan="3">
<widget class="QListWidget" name="listWidget1"/>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="txtListenPort1"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnClear1">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btnListen1">
<property name="text">
<string>监听</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labCount1">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string>共 0 个连接</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QTextEdit" name="txtMain2">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame2">
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QPushButton" name="btnListen2">
<property name="text">
<string>监听</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="txtListenPort2"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnClear2">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QListWidget" name="listWidget2"/>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labCount2">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string>共 0 个连接</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
<widget class="QWidget" name="tab1">
<attribute name="title">
<string>服务器1</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="txtMain1">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget1" native="true">
<property name="maximumSize">
<size>
<width>230</width>
<height>16777215</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="2" column="0" colspan="3">
<widget class="QListWidget" name="listWidget1"/>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="txtListenPort1"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnClear1">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btnListen1">
<property name="text">
<string>监听</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labCount1">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string>共 0 个连接</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab2">
<attribute name="title">
<string>服务器2</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="txtMain2">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget2" native="true">
<property name="maximumSize">
<size>
<width>230</width>
<height>16777215</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QPushButton" name="btnListen2">
<property name="text">
<string>监听</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="txtListenPort2"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnClear2">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QListWidget" name="listWidget2"/>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labCount2">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string>共 0 个连接</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>

View File

@ -21,7 +21,7 @@ int main(int argc, char *argv[])
AppConfig::readConfig();
frmMain w;
w.setWindowTitle(QString("网络中转服务器V2018 本机IP: %1 QQ: 517216493").arg(QUIHelper::getLocalIP()));
w.setWindowTitle(QString("网络中转服务器V2021 本机IP: %1 QQ: 517216493").arg(QUIHelper::getLocalIP()));
w.show();
return a.exec();

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -10,7 +10,8 @@
#include "qwt_compass_rose.h"
#include "qwt_point_polar.h"
#include "qwt_painter.h"
#include <qpainter.h>
#include "qpainterpath.h"
#include "qpainter.h"
static QPointF qwtIntersection(
QPointF p11, QPointF p12, QPointF p21, QPointF p22 )

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -11,8 +11,9 @@
#include "qwt_global.h"
#include "qwt_math.h"
#include "qwt_painter.h"
#include <qapplication.h>
#include <qpainter.h>
#include "qapplication.h"
#include "qpainterpath.h"
#include "qpainter.h"
#if QT_VERSION < 0x040601
#define qFastSin(x) qSin(x)

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -10,6 +10,8 @@
#include "qwt_null_paintdevice.h"
#include <qpaintengine.h>
#include <qpixmap.h>
#include "qpainterpath.h"
#include "qpainter.h"
class QwtNullPaintDevice::PrivateData
{

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -27,6 +27,7 @@
#include <qpaintengine.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qpainterpath.h>
#if QT_VERSION >= 0x050000
#include <qwindow.h>

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -15,6 +15,7 @@
#include <qpixmap.h>
#include <qimage.h>
#include <qpolygon.h>
#include <qpainterpath.h>
class QPainterPath;

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -14,6 +14,7 @@
#include <qbitmap.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qpainterpath.h>
#if QT_VERSION >= 0x050000
#if QT_VERSION < 0x050100

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -71,6 +71,8 @@
#include <qpdfwriter.h>
#endif
#include <qpainterpath.h>
static QPainterPath qwtCanvasClip(
const QWidget* canvas, const QRectF &canvasRect )
{

View File

@ -1,4 +1,4 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
@ -13,6 +13,7 @@
#include <qpaintengine.h>
#include <qimage.h>
#include <qevent.h>
#include <qpainterpath.h>
static QImage::Format qwtMaskImageFormat()
{