更新代码

master
feiyangqingyun 2021-11-25 19:59:38 +08:00
parent 8ef09c237a
commit 5921462e89
72 changed files with 166 additions and 162 deletions

View File

@ -1,11 +1,10 @@
#### 一、特别说明
#### 一、特别说明
1. 可以选择打开QWidgetDemo.pro一次性编译所有的也可以到目录下打开pro编译。
2. 如果发现有些子项目没有加载请打开对应目录下的.pro仔细看里面的注释。
3. 编译好的可执行文件在源码同级目录下的bin目录。
4. 亲测Qt4.6到Qt6.2所有版本亲测win、linux、mac、uos等系统。
5. 有少部分项目不支持部分Qt版本比如Qt6会自动跳过。
6. **本项目开源的是下面表格中描述的内容,并未开源左侧的树状导航菜单控件,只是方便展示演示效果图,直接用的自定义控件大全的效果图,懒得重新截图。**
7. **建议用git命令行下载压缩包下载后重新解压文件可能会有问题不知为何。**
6. **建议用git命令行下载压缩包下载后重新解压文件可能会有问题不知为何。**
8. **强烈推荐各位搭配Qt开发经验一起学习 [https://gitee.com/feiyangqingyun/qtkaifajingyan](https://gitee.com/feiyangqingyun/qtkaifajingyan)**
#### 二、目录说明

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -13,90 +13,68 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>11</x>
<y>11</y>
<width>481</width>
<height>63</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<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="2">
<widget class="QPushButton" name="btnPY">
<property name="text">
<string>转全拼</string>
</property>
<property name="topMargin">
<number>0</number>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txtChinese">
<property name="text">
<string>飞扬青云 QQ:517216493</string>
</property>
<property name="rightMargin">
<number>0</number>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labChinese">
<property name="text">
<string>汉字</string>
</property>
<property name="bottomMargin">
<number>0</number>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtResult"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labResult">
<property name="text">
<string>结果</string>
</property>
<item row="0" column="2">
<widget class="QPushButton" name="btnPY">
<property name="text">
<string>转全拼</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txtChinese">
<property name="text">
<string>飞扬青云 QQ:517216493</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labChinese">
<property name="text">
<string>汉字</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtResult"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labResult">
<property name="text">
<string>结果</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="btnJP">
<property name="text">
<string>转简拼</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>59</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>203</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="btnJP">
<property name="text">
<string>转简拼</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
Widget w;
w.setWindowTitle("Echart图表JS交互示例 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
Widget w;
w.setWindowTitle("回车自动跳转 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<widget class="QLineEdit" name="lineEdit1">
@ -15,30 +15,39 @@
<rect>
<x>10</x>
<y>10</y>
<width>113</width>
<width>181</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Qt自定义控件大全</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit2">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>113</width>
<width>181</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>QQ517216493</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit3">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>113</width>
<width>181</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>WXfeiyangqingyun</string>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
Widget w;
w.setWindowTitle("鼠标十字线 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
frmHotKey w;
w.setWindowTitle("全局热键示例 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
Widget w;
w.setWindowTitle("miniblink使用示例 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>749</width>
<height>456</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
frmShortCut w;
w.setWindowTitle("全局热键示例 (QQ: 517216493 WX: feiyangqingyun)");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -6,29 +6,66 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>frmMain</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListWidget" name="listWidget"/>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="lineEdit">
<property name="text">
<string>测试设备</string>
<item>
<widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="btnAdd">
<property name="text">
<string>添加</string>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="text">
<string>测试设备</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnAdd">
<property name="text">
<string>添加</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>486</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>

View File

@ -6,13 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>129</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>frmMain</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1" rowspan="2" colspan="2">
<widget class="QDateEdit" name="dateEdit">

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -6,6 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setFont(QFont("Microsoft Yahei", 9));
Widget w;
w.setWindowTitle("存款计算器 (QQ: 517216493 WX: feiyangqingyun)");

View File

@ -6,19 +6,19 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>存款计算器</string>
</property>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>381</width>
<width>431</width>
<height>86</height>
</rect>
</property>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -17,9 +17,9 @@ frmMain::~frmMain()
void frmMain::initForm()
{
int iconSize = 50;
int iconWidth = 100;
int iconHeight = 80;
int iconSize = 100;
int iconWidth = 150;
int iconHeight = 130;
QList<QString> listColorBg;
listColorBg << "#FF3739" << "#1A9FE0" << "#41BB1A" << "#1570A5" << "#FE781F" << "#9B59BB";
@ -40,7 +40,7 @@ void frmMain::initForm()
QPixmap pix = IconHelper::getPixmap(listColorText.at(i), icons.at(i), iconSize, iconWidth, iconHeight);
btn->setIcon(QIcon(pix));
btn->setText(names.at(i));
btn->setStyleSheet(QString("QToolButton{font:%1pt;color:%2;background-color:%3;border:none;border-radius:0px;}")
btn->setStyleSheet(QString("QToolButton{font:%1px;color:%2;background-color:%3;border:none;border-radius:0px;}")
.arg(iconSize / 2).arg(listColorText.at(i)).arg(listColorBg.at(i)));
connect(btn, SIGNAL(clicked(bool)), this, SLOT(buttonClicked()));

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>644</width>
<height>342</height>
<width>800</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -9,11 +9,7 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication a(argc, argv);
QFont font;
font.setFamily("MicroSoft Yahei");
font.setPixelSize(12);
a.setFont(font);
a.setFont(QFont("Microsoft Yahei", 9));
#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
#if _MSC_VER
@ -31,6 +27,7 @@ int main(int argc, char *argv[])
Widget w;
w.setWindowTitle("视频流播放ffmpeg内核 (QQ: 517216493 WX: feiyangqingyun)");
w.resize(800, 600);
w.show();
return a.exec();

View File

@ -9,12 +9,8 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
QStringList urls;
urls << "https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8";
urls << "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov";
urls << "rtsp://admin:Admin123456@192.168.0.64:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2";
urls << "rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif";
urls << "rtsp://192.168.1.15:554/media/video1";
urls << "rtsp://192.168.1.15:554/media/video2";
urls << "rtsp://192.168.1.247:554/av0_0";
urls << "rtsp://192.168.1.247:554/av0_1";
urls << "http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4";
urls << "rtsp://admin:Admin123456@192.168.0.15:554/media/video1";
ui->cboxUrl->addItems(urls);
ui->cboxUrl->setCurrentIndex(0);
}

View File

@ -6,11 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFont font;
font.setFamily("MicroSoft Yahei");
font.setPixelSize(12);
a.setFont(font);
a.setFont(QFont("Microsoft Yahei", 9));
#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
#if _MSC_VER

View File

@ -9,12 +9,8 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
QStringList urls;
urls << "https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8";
urls << "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov";
urls << "rtsp://admin:Admin123456@192.168.1.64:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2";
urls << "rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif";
urls << "rtsp://192.168.1.15:554/media/video1";
urls << "rtsp://192.168.1.15:554/media/video2";
urls << "rtsp://192.168.1.247:554/av0_0";
urls << "rtsp://192.168.1.247:554/av0_1";
urls << "http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4";
urls << "rtsp://admin:Admin123456@192.168.0.15:554/media/video1";
ui->cboxUrl->addItems(urls);
ui->cboxUrl->setCurrentIndex(0);
}

View File

@ -6,11 +6,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFont font;
font.setFamily("MicroSoft Yahei");
font.setPixelSize(12);
a.setFont(font);
a.setFont(QFont("Microsoft Yahei", 9));
#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
#if _MSC_VER

View File

@ -9,12 +9,8 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
QStringList urls;
urls << "https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8";
urls << "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov";
urls << "rtsp://admin:Admin123456@192.168.1.64:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2";
urls << "rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif";
urls << "rtsp://192.168.1.15:554/media/video1";
urls << "rtsp://192.168.1.15:554/media/video2";
urls << "rtsp://192.168.1.247:554/av0_0";
urls << "rtsp://192.168.1.247:554/av0_1";
urls << "http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4";
urls << "rtsp://admin:Admin123456@192.168.0.15:554/media/video1";
ui->cboxUrl->addItems(urls);
ui->cboxUrl->setCurrentIndex(0);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 23 KiB