提交ledok
|
@ -0,0 +1,51 @@
|
||||||
|
7-Zip 21.07
|
||||||
|
-----------
|
||||||
|
|
||||||
|
7-Zip is a file archiver for Windows.
|
||||||
|
|
||||||
|
7-Zip Copyright (C) 1999-2021 Igor Pavlov.
|
||||||
|
|
||||||
|
The main features of 7-Zip:
|
||||||
|
|
||||||
|
- High compression ratio in the new 7z format
|
||||||
|
- Supported formats:
|
||||||
|
- Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM.
|
||||||
|
- Unpacking only: AR, ARJ, Base64, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS,
|
||||||
|
IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR,
|
||||||
|
RPM, SquashFS, UDF, UEFI, VDI, VHD, VHDX, VMDK, XAR and Z.
|
||||||
|
- Fast compression and decompression
|
||||||
|
- Self-extracting capability for 7z format
|
||||||
|
- Strong AES-256 encryption in 7z and ZIP formats
|
||||||
|
- Integration with Windows Shell
|
||||||
|
- Powerful File Manager
|
||||||
|
- Powerful command line version
|
||||||
|
- Localizations for 90 languages
|
||||||
|
|
||||||
|
|
||||||
|
7-Zip is free software distributed under the GNU LGPL (except for unRar code).
|
||||||
|
Read License.txt for more information about license.
|
||||||
|
|
||||||
|
|
||||||
|
This distribution package contains the following files:
|
||||||
|
|
||||||
|
7zFM.exe - 7-Zip File Manager
|
||||||
|
7-zip.dll - Plugin for Windows Shell
|
||||||
|
7-zip32.dll - Plugin for Windows Shell (32-bit plugin for 64-bit system)
|
||||||
|
7zg.exe - GUI module
|
||||||
|
7z.exe - Command line version
|
||||||
|
7z.dll - 7-Zip engine module
|
||||||
|
7z.sfx - SFX module (Windows version)
|
||||||
|
7zCon.sfx - SFX module (Console version)
|
||||||
|
|
||||||
|
License.txt - License information
|
||||||
|
readme.txt - This file
|
||||||
|
History.txt - History of 7-Zip
|
||||||
|
7-zip.chm - User's Manual in HTML Help format
|
||||||
|
descript.ion - Description for files
|
||||||
|
|
||||||
|
Lang\en.ttt - English (base) localization file
|
||||||
|
Lang\*.txt - Localization files
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
End of document
|
|
@ -1,244 +0,0 @@
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include "BasicColorArea.h"
|
|
||||||
|
|
||||||
BasicColorArea::BasicColorArea(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
//initColorItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicColorArea::~BasicColorArea()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorArea::initColorItems(bool bAlpha)
|
|
||||||
{
|
|
||||||
BasicColorItem *pItem11 = new BasicColorItem(QColor(0, 0, 0,255));
|
|
||||||
BasicColorItem *pItem12 = new BasicColorItem(QColor(51, 51, 51,255));
|
|
||||||
BasicColorItem *pItem13 = new BasicColorItem(QColor(102, 102, 102,255));
|
|
||||||
BasicColorItem *pItem14 = new BasicColorItem(QColor(153, 153, 153,255));
|
|
||||||
BasicColorItem *pItem15 = new BasicColorItem(QColor(204, 204, 204,255));
|
|
||||||
BasicColorItem *pItem16 = new BasicColorItem(QColor(221, 221, 221,255));
|
|
||||||
BasicColorItem *pItem17 = new BasicColorItem(QColor(238, 238, 238,255));
|
|
||||||
BasicColorItem *pItem18 = new BasicColorItem(QColor(255, 255, 255,255));
|
|
||||||
QHBoxLayout *pLayout1 = new QHBoxLayout;
|
|
||||||
pLayout1->setMargin(0);
|
|
||||||
pLayout1->setSpacing(2);
|
|
||||||
pLayout1->addWidget(pItem11);
|
|
||||||
pLayout1->addWidget(pItem12);
|
|
||||||
pLayout1->addWidget(pItem13);
|
|
||||||
pLayout1->addWidget(pItem14);
|
|
||||||
pLayout1->addWidget(pItem15);
|
|
||||||
pLayout1->addWidget(pItem16);
|
|
||||||
pLayout1->addWidget(pItem17);
|
|
||||||
pLayout1->addWidget(pItem18);
|
|
||||||
|
|
||||||
// BasicColorItem *pItem21 = new BasicColorItem(QColor(207, 42, 39,255));
|
|
||||||
// BasicColorItem *pItem22 = new BasicColorItem(QColor(255, 153, 0,255));
|
|
||||||
// BasicColorItem *pItem23 = new BasicColorItem(QColor(255, 255, 0,255));
|
|
||||||
// BasicColorItem *pItem24 = new BasicColorItem(QColor(0, 158, 15,255));
|
|
||||||
// BasicColorItem *pItem25 = new BasicColorItem(QColor(0, 255, 255,255));
|
|
||||||
// BasicColorItem *pItem26 = new BasicColorItem(QColor(43, 120, 228,255));
|
|
||||||
// BasicColorItem *pItem27 = new BasicColorItem(QColor(153, 0, 255,255));
|
|
||||||
// BasicColorItem *pItem28 = new BasicColorItem(QColor(255, 0, 255,255));
|
|
||||||
BasicColorItem *pItem21 = new BasicColorItem(QColor(255, 0, 0,255));
|
|
||||||
BasicColorItem *pItem22 = new BasicColorItem(QColor(0, 255, 0,255));
|
|
||||||
BasicColorItem *pItem23 = new BasicColorItem(QColor(0, 0, 255,255));
|
|
||||||
BasicColorItem *pItem24 = new BasicColorItem(QColor(255, 255, 0,255));
|
|
||||||
BasicColorItem *pItem25 = new BasicColorItem(QColor(0, 255, 255,255));
|
|
||||||
BasicColorItem *pItem26 = new BasicColorItem(QColor(255, 0, 255,255));
|
|
||||||
BasicColorItem *pItem27 = new BasicColorItem(QColor(255, 128, 255,255));
|
|
||||||
BasicColorItem *pItem28 = new BasicColorItem(QColor(128, 0, 128,255));
|
|
||||||
|
|
||||||
QHBoxLayout *pLayout2 = new QHBoxLayout;
|
|
||||||
pLayout2->setMargin(0);
|
|
||||||
pLayout2->setSpacing(2);
|
|
||||||
pLayout2->addWidget(pItem21);
|
|
||||||
pLayout2->addWidget(pItem22);
|
|
||||||
pLayout2->addWidget(pItem23);
|
|
||||||
pLayout2->addWidget(pItem24);
|
|
||||||
pLayout2->addWidget(pItem25);
|
|
||||||
pLayout2->addWidget(pItem26);
|
|
||||||
pLayout2->addWidget(pItem27);
|
|
||||||
pLayout2->addWidget(pItem28);
|
|
||||||
|
|
||||||
BasicColorItem *pItem31 = new BasicColorItem(QColor(234, 153, 153,255));
|
|
||||||
BasicColorItem *pItem32 = new BasicColorItem(QColor(249, 203, 156,255));
|
|
||||||
BasicColorItem *pItem33 = new BasicColorItem(QColor(255, 229, 153,255));
|
|
||||||
BasicColorItem *pItem34 = new BasicColorItem(QColor(182, 215, 168,255));
|
|
||||||
BasicColorItem *pItem35 = new BasicColorItem(QColor(162, 196, 201,255));
|
|
||||||
BasicColorItem *pItem36 = new BasicColorItem(QColor(159, 197, 248,255));
|
|
||||||
BasicColorItem *pItem37 = new BasicColorItem(QColor(180, 167, 214,255));
|
|
||||||
BasicColorItem *pItem38 = new BasicColorItem(QColor(213, 166, 189,255));
|
|
||||||
QHBoxLayout *pLayout3 = new QHBoxLayout;
|
|
||||||
pLayout3->setMargin(0);
|
|
||||||
pLayout3->setSpacing(2);
|
|
||||||
pLayout3->addWidget(pItem31);
|
|
||||||
pLayout3->addWidget(pItem32);
|
|
||||||
pLayout3->addWidget(pItem33);
|
|
||||||
pLayout3->addWidget(pItem34);
|
|
||||||
pLayout3->addWidget(pItem35);
|
|
||||||
pLayout3->addWidget(pItem36);
|
|
||||||
pLayout3->addWidget(pItem37);
|
|
||||||
pLayout3->addWidget(pItem38);
|
|
||||||
|
|
||||||
BasicColorItem *pItem41 = new BasicColorItem(QColor(224, 102, 102,255));
|
|
||||||
BasicColorItem *pItem42 = new BasicColorItem(QColor(246, 178, 107,255));
|
|
||||||
BasicColorItem *pItem43 = new BasicColorItem(QColor(255, 217, 102,255));
|
|
||||||
BasicColorItem *pItem44 = new BasicColorItem(QColor(147, 196, 125,255));
|
|
||||||
BasicColorItem *pItem45 = new BasicColorItem(QColor(118, 165, 175,255));
|
|
||||||
BasicColorItem *pItem46 = new BasicColorItem(QColor(111, 168, 220,255));
|
|
||||||
BasicColorItem *pItem47 = new BasicColorItem(QColor(142, 124, 195,255));
|
|
||||||
BasicColorItem *pItem48 = new BasicColorItem(QColor(194, 123, 160,255));
|
|
||||||
QHBoxLayout *pLayout4 = new QHBoxLayout;
|
|
||||||
pLayout4->setMargin(0);
|
|
||||||
pLayout4->setSpacing(2);
|
|
||||||
pLayout4->addWidget(pItem41);
|
|
||||||
pLayout4->addWidget(pItem42);
|
|
||||||
pLayout4->addWidget(pItem43);
|
|
||||||
pLayout4->addWidget(pItem44);
|
|
||||||
pLayout4->addWidget(pItem45);
|
|
||||||
pLayout4->addWidget(pItem46);
|
|
||||||
pLayout4->addWidget(pItem47);
|
|
||||||
pLayout4->addWidget(pItem48);
|
|
||||||
|
|
||||||
BasicColorItem *pItem51 = new BasicColorItem(QColor(204, 0, 0,255));
|
|
||||||
BasicColorItem *pItem52 = new BasicColorItem(QColor(230, 145, 56,255));
|
|
||||||
BasicColorItem *pItem53 = new BasicColorItem(QColor(241, 194, 50,255));
|
|
||||||
BasicColorItem *pItem54 = new BasicColorItem(QColor(106, 168, 79,255));
|
|
||||||
BasicColorItem *pItem55 = new BasicColorItem(QColor(69, 129, 142,255));
|
|
||||||
BasicColorItem *pItem56 = new BasicColorItem(QColor(89, 126, 170,255));
|
|
||||||
BasicColorItem *pItem57 = new BasicColorItem(QColor(103, 78, 167,255));
|
|
||||||
BasicColorItem *pItem58 = new BasicColorItem(QColor(166, 77, 121,255));
|
|
||||||
QHBoxLayout *pLayout5 = new QHBoxLayout;
|
|
||||||
pLayout5->setMargin(0);
|
|
||||||
pLayout5->setSpacing(2);
|
|
||||||
pLayout5->addWidget(pItem51);
|
|
||||||
pLayout5->addWidget(pItem52);
|
|
||||||
pLayout5->addWidget(pItem53);
|
|
||||||
pLayout5->addWidget(pItem54);
|
|
||||||
pLayout5->addWidget(pItem55);
|
|
||||||
pLayout5->addWidget(pItem56);
|
|
||||||
pLayout5->addWidget(pItem57);
|
|
||||||
pLayout5->addWidget(pItem58);
|
|
||||||
|
|
||||||
BasicColorItem *pItem61 = new BasicColorItem(QColor(153, 0, 0,255));
|
|
||||||
BasicColorItem *pItem62 = new BasicColorItem(QColor(180, 95, 6,255));
|
|
||||||
BasicColorItem *pItem63 = new BasicColorItem(QColor(119, 144, 0,255));
|
|
||||||
BasicColorItem *pItem64 = new BasicColorItem(QColor(56, 118, 29,255));
|
|
||||||
BasicColorItem *pItem65 = new BasicColorItem(QColor(19, 79, 92,255));
|
|
||||||
BasicColorItem *pItem66 = new BasicColorItem(QColor(8, 83, 148,255));
|
|
||||||
BasicColorItem *pItem67 = new BasicColorItem(QColor(52, 28, 117,255));
|
|
||||||
BasicColorItem *pItem68 = new BasicColorItem(QColor(116, 27, 71,255));
|
|
||||||
QHBoxLayout *pLayout6 = new QHBoxLayout;
|
|
||||||
pLayout6->setMargin(0);
|
|
||||||
pLayout6->setSpacing(2);
|
|
||||||
pLayout6->addWidget(pItem61);
|
|
||||||
pLayout6->addWidget(pItem62);
|
|
||||||
pLayout6->addWidget(pItem63);
|
|
||||||
pLayout6->addWidget(pItem64);
|
|
||||||
pLayout6->addWidget(pItem65);
|
|
||||||
pLayout6->addWidget(pItem66);
|
|
||||||
pLayout6->addWidget(pItem67);
|
|
||||||
pLayout6->addWidget(pItem68);
|
|
||||||
|
|
||||||
BasicColorItem *pItem71 = new BasicColorItem(QColor(102, 0, 0,255));
|
|
||||||
BasicColorItem *pItem72 = new BasicColorItem(QColor(120, 63, 4,255));
|
|
||||||
BasicColorItem *pItem73 = new BasicColorItem(QColor(127, 96, 0,255));
|
|
||||||
BasicColorItem *pItem74 = new BasicColorItem(QColor(39, 78, 19,255));
|
|
||||||
BasicColorItem *pItem75 = new BasicColorItem(QColor(12, 52, 61,255));
|
|
||||||
BasicColorItem *pItem76 = new BasicColorItem(QColor(7, 55, 99,255));
|
|
||||||
BasicColorItem *pItem77 = new BasicColorItem(QColor(32, 18, 77,255));
|
|
||||||
QColor qLast=Qt::transparent;
|
|
||||||
if(bAlpha==false)
|
|
||||||
qLast=QColor(71, 17, 48,255);
|
|
||||||
|
|
||||||
BasicColorItem *pItem78 = new BasicColorItem(qLast);
|
|
||||||
QHBoxLayout *pLayout7 = new QHBoxLayout;
|
|
||||||
pLayout7->setMargin(0);
|
|
||||||
pLayout7->setSpacing(2);
|
|
||||||
pLayout7->addWidget(pItem71);
|
|
||||||
pLayout7->addWidget(pItem72);
|
|
||||||
pLayout7->addWidget(pItem73);
|
|
||||||
pLayout7->addWidget(pItem74);
|
|
||||||
pLayout7->addWidget(pItem75);
|
|
||||||
pLayout7->addWidget(pItem76);
|
|
||||||
pLayout7->addWidget(pItem77);
|
|
||||||
pLayout7->addWidget(pItem78);
|
|
||||||
|
|
||||||
QVBoxLayout *pVLayout = new QVBoxLayout(this);
|
|
||||||
pVLayout->setMargin(0);
|
|
||||||
pVLayout->setSpacing(2);
|
|
||||||
pVLayout->addLayout(pLayout1);
|
|
||||||
pVLayout->addLayout(pLayout2);
|
|
||||||
pVLayout->addLayout(pLayout3);
|
|
||||||
pVLayout->addLayout(pLayout4);
|
|
||||||
pVLayout->addLayout(pLayout5);
|
|
||||||
pVLayout->addLayout(pLayout6);
|
|
||||||
pVLayout->addLayout(pLayout7);
|
|
||||||
|
|
||||||
connect(pItem11, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem12, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem13, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem14, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem15, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem16, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem17, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem18, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem21, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem22, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem23, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem24, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem25, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem26, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem27, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem28, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem31, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem32, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem33, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem34, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem35, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem36, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem37, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem38, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem41, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem42, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem43, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem44, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem45, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem46, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem47, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem48, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem51, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem52, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem53, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem54, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem55, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem56, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem57, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem58, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem61, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem62, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem63, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem64, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem65, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem66, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem67, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem68, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem71, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem72, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem73, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem74, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem75, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem76, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem77, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem78, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
// 基本颜色区域
|
|
||||||
|
|
||||||
#ifndef BASICCOLORAREA_H
|
|
||||||
#define BASICCOLORAREA_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include "BasicColorItem.h"
|
|
||||||
|
|
||||||
class BasicColorArea : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
BasicColorArea(QWidget *parent);
|
|
||||||
~BasicColorArea();
|
|
||||||
void initColorItems(bool bAlpha);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void colorItemSelcSignal(const QColor &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BASICCOLORAREA_H
|
|
|
@ -1,90 +0,0 @@
|
||||||
#include <QPainter>
|
|
||||||
#include "BasicColorItem.h"
|
|
||||||
|
|
||||||
#define ITEM_EDGE_LENGTH 25
|
|
||||||
|
|
||||||
BasicColorItem::BasicColorItem(const QColor &c, QWidget *parent)
|
|
||||||
: QLabel(parent)
|
|
||||||
, m_bMouseIn(false)
|
|
||||||
{
|
|
||||||
setFixedSize(ITEM_EDGE_LENGTH, ITEM_EDGE_LENGTH);
|
|
||||||
setColor(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicColorItem::~BasicColorItem()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor BasicColorItem::getColor()
|
|
||||||
{
|
|
||||||
return m_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorItem::paintEvent(QPaintEvent *ev)
|
|
||||||
{
|
|
||||||
QLabel::paintEvent(ev);
|
|
||||||
if (m_bMouseIn)
|
|
||||||
{
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setCompositionMode(QPainter::CompositionMode_Source);
|
|
||||||
painter.setPen(QPen(Qt::white, 3));
|
|
||||||
painter.drawRect(1, 1, ITEM_EDGE_LENGTH - 3, ITEM_EDGE_LENGTH - 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorItem::mousePressEvent(QMouseEvent *)
|
|
||||||
{
|
|
||||||
emit itemClickedSignal(m_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorItem::enterEvent(QEvent *)
|
|
||||||
{
|
|
||||||
m_bMouseIn = true;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorItem::leaveEvent(QEvent *)
|
|
||||||
{
|
|
||||||
m_bMouseIn = false;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BasicColorItem::setColor(const QColor &c)
|
|
||||||
{
|
|
||||||
if(c==Qt::transparent)
|
|
||||||
{
|
|
||||||
QImage itemImg = QImage(ITEM_EDGE_LENGTH, ITEM_EDGE_LENGTH, QImage::Format_RGB32);
|
|
||||||
QPainter painter(&itemImg);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.setCompositionMode(QPainter::CompositionMode_Source);
|
|
||||||
painter.drawImage(0, 0, itemImg);
|
|
||||||
QPen pen;
|
|
||||||
painter.setBrush(Qt::white);
|
|
||||||
painter.drawRect(0, 0, width(), height());
|
|
||||||
|
|
||||||
//pen.setStyle(Qt::DashLine);
|
|
||||||
pen.setColor(Qt::red); // 设置画笔为黄色
|
|
||||||
painter.setPen(pen);
|
|
||||||
painter.drawLine(0,0,width()-1,height()-1);
|
|
||||||
painter.end();
|
|
||||||
this->setPixmap(QPixmap::fromImage(itemImg));
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
QImage itemImg = QImage(ITEM_EDGE_LENGTH, ITEM_EDGE_LENGTH, QImage::Format_ARGB32);
|
|
||||||
QPainter painter(&itemImg);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.setCompositionMode(QPainter::CompositionMode_Source);
|
|
||||||
painter.drawImage(0, 0, itemImg);
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
painter.setBrush(c);
|
|
||||||
painter.drawRect(0, 0, width(), height());
|
|
||||||
painter.end();
|
|
||||||
this->setPixmap(QPixmap::fromImage(itemImg));
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_color = c;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
// 基本颜色项
|
|
||||||
|
|
||||||
#ifndef BASICCOLORITEM_H
|
|
||||||
#define BASICCOLORITEM_H
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
|
|
||||||
class BasicColorItem : public QLabel
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
BasicColorItem(const QColor &, QWidget *parent = 0);
|
|
||||||
~BasicColorItem();
|
|
||||||
QColor getColor();
|
|
||||||
void setColor(const QColor &);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent *);
|
|
||||||
void mousePressEvent(QMouseEvent *ev);
|
|
||||||
void enterEvent(QEvent *);
|
|
||||||
void leaveEvent(QEvent *);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void itemClickedSignal(const QColor &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_bMouseIn;
|
|
||||||
QColor m_color;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BASICCOLORITEM_H
|
|
|
@ -1,703 +0,0 @@
|
||||||
#include <QMouseEvent>
|
|
||||||
#include "ColorDialog.h"
|
|
||||||
#include "ui_ColorDialog.h"
|
|
||||||
|
|
||||||
class ColorDialog::ColorSetting
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Ui::ColorDialog ui;
|
|
||||||
int m_iHue;
|
|
||||||
int m_iSaturation;
|
|
||||||
int m_iBrightness;
|
|
||||||
bool m_bPressed;
|
|
||||||
QPoint m_ptPress;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ColorSetting()
|
|
||||||
: m_iHue(0)
|
|
||||||
, m_iSaturation(0)
|
|
||||||
, m_iBrightness(0)
|
|
||||||
, m_bPressed(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~ColorSetting()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
ColorDialog::ColorDialog(QColor cr,bool bAlpha,QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, m_pSetting(new ColorSetting)
|
|
||||||
, m_bNotEdit(false)
|
|
||||||
{
|
|
||||||
m_pSetting->ui.setupUi(this);
|
|
||||||
m_pSetting->ui.basicColorWgt->initColorItems(bAlpha);
|
|
||||||
m_pSetting->ui.hLabel->setVisible(false);
|
|
||||||
m_pSetting->ui.hSpinBox->setVisible(false);
|
|
||||||
m_pSetting->ui.sLabel->setVisible(false);
|
|
||||||
m_pSetting->ui.sSpinBox->setVisible(false);
|
|
||||||
m_pSetting->ui.vLabel->setVisible(false);
|
|
||||||
m_pSetting->ui.vSpinBox->setVisible(false);
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
|
|
||||||
//标题
|
|
||||||
m_pTitleLbl = new QLabel(this);
|
|
||||||
m_pTitleLbl->setText(tr("Select color"));
|
|
||||||
m_pTitleLbl->setStyleSheet("background-color:rgba(206,206,206,255);color:rgba(0,0,0,255);");
|
|
||||||
//m_pTitleLbl->setFixedSize(190, 34);
|
|
||||||
// m_pTitleLbl->setStyleSheet("background-color:rgba(216,216,0,255);");
|
|
||||||
// m_pTitleLbl->setStyleSheet("color:rgba(0,0,0,255);");
|
|
||||||
m_pSetting->ui.topWgt->setStyleSheet("background-color:rgba(206,206,206,255);");
|
|
||||||
//关闭按钮
|
|
||||||
m_pCloseBtn = new QPushButton(this);
|
|
||||||
m_pCloseBtn->setFixedSize(22, 34);
|
|
||||||
m_pCloseBtn->setObjectName("m_pCloseBtn");
|
|
||||||
m_pCloseBtn->setVisible(false);
|
|
||||||
|
|
||||||
m_buttonRole = Yes;
|
|
||||||
setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
|
|
||||||
setWindowModality(Qt::WindowModal);
|
|
||||||
//setAttribute(Qt::WA_TranslucentBackground);
|
|
||||||
this->installEventFilter(this);
|
|
||||||
|
|
||||||
QRegExp rx("(\\d?[a-f]?){0,6}");
|
|
||||||
m_pSetting->ui.colorEdit->setValidator(new QRegExpValidator(rx, this));
|
|
||||||
m_pSetting->ui.colorEdit->setText("00000000");
|
|
||||||
|
|
||||||
this->setFocusPolicy(Qt::ClickFocus);
|
|
||||||
|
|
||||||
initSignalAndSlotConn();
|
|
||||||
|
|
||||||
|
|
||||||
setStyleSheet("QSpinBox::arrow{background-color:#8d8d8d;}");
|
|
||||||
|
|
||||||
m_pSetting->ui.okBtn->setProperty("ssType", "progManageTool");
|
|
||||||
m_pSetting->ui.okBtn->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
|
|
||||||
m_pSetting->ui.cancelBtn->setProperty("ssType", "progManageTool");
|
|
||||||
m_pSetting->ui.cancelBtn->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
|
|
||||||
m_pSetting->ui.addCustomColorBtn->setProperty("ssType", "progManageTool");
|
|
||||||
m_pSetting->ui.addCustomColorBtn->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
|
|
||||||
|
|
||||||
if(bAlpha==false)
|
|
||||||
{
|
|
||||||
m_pSetting->ui.aSpinBox->setVisible(false);
|
|
||||||
m_pSetting->ui.label_2->setVisible(false);
|
|
||||||
m_pSetting->ui.line->setVisible(false);
|
|
||||||
// m_pSetting->ui.line_2->setVisible(false);
|
|
||||||
cr.setAlpha(255);
|
|
||||||
}
|
|
||||||
m_pSetting->ui.previewWgt->setCurColor(cr);
|
|
||||||
colorItemSelcSlot(cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorDialog::~ColorDialog()
|
|
||||||
{
|
|
||||||
delete m_pSetting;
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorDialog::ButtonRole ColorDialog::showDialog()
|
|
||||||
{
|
|
||||||
show();
|
|
||||||
QEventLoop evtLoop;
|
|
||||||
m_pEvtLoop = &evtLoop;
|
|
||||||
evtLoop.exec();
|
|
||||||
|
|
||||||
m_pEvtLoop = NULL;
|
|
||||||
hide();
|
|
||||||
return m_buttonRole;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::setCurColor(const QColor &c)
|
|
||||||
{
|
|
||||||
colorItemSelcSlot(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor ColorDialog::getColor()
|
|
||||||
{
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(m_pSetting->m_iHue, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
QRgb ColorDialog::getRgb()
|
|
||||||
{
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(m_pSetting->m_iHue, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
return color.rgb();
|
|
||||||
}
|
|
||||||
QColor ColorDialog::getRgba()
|
|
||||||
{
|
|
||||||
|
|
||||||
return m_pSetting->ui.previewWgt->getNewColor();
|
|
||||||
}
|
|
||||||
bool ColorDialog::eventFilter(QObject *obj, QEvent *ev)
|
|
||||||
{
|
|
||||||
switch (ev->type())
|
|
||||||
{
|
|
||||||
case QEvent::MouseButtonPress:
|
|
||||||
{
|
|
||||||
QMouseEvent *e = dynamic_cast<QMouseEvent *>(ev);
|
|
||||||
if (e->pos().y() > 29)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (e->buttons() & Qt::LeftButton)
|
|
||||||
{
|
|
||||||
m_pSetting->m_bPressed = true;
|
|
||||||
m_pSetting->m_ptPress = e->globalPos() - this->frameGeometry().topLeft();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case QEvent::MouseButtonRelease:
|
|
||||||
{
|
|
||||||
m_pSetting->m_bPressed = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case QEvent::MouseMove:
|
|
||||||
{
|
|
||||||
QMouseEvent *e = dynamic_cast<QMouseEvent *>(ev);
|
|
||||||
if (m_pSetting->m_bPressed)
|
|
||||||
{
|
|
||||||
move(this->mapToGlobal(e->pos() - m_pSetting->m_ptPress));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case QEvent::Resize:
|
|
||||||
{
|
|
||||||
m_pTitleLbl->move(8, 0);
|
|
||||||
m_pCloseBtn->move(width() - 24, -8);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return QWidget::eventFilter(obj, ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::show()
|
|
||||||
{
|
|
||||||
QWidget::show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::initSignalAndSlotConn()
|
|
||||||
{
|
|
||||||
connect(m_pSetting->ui.hColorWgt, SIGNAL(hueChangedSignal(int)), m_pSetting->ui.svColorWgt, SLOT(hueChangedSlot(int)));
|
|
||||||
connect(m_pSetting->ui.svColorWgt, SIGNAL(svChangedSignal(int, int, int)), m_pSetting->ui.previewWgt, SLOT(svChangedSlot(int, int, int)));
|
|
||||||
//选中色预览窗
|
|
||||||
connect(m_pSetting->ui.previewWgt, SIGNAL(svChangedSignal(int, int, int)), this, SLOT(updateEditData(int, int, int)));
|
|
||||||
connect(m_pSetting->ui.basicColorWgt, SIGNAL(colorItemSelcSignal(const QColor &)), this, SLOT(colorItemSelcSlot(const QColor &)));
|
|
||||||
connect(m_pSetting->ui.customColorWgt, SIGNAL(colorItemSelcSignal(const QColor &)), this, SLOT(colorItemSelcSlot(const QColor &)));
|
|
||||||
connect(m_pSetting->ui.colorEdit, SIGNAL(textEdited(const QString &)), this, SLOT(editChangedSlot(const QString &)));
|
|
||||||
connect(m_pSetting->ui.colorEdit, SIGNAL(editingFinished()), this, SLOT(editFinishedSlot()));
|
|
||||||
|
|
||||||
connect(m_pSetting->ui.addCustomColorBtn, SIGNAL(clicked()), this, SLOT(addCustomColorSlot()));
|
|
||||||
connect(m_pSetting->ui.okBtn, SIGNAL(clicked()), this, SLOT(okBtnClickedSlot()));
|
|
||||||
connect(m_pSetting->ui.cancelBtn, SIGNAL(clicked()), this, SLOT(cancelBtnClickedSlot()));
|
|
||||||
connect(m_pCloseBtn, SIGNAL(clicked()), this, SLOT(cancelBtnClickedSlot()));
|
|
||||||
|
|
||||||
// connect(m_pSetting->ui.hSpinBox, SIGNAL(valueChanged(int)), this, SLOT(hValueChangedSlot(int)));
|
|
||||||
// connect(m_pSetting->ui.sSpinBox, SIGNAL(valueChanged(int)), this, SLOT(sValueChangedSlot(int)));
|
|
||||||
// connect(m_pSetting->ui.vSpinBox, SIGNAL(valueChanged(int)), this, SLOT(vValueChangedSlot(int)));
|
|
||||||
connect(m_pSetting->ui.rSpinBox, SIGNAL(valueChanged(int)), this, SLOT(rValueChangedSlot(int)));
|
|
||||||
connect(m_pSetting->ui.gSpinBox, SIGNAL(valueChanged(int)), this, SLOT(gValueChangedSlot(int)));
|
|
||||||
connect(m_pSetting->ui.bSpinBox, SIGNAL(valueChanged(int)), this, SLOT(bValueChangedSlot(int)));
|
|
||||||
connect(m_pSetting->ui.aSpinBox, SIGNAL(valueChanged(int)), this, SLOT(aValueChangedSlot(int)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::updateRGBColor(const QColor &color)
|
|
||||||
{
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
m_pSetting->ui.rSpinBox->setValue(color.red());
|
|
||||||
m_pSetting->ui.gSpinBox->setValue(color.green());
|
|
||||||
m_pSetting->ui.bSpinBox->setValue(color.blue());
|
|
||||||
m_pSetting->ui.aSpinBox->setValue(color.alpha());
|
|
||||||
|
|
||||||
QString strR = QString::number(color.red(), 16);
|
|
||||||
QString strG = QString::number(color.green(), 16);
|
|
||||||
QString strB = QString::number(color.blue(), 16);
|
|
||||||
QString strA = QString::number(color.alpha(), 16);
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ColorDialog::colorItemSelcSlot(const QColor &c)
|
|
||||||
{
|
|
||||||
if(c==Qt::transparent)
|
|
||||||
{
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(c.hue());
|
|
||||||
m_pSetting->ui.svColorWgt->setColor(c);
|
|
||||||
m_pSetting->ui.aSpinBox->setValue(0);
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(c.hue());
|
|
||||||
m_pSetting->ui.svColorWgt->setColor(c);
|
|
||||||
m_pSetting->ui.aSpinBox->setValue(c.alpha());
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::addCustomColorSlot()
|
|
||||||
{
|
|
||||||
QColor color(m_pSetting->ui.rSpinBox->value(),m_pSetting->ui.gSpinBox->value(),m_pSetting->ui.bSpinBox->value(),m_pSetting->ui.aSpinBox->value());
|
|
||||||
// color.setHsv(m_pSetting->m_iHue, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
// color.setH(m_pSetting->m_iHue, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
// color.setRgba(m_pSetting->ui.aSpinBox->value(),m_pSetting->ui.aSpinBox->value(),m_pSetting->ui.aSpinBox->value(),m_pSetting->ui.aSpinBox->value()));
|
|
||||||
m_pSetting->ui.customColorWgt->setGivenColor(m_pSetting->ui.previewWgt->getNewColor());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::okBtnClickedSlot()
|
|
||||||
{
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(m_pSetting->m_iHue, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
m_pSetting->ui.previewWgt->setCurColor(color);
|
|
||||||
|
|
||||||
m_buttonRole = Yes;
|
|
||||||
if (m_pEvtLoop != NULL)
|
|
||||||
{
|
|
||||||
m_pEvtLoop->exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::cancelBtnClickedSlot()
|
|
||||||
{
|
|
||||||
m_buttonRole = No;
|
|
||||||
if (m_pEvtLoop != NULL)
|
|
||||||
{
|
|
||||||
m_pEvtLoop->exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::editChangedSlot(const QString &strColor)
|
|
||||||
{
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
int r, g, b;
|
|
||||||
int a=255;
|
|
||||||
switch (strColor.length())
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
r = g = b = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
r = g = 0;
|
|
||||||
bool ok;
|
|
||||||
b = strColor.toInt(&ok, 16);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1%2").arg(strColor.left(1), strColor.left(1));
|
|
||||||
QString strG = QString("%1%2").arg(strColor.mid(1, 1), strColor.mid(1, 1));
|
|
||||||
QString strB = QString("%1%2").arg(strColor.right(1), strColor.right(1));
|
|
||||||
bool ok;
|
|
||||||
r = strR.toInt(&ok, 16);
|
|
||||||
g = strG.toInt(&ok, 16);
|
|
||||||
b = strB.toInt(&ok, 16);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
r = 0;
|
|
||||||
QString strG = QString("%1").arg(strColor.left(2));
|
|
||||||
QString strB = QString("%1").arg(strColor.right(2));
|
|
||||||
bool ok;
|
|
||||||
g = strG.toInt(&ok, 16);
|
|
||||||
b = strB.toInt(&ok, 16);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1").arg(strColor.left(1));
|
|
||||||
QString strG = QString("%1").arg(strColor.mid(1, 2));
|
|
||||||
QString strB = QString("%1").arg(strColor.right(2));
|
|
||||||
bool ok;
|
|
||||||
r = strR.toInt(&ok, 16);
|
|
||||||
g = strG.toInt(&ok, 16);
|
|
||||||
b = strB.toInt(&ok, 16);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1").arg(strColor.left(2));
|
|
||||||
QString strG = QString("%1").arg(strColor.mid(2, 2));
|
|
||||||
QString strB = QString("%1").arg(strColor.right(2));
|
|
||||||
bool ok;
|
|
||||||
r = strR.toInt(&ok, 16);
|
|
||||||
g = strG.toInt(&ok, 16);
|
|
||||||
b = strB.toInt(&ok, 16);
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1").arg(strColor.left(2));
|
|
||||||
QString strG = QString("%1").arg(strColor.mid(2, 2));
|
|
||||||
QString strB = QString("%1").arg(strColor.mid(2,2));
|
|
||||||
QString strA = QString("%1").arg(strColor.right(2));
|
|
||||||
bool ok;
|
|
||||||
r = strR.toInt(&ok, 16);
|
|
||||||
g = strG.toInt(&ok, 16);
|
|
||||||
b = strB.toInt(&ok, 16);
|
|
||||||
a = strA.toInt(&ok, 16);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor color;
|
|
||||||
color.setRgb(r, g, b , a);
|
|
||||||
int h, s, v;
|
|
||||||
h = m_pSetting->m_iHue = color.hue();
|
|
||||||
s = m_pSetting->m_iSaturation = color.saturation();
|
|
||||||
v = m_pSetting->m_iBrightness = color.value();
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(h);
|
|
||||||
m_pSetting->ui.svColorWgt->setHsv(h, s, v);
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
|
|
||||||
m_pSetting->ui.hSpinBox->setValue(h);
|
|
||||||
m_pSetting->ui.sSpinBox->setValue(s);
|
|
||||||
m_pSetting->ui.vSpinBox->setValue(v);
|
|
||||||
m_pSetting->ui.rSpinBox->setValue(r);
|
|
||||||
m_pSetting->ui.gSpinBox->setValue(g);
|
|
||||||
m_pSetting->ui.bSpinBox->setValue(b);
|
|
||||||
m_pSetting->ui.aSpinBox->setValue(a);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::editFinishedSlot()
|
|
||||||
{
|
|
||||||
QString strColor = m_pSetting->ui.colorEdit->text();
|
|
||||||
switch (strColor.length())
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_pSetting->ui.colorEdit->setText("000000ff");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
m_pSetting->ui.colorEdit->setText(strColor.prepend("00000"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
m_pSetting->ui.colorEdit->setText(strColor.prepend("0000"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1%2").arg(strColor.left(1), strColor.left(1));
|
|
||||||
QString strG = QString("%1%2").arg(strColor.mid(1, 1), strColor.mid(1, 1));
|
|
||||||
QString strB = QString("%1%2").arg(strColor.right(1), strColor.right(1));
|
|
||||||
m_pSetting->ui.colorEdit->setText(strR.append(strG).append(strB));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
QString strG = QString("%1").arg(strColor.left(2));
|
|
||||||
QString strB = QString("%1").arg(strColor.right(2));
|
|
||||||
m_pSetting->ui.colorEdit->setText(strG.append(strB).prepend("00"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
QString strR = QString("%1").arg(strColor.left(1));
|
|
||||||
QString strG = QString("%1").arg(strColor.mid(1, 2));
|
|
||||||
QString strB = QString("%1").arg(strColor.right(2));
|
|
||||||
m_pSetting->ui.colorEdit->setText(strR.append(strG).append(strB).prepend("0"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::hValueChangedSlot(int h)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->m_iHue = h;
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(h);
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(h, m_pSetting->m_iSaturation, m_pSetting->m_iBrightness);
|
|
||||||
m_pSetting->ui.svColorWgt->setHue(h);
|
|
||||||
updateRGBColor(color);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::sValueChangedSlot(int s)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->m_iSaturation = s;
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(m_pSetting->m_iHue, s, m_pSetting->m_iBrightness);
|
|
||||||
m_pSetting->ui.svColorWgt->setSaturation(s);
|
|
||||||
updateRGBColor(color);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::vValueChangedSlot(int v)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->m_iBrightness = v;
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(m_pSetting->m_iHue, m_pSetting->m_iSaturation, v);
|
|
||||||
m_pSetting->ui.svColorWgt->setBrightness(v);
|
|
||||||
updateRGBColor(color);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::rValueChangedSlot(int r)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
int iGreen = m_pSetting->ui.gSpinBox->value();
|
|
||||||
int iBlue = m_pSetting->ui.bSpinBox->value();
|
|
||||||
int ialpha = m_pSetting->ui.aSpinBox->value();
|
|
||||||
QColor color;
|
|
||||||
color.setRgb(r, iGreen, iBlue,ialpha);
|
|
||||||
int h = m_pSetting->m_iHue = color.hue();
|
|
||||||
int s = m_pSetting->m_iSaturation = color.saturation();
|
|
||||||
int v = m_pSetting->m_iBrightness = color.value();
|
|
||||||
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(h);
|
|
||||||
m_pSetting->ui.svColorWgt->setHsv(h, s, v);
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
|
|
||||||
m_pSetting->ui.hSpinBox->setValue(h);
|
|
||||||
m_pSetting->ui.sSpinBox->setValue(s);
|
|
||||||
m_pSetting->ui.vSpinBox->setValue(v);
|
|
||||||
|
|
||||||
|
|
||||||
QString strR = QString::number(r, 16);
|
|
||||||
QString strG = QString::number(iGreen, 16);
|
|
||||||
QString strB = QString::number(iBlue, 16);
|
|
||||||
QString strA = QString::number(ialpha, 16);
|
|
||||||
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
// QString("%1%2%3%4").arg(QString("%1").arg(strR.size() == 1 ? strR.prepend("0") : strR),
|
|
||||||
// QString("%1").arg(strG.size() == 1 ? strG.prepend("0") : strG),
|
|
||||||
// QString("%1").arg(strB.size() == 1 ? strB.prepend("0") : strB),
|
|
||||||
// QString("%1").arg(strA.size() == 1 ? strB.prepend("0") : strA) );
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::gValueChangedSlot(int g)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
int iRed = m_pSetting->ui.rSpinBox->value();
|
|
||||||
int iBlue = m_pSetting->ui.bSpinBox->value();
|
|
||||||
int ialpha = m_pSetting->ui.aSpinBox->value();
|
|
||||||
QColor color;
|
|
||||||
color.setRgb(iRed, g, iBlue,ialpha);
|
|
||||||
int h = m_pSetting->m_iHue = color.hue();
|
|
||||||
int s = m_pSetting->m_iSaturation = color.saturation();
|
|
||||||
int v = m_pSetting->m_iBrightness = color.value();
|
|
||||||
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(h);
|
|
||||||
m_pSetting->ui.svColorWgt->setHsv(h, s, v);
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
|
|
||||||
m_pSetting->ui.hSpinBox->setValue(h);
|
|
||||||
m_pSetting->ui.sSpinBox->setValue(s);
|
|
||||||
m_pSetting->ui.vSpinBox->setValue(v);
|
|
||||||
|
|
||||||
QString strR = QString::number(iRed, 16);
|
|
||||||
QString strG = QString::number(g, 16);
|
|
||||||
QString strB = QString::number(iBlue, 16);
|
|
||||||
QString strA = QString::number(ialpha, 16);
|
|
||||||
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::bValueChangedSlot(int b)
|
|
||||||
{
|
|
||||||
if (m_bNotEdit)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
int iRed = m_pSetting->ui.rSpinBox->value();
|
|
||||||
int iGreen = m_pSetting->ui.gSpinBox->value();
|
|
||||||
int ialpha = m_pSetting->ui.aSpinBox->value();
|
|
||||||
QColor color;
|
|
||||||
color.setRgb(iRed, iGreen, b,ialpha);
|
|
||||||
int h = m_pSetting->m_iHue = color.hue();
|
|
||||||
int s = m_pSetting->m_iSaturation = color.saturation();
|
|
||||||
int v = m_pSetting->m_iBrightness = color.value();
|
|
||||||
|
|
||||||
m_pSetting->ui.hColorWgt->setHue(h);
|
|
||||||
m_pSetting->ui.svColorWgt->setHsv(h, s, v);
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
|
|
||||||
m_pSetting->ui.hSpinBox->setValue(h);
|
|
||||||
m_pSetting->ui.sSpinBox->setValue(s);
|
|
||||||
m_pSetting->ui.vSpinBox->setValue(v);
|
|
||||||
|
|
||||||
QString strR = QString::number(iRed, 16);
|
|
||||||
QString strG = QString::number(iGreen, 16);
|
|
||||||
QString strB = QString::number(b, 16);
|
|
||||||
QString strA = QString::number(ialpha, 16);
|
|
||||||
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
||||||
void ColorDialog::aValueChangedSlot(int a)
|
|
||||||
{
|
|
||||||
int iRed = m_pSetting->ui.rSpinBox->value();
|
|
||||||
int iGreen = m_pSetting->ui.gSpinBox->value();
|
|
||||||
int iBlue = m_pSetting->ui.bSpinBox->value();
|
|
||||||
QColor color;
|
|
||||||
color.setRgb(iRed, iGreen, iBlue,a);
|
|
||||||
m_pSetting->ui.previewWgt->setNewColor(color);
|
|
||||||
QString strR = QString::number(iRed, 16);
|
|
||||||
QString strG = QString::number(iGreen, 16);
|
|
||||||
QString strB = QString::number(iBlue, 16);
|
|
||||||
QString strA = QString::number(a, 16);
|
|
||||||
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorDialog::updateEditData(int h, int s, int v)
|
|
||||||
{
|
|
||||||
m_bNotEdit = true;
|
|
||||||
|
|
||||||
m_pSetting->m_iHue = h;
|
|
||||||
m_pSetting->m_iSaturation = s;
|
|
||||||
m_pSetting->m_iBrightness = v;
|
|
||||||
QColor color;
|
|
||||||
color.setHsv(h, s, v);
|
|
||||||
m_pSetting->ui.hSpinBox->setValue(h);
|
|
||||||
m_pSetting->ui.sSpinBox->setValue(s);
|
|
||||||
m_pSetting->ui.vSpinBox->setValue(v);
|
|
||||||
m_pSetting->ui.rSpinBox->setValue(color.red());
|
|
||||||
m_pSetting->ui.gSpinBox->setValue(color.green());
|
|
||||||
m_pSetting->ui.bSpinBox->setValue(color.blue());
|
|
||||||
|
|
||||||
|
|
||||||
QString strR = QString::number(color.red(), 16);
|
|
||||||
QString strG = QString::number(color.green(), 16);
|
|
||||||
QString strB = QString::number(color.blue(), 16);
|
|
||||||
QString strA = QString::number(m_pSetting->ui.aSpinBox->value(), 16);
|
|
||||||
if(strR.length()==1)
|
|
||||||
strR.prepend("0");
|
|
||||||
if(strG.length()==1)
|
|
||||||
strG.prepend("0");
|
|
||||||
if(strB.length()==1)
|
|
||||||
strB.prepend("0");
|
|
||||||
if(strA.length()==1)
|
|
||||||
strA.prepend("0");
|
|
||||||
QString strRgb = strR+strG+strB+strA;
|
|
||||||
m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
// QString strRgb = QString("%1%2%3%4").arg(QString("%1").arg(strR.size() == 1 ? strR.prepend("0") : strR),
|
|
||||||
// QString("%1").arg(strG.size() == 1 ? strG.prepend("0") : strG),
|
|
||||||
// QString("%1").arg(strB.size() == 1 ? strB.prepend("0") : strB),
|
|
||||||
// QString("%1").arg(strA.size() == 1 ? strB.prepend("0") : strA) );
|
|
||||||
// m_pSetting->ui.colorEdit->setText(strRgb);
|
|
||||||
|
|
||||||
m_bNotEdit = false;
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
#ifndef COLORDIALOG_H
|
|
||||||
#define COLORDIALOG_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QEventLoop>
|
|
||||||
|
|
||||||
class ColorDialog : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
enum ButtonRole{Yes, No};
|
|
||||||
ColorDialog(QColor cr,bool bAlpha,QWidget *parent = nullptr);
|
|
||||||
~ColorDialog();
|
|
||||||
ButtonRole showDialog();
|
|
||||||
void setCurColor(const QColor &);
|
|
||||||
QColor getColor();
|
|
||||||
QRgb getRgb();
|
|
||||||
QColor getRgba();
|
|
||||||
ButtonRole m_buttonRole;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool eventFilter(QObject *, QEvent *);
|
|
||||||
void show();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initSignalAndSlotConn();
|
|
||||||
void updateRGBColor(const QColor &);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void colorItemSelcSlot(const QColor &);
|
|
||||||
void addCustomColorSlot();
|
|
||||||
void okBtnClickedSlot();
|
|
||||||
void cancelBtnClickedSlot();
|
|
||||||
void editChangedSlot(const QString &);
|
|
||||||
void editFinishedSlot();
|
|
||||||
|
|
||||||
void hValueChangedSlot(int);
|
|
||||||
void sValueChangedSlot(int);
|
|
||||||
void vValueChangedSlot(int);
|
|
||||||
void rValueChangedSlot(int);
|
|
||||||
void gValueChangedSlot(int);
|
|
||||||
void bValueChangedSlot(int);
|
|
||||||
void aValueChangedSlot(int);
|
|
||||||
void updateEditData(int, int, int);
|
|
||||||
|
|
||||||
private:
|
|
||||||
class ColorSetting;
|
|
||||||
ColorSetting * const m_pSetting;
|
|
||||||
QLabel *m_pTitleLbl;
|
|
||||||
QPushButton *m_pCloseBtn;
|
|
||||||
QEventLoop *m_pEvtLoop;
|
|
||||||
bool m_bNotEdit;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // COLORDIALOG_H
|
|
|
@ -1,934 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ColorDialog</class>
|
|
||||||
<widget class="QWidget" name="ColorDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>752</width>
|
|
||||||
<height>415</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>ColorDialog</string>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">/*主界面样式表*/
|
|
||||||
QWidget
|
|
||||||
{
|
|
||||||
border:none;
|
|
||||||
color:white;
|
|
||||||
font-family:微软雅黑;
|
|
||||||
font-size:14px;
|
|
||||||
outline:0px;
|
|
||||||
background:transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
#topWgt
|
|
||||||
{
|
|
||||||
border-width:4 4 4 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
主体背景
|
|
||||||
*/
|
|
||||||
#mainWgt
|
|
||||||
{
|
|
||||||
border-width:4 4 4 4;
|
|
||||||
}
|
|
||||||
QLineEdit
|
|
||||||
{
|
|
||||||
background:#25272b;
|
|
||||||
border:1px solid #276d94;
|
|
||||||
padding-left:5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QGroupBox
|
|
||||||
{
|
|
||||||
border:2px solid #276d94;
|
|
||||||
margin-top:10px;
|
|
||||||
}
|
|
||||||
QGroupBox::title
|
|
||||||
{
|
|
||||||
left:10px;
|
|
||||||
bottom:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*1-按钮开始*/
|
|
||||||
QPushButton
|
|
||||||
{
|
|
||||||
background:#b82525;
|
|
||||||
border-radius:3px;
|
|
||||||
padding-top:-2px;
|
|
||||||
}
|
|
||||||
QPushButton:hover
|
|
||||||
{
|
|
||||||
background:#d4352d;
|
|
||||||
}
|
|
||||||
QPushButton:pressed
|
|
||||||
{
|
|
||||||
background:#ab2922;
|
|
||||||
}
|
|
||||||
/*1-按钮结束*/
|
|
||||||
|
|
||||||
QSpinBox
|
|
||||||
{
|
|
||||||
border:1px solid #276d94;
|
|
||||||
background-color:#25272b;
|
|
||||||
min-height: 26px;
|
|
||||||
min-width: 70px;
|
|
||||||
}
|
|
||||||
QSpinBox::up-arrow
|
|
||||||
{
|
|
||||||
border-left:8px solid #25272b;
|
|
||||||
border-right:8px solid #25272b;
|
|
||||||
border-bottom:8px solid #276d94;
|
|
||||||
width:0px;
|
|
||||||
height: 0px;
|
|
||||||
}
|
|
||||||
QSpinBox::up-arrow:pressed
|
|
||||||
{
|
|
||||||
border-bottom:9px solid #81c3d7;
|
|
||||||
}
|
|
||||||
QSpinBox::up-button
|
|
||||||
{
|
|
||||||
margin-right:4px;
|
|
||||||
min-width: 16px;
|
|
||||||
min-height: 13px;
|
|
||||||
background-color:#25272b;
|
|
||||||
}
|
|
||||||
QSpinBox::down-arrow
|
|
||||||
{
|
|
||||||
border-left:8px solid #25272b;
|
|
||||||
border-right:8px solid #25272b;
|
|
||||||
border-top:8px solid #276d94;
|
|
||||||
width:0px;
|
|
||||||
height: 0px;
|
|
||||||
}
|
|
||||||
QSpinBox::down-arrow:pressed
|
|
||||||
{
|
|
||||||
border-top:9px solid #81c3d7;
|
|
||||||
}
|
|
||||||
QSpinBox::down-button
|
|
||||||
{
|
|
||||||
margin-right:4px;
|
|
||||||
min-width:16px;
|
|
||||||
min-height:13px;
|
|
||||||
background-color:#25272b;
|
|
||||||
}</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<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="QWidget" name="topWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background-color: rgb(216, 216, 216);</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="hLabel">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>250</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Tone(H):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="sLabel">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>330</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Saturation(S):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="vLabel">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>400</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Brightness(V):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSpinBox" name="hSpinBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>480</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string>度</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>360</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSpinBox" name="sSpinBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>560</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSpinBox" name="vSpinBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>630</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="mainWgt" native="true">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background-color: rgb(216, 216, 216);
|
|
||||||
color: rgb(0, 0, 0);</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QGroupBox" name="basicGroup">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>12</x>
|
|
||||||
<y>5</y>
|
|
||||||
<width>228</width>
|
|
||||||
<height>216</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Basic color</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="BasicColorArea" name="basicColorWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>214</width>
|
|
||||||
<height>191</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>214</width>
|
|
||||||
<height>191</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="customGroup">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>12</x>
|
|
||||||
<y>232</y>
|
|
||||||
<width>228</width>
|
|
||||||
<height>81</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Custom color</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="CustomColorArea" name="customColorWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>214</width>
|
|
||||||
<height>52</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>214</width>
|
|
||||||
<height>52</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>17</x>
|
|
||||||
<y>327</y>
|
|
||||||
<width>220</width>
|
|
||||||
<height>30</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>12</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>12</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>#</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="colorEdit">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="addCustomColorBtn">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add to custom</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget1">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>253</x>
|
|
||||||
<y>7</y>
|
|
||||||
<width>491</width>
|
|
||||||
<height>272</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="SVColorArea" name="svColorWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>256</width>
|
|
||||||
<height>256</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>256</width>
|
|
||||||
<height>256</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="HColorArea" name="hColorWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>34</width>
|
|
||||||
<height>270</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>34</width>
|
|
||||||
<height>270</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<property name="verticalSpacing">
|
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="rSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="bLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Blue(B):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="gLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Green(G):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="gSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="bSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="rLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>66</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Red(R):</string>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>2</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border-top: 1px solid gray; </string>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>transparency:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="aSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>72</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>70</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="accelerated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>266</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>260</width>
|
|
||||||
<height>70</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="curColorLbl">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cur color</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="PreviewColorArea" name="previewWgt" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>166</width>
|
|
||||||
<height>68</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>166</width>
|
|
||||||
<height>68</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="newColorLbl">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>New color</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>590</x>
|
|
||||||
<y>320</y>
|
|
||||||
<width>138</width>
|
|
||||||
<height>28</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="okBtn">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>62</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>62</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Ok</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="cancelBtn">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>62</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>62</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>BasicColorArea</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">ColorDialog\basiccolorarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>CustomColorArea</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>ColorDialog\customcolorarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>SVColorArea</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>ColorDialog\svcolorarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>HColorArea</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>ColorDialog\hcolorarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>PreviewColorArea</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>ColorDialog\previewcolorarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -1,113 +0,0 @@
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include "CustomColorArea.h"
|
|
||||||
|
|
||||||
CustomColorArea::CustomColorArea(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, m_iCurIndex(0)
|
|
||||||
{
|
|
||||||
initColorItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomColorArea::~CustomColorArea()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CustomColorArea::setGivenColor(const QColor &c)
|
|
||||||
{
|
|
||||||
int iIndex = m_iCurIndex % 16;
|
|
||||||
BasicColorItem *pCurItem = m_mapIndexToItem[iIndex];
|
|
||||||
pCurItem->setColor(c);
|
|
||||||
m_iCurIndex++;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CustomColorArea::initColorItems()
|
|
||||||
{
|
|
||||||
BasicColorItem *pItem11 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem12 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem13 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem14 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem15 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem16 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem17 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem18 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
QHBoxLayout *pLayout1 = new QHBoxLayout;
|
|
||||||
pLayout1->setMargin(0);
|
|
||||||
pLayout1->setSpacing(2);
|
|
||||||
pLayout1->addWidget(pItem11);
|
|
||||||
pLayout1->addWidget(pItem12);
|
|
||||||
pLayout1->addWidget(pItem13);
|
|
||||||
pLayout1->addWidget(pItem14);
|
|
||||||
pLayout1->addWidget(pItem15);
|
|
||||||
pLayout1->addWidget(pItem16);
|
|
||||||
pLayout1->addWidget(pItem17);
|
|
||||||
pLayout1->addWidget(pItem18);
|
|
||||||
|
|
||||||
BasicColorItem *pItem21 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem22 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem23 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem24 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem25 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem26 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem27 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
BasicColorItem *pItem28 = new BasicColorItem(QColor(255, 255, 255, 255));
|
|
||||||
QHBoxLayout *pLayout2 = new QHBoxLayout;
|
|
||||||
pLayout2->setMargin(0);
|
|
||||||
pLayout2->setSpacing(2);
|
|
||||||
pLayout2->addWidget(pItem21);
|
|
||||||
pLayout2->addWidget(pItem22);
|
|
||||||
pLayout2->addWidget(pItem23);
|
|
||||||
pLayout2->addWidget(pItem24);
|
|
||||||
pLayout2->addWidget(pItem25);
|
|
||||||
pLayout2->addWidget(pItem26);
|
|
||||||
pLayout2->addWidget(pItem27);
|
|
||||||
pLayout2->addWidget(pItem28);
|
|
||||||
|
|
||||||
QVBoxLayout *pVLayout = new QVBoxLayout(this);
|
|
||||||
pVLayout->setMargin(0);
|
|
||||||
pVLayout->setSpacing(2);
|
|
||||||
pVLayout->addLayout(pLayout1);
|
|
||||||
pVLayout->addLayout(pLayout2);
|
|
||||||
|
|
||||||
m_mapIndexToItem.insert(0, pItem11);
|
|
||||||
m_mapIndexToItem.insert(1, pItem21);
|
|
||||||
m_mapIndexToItem.insert(2, pItem12);
|
|
||||||
m_mapIndexToItem.insert(3, pItem22);
|
|
||||||
m_mapIndexToItem.insert(4, pItem13);
|
|
||||||
m_mapIndexToItem.insert(5, pItem23);
|
|
||||||
m_mapIndexToItem.insert(6, pItem14);
|
|
||||||
m_mapIndexToItem.insert(7, pItem24);
|
|
||||||
m_mapIndexToItem.insert(8, pItem15);
|
|
||||||
m_mapIndexToItem.insert(9, pItem25);
|
|
||||||
m_mapIndexToItem.insert(10, pItem16);
|
|
||||||
m_mapIndexToItem.insert(11, pItem26);
|
|
||||||
m_mapIndexToItem.insert(12, pItem17);
|
|
||||||
m_mapIndexToItem.insert(13, pItem27);
|
|
||||||
m_mapIndexToItem.insert(14, pItem18);
|
|
||||||
m_mapIndexToItem.insert(15, pItem28);
|
|
||||||
|
|
||||||
connect(pItem11, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem12, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem13, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem14, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem15, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem16, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem17, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem18, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
|
|
||||||
connect(pItem21, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem22, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem23, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem24, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem25, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem26, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem27, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
connect(pItem28, SIGNAL(itemClickedSignal(const QColor &)), this, SIGNAL(colorItemSelcSignal(const QColor &)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void CustomColorArea::setGivenItemColor(int iIndex, const QColor &c)
|
|
||||||
{
|
|
||||||
BasicColorItem *pCurItem = m_mapIndexToItem[iIndex];
|
|
||||||
pCurItem->setColor(c);
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
// 自定义颜色区域
|
|
||||||
|
|
||||||
#ifndef CUSTOMCOLORAREA_H
|
|
||||||
#define CUSTOMCOLORAREA_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QMap>
|
|
||||||
#include "BasicColorItem.h"
|
|
||||||
|
|
||||||
class CustomColorArea : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
CustomColorArea(QWidget *parent);
|
|
||||||
~CustomColorArea();
|
|
||||||
void setGivenColor(const QColor &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initColorItems();
|
|
||||||
void setGivenItemColor(int iIndex, const QColor &);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void colorItemSelcSignal(const QColor &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QMap<int, BasicColorItem *> m_mapIndexToItem;
|
|
||||||
int m_iCurIndex;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CUSTOMCOLORAREA_H
|
|
|
@ -1,77 +0,0 @@
|
||||||
#include <QPainter>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QLinearGradient>
|
|
||||||
#include <QtMath>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "HColorArea.h"
|
|
||||||
|
|
||||||
HColorArea::HColorArea(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, m_hue(0.0)
|
|
||||||
, m_iHue(0)
|
|
||||||
{
|
|
||||||
createHuePixmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
HColorArea::~HColorArea()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void HColorArea::setHue(int h)
|
|
||||||
{
|
|
||||||
m_hue = (double)h / 360;
|
|
||||||
m_iHue = h;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HColorArea::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.drawPixmap(0, 0, m_huePixmap);
|
|
||||||
|
|
||||||
int iHeight = m_iColorHeight - m_hue * m_iColorHeight;
|
|
||||||
QPolygonF triangle;
|
|
||||||
triangle.append(QPointF(m_iColorWidth, iHeight + topMargin));
|
|
||||||
triangle.append(QPointF(width(), iHeight));
|
|
||||||
triangle.append(QPointF(width(), iHeight + 2 * topMargin - 1));
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
painter.setBrush(Qt::white);
|
|
||||||
painter.drawPolygon(triangle);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HColorArea::mousePressEvent(QMouseEvent *ev)
|
|
||||||
{
|
|
||||||
double tempValue = 1 - (double)(ev->pos().y() - topMargin) / m_iColorHeight;
|
|
||||||
m_hue = qBound(0.0, tempValue, 1.0);
|
|
||||||
update();
|
|
||||||
m_iHue = m_hue * 360;
|
|
||||||
emit hueChangedSignal(m_iHue);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HColorArea::mouseMoveEvent(QMouseEvent *ev)
|
|
||||||
{
|
|
||||||
double tempValue = 1 - (double)(ev->pos().y() - topMargin) / m_iColorHeight;
|
|
||||||
m_hue = qBound(0.0, tempValue, 1.0);
|
|
||||||
update();
|
|
||||||
m_iHue = m_hue * 360;
|
|
||||||
emit hueChangedSignal(m_iHue);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HColorArea::createHuePixmap()
|
|
||||||
{
|
|
||||||
m_huePixmap = QPixmap(34, 270);
|
|
||||||
m_huePixmap.fill(Qt::transparent);
|
|
||||||
QPainter painter(&m_huePixmap);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
QLinearGradient hueGradient(0, m_iColorHeight, 0, 0);
|
|
||||||
for (double i = 0; i < 1.0; i += 1.0 / 16)
|
|
||||||
{
|
|
||||||
hueGradient.setColorAt(i, QColor::fromHsvF(i, 1, 1, 1));
|
|
||||||
}
|
|
||||||
hueGradient.setColorAt(1, QColor::fromHsvF(0, 1, 1, 1));
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
painter.setBrush(QBrush(hueGradient));
|
|
||||||
painter.drawRect(0, topMargin, m_iColorWidth, m_iColorHeight);
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
/*
|
|
||||||
功能:界面中的色调区域
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HCOLORAREA_H
|
|
||||||
#define HCOLORAREA_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class HColorArea : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
HColorArea(QWidget *parent);
|
|
||||||
~HColorArea();
|
|
||||||
void setHue(int);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent *);
|
|
||||||
void mousePressEvent(QMouseEvent *);
|
|
||||||
void mouseMoveEvent(QMouseEvent *);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void createHuePixmap(); //创建pixmap
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void hueChangedSignal(int); //色调值改变发出信号
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPixmap m_huePixmap;
|
|
||||||
double m_hue;
|
|
||||||
int m_iHue;
|
|
||||||
const int m_iColorHeight=256; //颜色区域的高度
|
|
||||||
const int m_iColorWidth=25; //颜色区域的宽度
|
|
||||||
const int topMargin = 7;
|
|
||||||
const int rightMargin = 9;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // HCOLORAREA_H
|
|
|
@ -1,55 +0,0 @@
|
||||||
#include <QStylePainter>
|
|
||||||
#include "PreviewColorArea.h"
|
|
||||||
|
|
||||||
PreviewColorArea::PreviewColorArea(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, m_curColor(Qt::black)
|
|
||||||
, m_newColor(Qt::black)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PreviewColorArea::~PreviewColorArea()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::setCurColor(const QColor &c)
|
|
||||||
{
|
|
||||||
m_curColor = c;
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::setNewColor(const QColor &c)
|
|
||||||
{
|
|
||||||
m_newColor = c;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QStylePainter painter(this);
|
|
||||||
paint(painter, geometry());
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::resizeEvent(QResizeEvent *)
|
|
||||||
{
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::paint(QPainter &painter, QRect rect) const
|
|
||||||
{
|
|
||||||
int iMiddleWidth = rect.width() / 2;
|
|
||||||
int iHeight = rect.height();
|
|
||||||
painter.fillRect(0, 0, iMiddleWidth, iHeight, m_curColor);
|
|
||||||
painter.fillRect(iMiddleWidth, 0, iMiddleWidth, iHeight, m_newColor);
|
|
||||||
painter.setPen(QPen(Qt::black, 1));
|
|
||||||
painter.drawRect(0, 0, width() - 1, height() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreviewColorArea::svChangedSlot(int h, int s, int v)
|
|
||||||
{
|
|
||||||
m_newColor.setHsv(h, s, v);
|
|
||||||
update();
|
|
||||||
emit svChangedSignal(h, s, v);
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
// 颜色预览区域
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef PREVIEWCOLORAREA_H
|
|
||||||
#define PREVIEWCOLORAREA_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class PreviewColorArea : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
PreviewColorArea(QWidget *parent);
|
|
||||||
~PreviewColorArea();
|
|
||||||
|
|
||||||
void setCurColor(const QColor &);
|
|
||||||
void setNewColor(const QColor &);
|
|
||||||
QColor getNewColor(){ return m_newColor;}
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent *);
|
|
||||||
void resizeEvent(QResizeEvent *);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void paint(QPainter &painter, QRect) const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void svChangedSlot(int, int, int);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void svChangedSignal(int, int, int);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QColor m_curColor;
|
|
||||||
QColor m_newColor;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // PREVIEWCOLORAREA_H
|
|
|
@ -1,132 +0,0 @@
|
||||||
#include <QPainter>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QtMath>
|
|
||||||
#include "SVColorArea.h"
|
|
||||||
|
|
||||||
SVColorArea::SVColorArea(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, m_iHue(0)
|
|
||||||
, m_iSaturation(0)
|
|
||||||
, m_iBrightness(0)
|
|
||||||
, m_iAreaWidth(256)
|
|
||||||
{
|
|
||||||
createSVPixmap();
|
|
||||||
createVPixmap();
|
|
||||||
updateSVPixmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
SVColorArea::~SVColorArea()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::setHue(int h)
|
|
||||||
{
|
|
||||||
m_iHue = h;
|
|
||||||
updateSVPixmap();
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::setSaturation(int s)
|
|
||||||
{
|
|
||||||
m_iSaturation = s;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::setBrightness(int v)
|
|
||||||
{
|
|
||||||
m_iBrightness = v;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::setHsv(int h, int s, int v)
|
|
||||||
{
|
|
||||||
m_iHue = h;
|
|
||||||
m_iSaturation = s;
|
|
||||||
m_iBrightness = v;
|
|
||||||
updateSVPixmap();
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::setColor(const QColor &c)
|
|
||||||
{
|
|
||||||
m_iHue = c.hue();
|
|
||||||
m_iSaturation = c.saturation();
|
|
||||||
m_iBrightness = c.value();
|
|
||||||
updateSVPixmap();
|
|
||||||
emit svChangedSignal(m_iHue, m_iSaturation, m_iBrightness);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
//画正方形的颜色区域
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.drawPixmap(0, 0, m_svPixmap);
|
|
||||||
painter.drawPixmap(0, 0, m_vPixmap);
|
|
||||||
|
|
||||||
//画颜色选取点的圆圈(亮度>128为黑色;<128为白色)
|
|
||||||
painter.setPen(QPen(m_iBrightness > 128 ? Qt::black : Qt::white, 2));
|
|
||||||
QPointF selecPos = QPointF(m_iSaturation, 255 - m_iBrightness);
|
|
||||||
painter.drawEllipse(selecPos, 6, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::mousePressEvent(QMouseEvent *ev)
|
|
||||||
{
|
|
||||||
m_iSaturation = qBound(0, ev->x(), 255);
|
|
||||||
m_iBrightness = qBound(0, 255 - ev->y(), 255);
|
|
||||||
emit svChangedSignal(m_iHue, m_iSaturation, m_iBrightness);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::mouseMoveEvent(QMouseEvent *ev)
|
|
||||||
{
|
|
||||||
m_iSaturation = qBound(0, ev->x(), 255);
|
|
||||||
m_iBrightness = qBound(0, 255 - ev->y(), 255);
|
|
||||||
emit svChangedSignal(m_iHue, m_iSaturation, m_iBrightness);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::createVPixmap()
|
|
||||||
{
|
|
||||||
m_vPixmap = QPixmap(m_iAreaWidth, m_iAreaWidth);
|
|
||||||
m_vPixmap.fill(Qt::transparent);
|
|
||||||
QPainter painter(&m_vPixmap);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.setCompositionMode(QPainter::CompositionMode_Source);
|
|
||||||
QLinearGradient vGradient(0, 0, 0, m_iAreaWidth);
|
|
||||||
vGradient.setColorAt(0, QColor(0, 0, 0, 0));
|
|
||||||
vGradient.setColorAt(1, QColor(0, 0, 0, 255));
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
painter.setBrush(QBrush(vGradient));
|
|
||||||
painter.drawRect(0, 0, m_iAreaWidth, m_iAreaWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::createSVPixmap()
|
|
||||||
{
|
|
||||||
m_svPixmap = QPixmap(m_iAreaWidth, m_iAreaWidth);
|
|
||||||
m_svPixmap.fill(Qt::transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::updateSVPixmap()
|
|
||||||
{
|
|
||||||
QColor newColor;
|
|
||||||
newColor.setHsv(m_iHue, 255, 255);
|
|
||||||
QPainter painter(&m_svPixmap);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
QLinearGradient svGradient(0, 0, m_iAreaWidth, 0);
|
|
||||||
svGradient.setColorAt(1, newColor);
|
|
||||||
svGradient.setColorAt(0, QColor("#ffffff"));
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
painter.setBrush(QBrush(svGradient));
|
|
||||||
painter.drawRect(0, 0, m_iAreaWidth, m_iAreaWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SVColorArea::hueChangedSlot(int h)
|
|
||||||
{
|
|
||||||
m_iHue = h;
|
|
||||||
updateSVPixmap();
|
|
||||||
emit svChangedSignal(m_iHue, m_iSaturation, m_iBrightness);
|
|
||||||
update();
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
|
|
||||||
/*
|
|
||||||
功能:界面中的饱和度(S)与亮度(V)区域
|
|
||||||
大小256 * 256
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SVCOLORAREA_H
|
|
||||||
#define SVCOLORAREA_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class SVColorArea : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
SVColorArea(QWidget *parent);
|
|
||||||
~SVColorArea();
|
|
||||||
void setHue(int);
|
|
||||||
void setSaturation(int);
|
|
||||||
void setBrightness(int);
|
|
||||||
void setHsv(int, int, int);
|
|
||||||
void setColor(const QColor &);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void paintEvent(QPaintEvent *); //paint事件
|
|
||||||
void mousePressEvent(QMouseEvent *); //鼠标按下事件
|
|
||||||
void mouseMoveEvent(QMouseEvent *); //鼠标移动事件
|
|
||||||
|
|
||||||
private:
|
|
||||||
void drawSVPixmap();
|
|
||||||
void createVPixmap(); //创建亮度渐变的pixmap
|
|
||||||
void createSVPixmap(); //创建正方形区域的pixmap
|
|
||||||
void updateSVPixmap(); //更新正方形区域的pixmap
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void hueChangedSlot(int);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void svChangedSignal(int, int, int);
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_iHue;
|
|
||||||
int m_iSaturation;
|
|
||||||
int m_iBrightness;
|
|
||||||
const int m_iAreaWidth; //正方形区域的宽度
|
|
||||||
QPixmap m_svPixmap; //正方形区域的pixmap
|
|
||||||
QPixmap m_vPixmap; //亮度渐变的pixmap
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // SVCOLORAREA_H
|
|
Before Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 65 KiB |
|
@ -1,216 +0,0 @@
|
||||||
#
|
|
||||||
# This file is part of JQLibrary
|
|
||||||
#
|
|
||||||
# Copyright: Jason
|
|
||||||
#
|
|
||||||
# Contact email: 188080501@qq.com
|
|
||||||
#
|
|
||||||
# GNU Lesser General Public License Usage
|
|
||||||
# Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
# General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
# Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
# LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
# following information to ensure the GNU Lesser General Public License
|
|
||||||
# requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
#
|
|
||||||
|
|
||||||
QT *= core gui
|
|
||||||
|
|
||||||
CONFIG *= c++11
|
|
||||||
|
|
||||||
INCLUDEPATH *= \
|
|
||||||
$$PWD/include/
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQBarcode.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQBarcode.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQBarcode.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, bluetooth ) : exists( $$PWD/src/JQBluetooth.cpp ) {
|
|
||||||
|
|
||||||
mac | ios {
|
|
||||||
DEFINES += JQBLUETOOTH_UUIDMODE
|
|
||||||
}
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQBluetooth.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQBluetooth.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQChecksum.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQChecksum.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQChecksum.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQExcel.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQExcel.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQExcel.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQFile.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQFile.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQFile.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unix | linux | mingw {
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQFilePack.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQFilePack.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQFilePack.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQFoundation.cpp ) {
|
|
||||||
|
|
||||||
DEFINES += JQFOUNDATION_LIB
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQFoundation.h
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/jqdeclare.hpp
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQFoundation.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/jqgpio.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/jqgpio.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/jqgpio.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, network ) : contains( QT, concurrent ) : exists( $$PWD/src/JQHttpServer.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQHttpServer.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQHttpServer.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ios : exists( $$PWD/src/JQiOS.cpp ) {
|
|
||||||
|
|
||||||
LIBS *= -framework Foundation -framework UIKit
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQiOS.h
|
|
||||||
|
|
||||||
OBJECTIVE_SOURCES *= $$PWD/src/JQiOS.mm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQLanguage.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQLanguage.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQLanguage.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, network ) : exists( $$PWD/src/JQNet.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQNet.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQNet.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, serialport ) : exists( $$PWD/src/JQSerialPort.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQSerialPort.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQSerialPort.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQSettings.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQSettings.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQSettings.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/JQSms.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQSms.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQSms.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, network ) : exists( $$PWD/src/JQSystemFlag.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQSystemFlag.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQSystemFlag.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exists( $$PWD/src/jqthread.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/jqthread.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/jqthread.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( QT, webenginewidgets ) : exists( $$PWD/src/JQWebEngine.cpp ) {
|
|
||||||
|
|
||||||
!contains( DEFINES, JQLIBRARY_EXPORT_ENABLE ) | contains( DEFINES, JQLIBRARY_EXPORT_MODE ) {
|
|
||||||
|
|
||||||
HEADERS *= $$PWD/include/JQWebEngine.h
|
|
||||||
|
|
||||||
SOURCES *= $$PWD/src/JQWebEngine.cpp
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
#include "jqdeclare.hpp"
|
|
|
@ -1,282 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of JQLibrary
|
|
||||||
|
|
||||||
Copyright: Jason
|
|
||||||
|
|
||||||
Contact email: 188080501@qq.com
|
|
||||||
|
|
||||||
GNU Lesser General Public License Usage
|
|
||||||
Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
following information to ensure the GNU Lesser General Public License
|
|
||||||
requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JQHTTPSERVER_H_
|
|
||||||
#define JQHTTPSERVER_H_
|
|
||||||
|
|
||||||
#ifndef QT_NETWORK_LIB
|
|
||||||
# error("Please add network in pro file")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef QT_CONCURRENT_LIB
|
|
||||||
# error("Please add concurrent in pro file")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// C++ lib import
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
// Qt lib import
|
|
||||||
#include <QObject>
|
|
||||||
#include <QSharedPointer>
|
|
||||||
#include <QPointer>
|
|
||||||
#include <QVector>
|
|
||||||
#include <QMap>
|
|
||||||
#include <QSet>
|
|
||||||
#include <QMutex>
|
|
||||||
#include <QHostAddress>
|
|
||||||
#include <QUrl>
|
|
||||||
|
|
||||||
// JQLibrary lib import
|
|
||||||
#include <JQDeclare>
|
|
||||||
|
|
||||||
class QIODevice;
|
|
||||||
class QThreadPool;
|
|
||||||
class QHostAddress;
|
|
||||||
class QTimer;
|
|
||||||
class QImage;
|
|
||||||
class QTcpServer;
|
|
||||||
class QLocalServer;
|
|
||||||
class QSslCertificate;
|
|
||||||
class QSslKey;
|
|
||||||
class QSslConfiguration;
|
|
||||||
|
|
||||||
namespace JQHttpServer
|
|
||||||
{
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT Session: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY( Session )
|
|
||||||
|
|
||||||
public:
|
|
||||||
Session( const QPointer< QIODevice > &tcpSocket );
|
|
||||||
|
|
||||||
~Session();
|
|
||||||
|
|
||||||
inline void setHandleAcceptedCallback(const std::function< void(const QPointer< Session > &) > &callback) { handleAcceptedCallback_ = callback; }
|
|
||||||
|
|
||||||
QString requestSource() const;
|
|
||||||
|
|
||||||
QString requestMethod() const;
|
|
||||||
|
|
||||||
QString requestUrl() const;
|
|
||||||
|
|
||||||
QString requestCrlf() const;
|
|
||||||
|
|
||||||
QMap< QString, QString > requestHeader() const;
|
|
||||||
|
|
||||||
QByteArray requestBody() const;
|
|
||||||
|
|
||||||
QString requestUrlPath() const;
|
|
||||||
|
|
||||||
QStringList requestUrlPathSplitToList() const;
|
|
||||||
|
|
||||||
QMap< QString, QString > requestUrlQuery() const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void replyText(const QString &replyData, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyRedirects(const QUrl &targetUrl, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyJsonObject(const QJsonObject &jsonObject, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyJsonArray(const QJsonArray &jsonArray, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyFile(const QString &filePath, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyFile(const QString &fileName, const QByteArray &fileData, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyImage(const QImage &image, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyImage(const QString &imageFilePath, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyBytes(const QByteArray &bytes, const int &httpStatusCode = 200);
|
|
||||||
|
|
||||||
void replyOptions();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void inspectionBufferSetup1();
|
|
||||||
|
|
||||||
void inspectionBufferSetup2();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPointer< QIODevice > ioDevice_;
|
|
||||||
std::function< void(const QPointer< Session > &) > handleAcceptedCallback_;
|
|
||||||
QSharedPointer< QTimer > timerForClose_;
|
|
||||||
|
|
||||||
QByteArray buffer_;
|
|
||||||
|
|
||||||
QString requestSource_;
|
|
||||||
QString requestMethod_;
|
|
||||||
QString requestUrl_;
|
|
||||||
QString requestCrlf_;
|
|
||||||
|
|
||||||
QMap< QString, QString > requestHeader_;
|
|
||||||
bool headerAcceptedFinish_ = false;
|
|
||||||
qint64 contentLength_ = -1;
|
|
||||||
bool alreadyReply_ = false;
|
|
||||||
|
|
||||||
QByteArray requestBody_;
|
|
||||||
|
|
||||||
qint64 waitWrittenByteCount_ = 0;
|
|
||||||
QSharedPointer< QIODevice > ioDeviceForReply_;
|
|
||||||
};
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT AbstractManage: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY( AbstractManage )
|
|
||||||
|
|
||||||
public:
|
|
||||||
AbstractManage(const int &handleMaxThreadCount);
|
|
||||||
|
|
||||||
virtual ~AbstractManage();
|
|
||||||
|
|
||||||
inline void setHttpAcceptedCallback(const std::function< void(const QPointer< Session > &session) > &httpAcceptedCallback) { httpAcceptedCallback_ = httpAcceptedCallback; }
|
|
||||||
|
|
||||||
inline QSharedPointer< QThreadPool > handleThreadPool() { return handleThreadPool_; }
|
|
||||||
|
|
||||||
inline QSharedPointer< QThreadPool > serverThreadPool() { return serverThreadPool_; }
|
|
||||||
|
|
||||||
virtual bool isRunning() = 0;
|
|
||||||
|
|
||||||
protected Q_SLOTS:
|
|
||||||
bool begin();
|
|
||||||
|
|
||||||
void close();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual bool onStart() = 0;
|
|
||||||
|
|
||||||
virtual void onFinish() = 0;
|
|
||||||
|
|
||||||
bool startServerThread();
|
|
||||||
|
|
||||||
void stopHandleThread();
|
|
||||||
|
|
||||||
void stopServerThread();
|
|
||||||
|
|
||||||
void newSession(const QPointer< Session > &session);
|
|
||||||
|
|
||||||
void handleAccepted(const QPointer< Session > &session);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void readyToClose();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QSharedPointer< QThreadPool > serverThreadPool_;
|
|
||||||
QSharedPointer< QThreadPool > handleThreadPool_;
|
|
||||||
|
|
||||||
QMutex mutex_;
|
|
||||||
|
|
||||||
std::function< void(const QPointer< Session > &session) > httpAcceptedCallback_;
|
|
||||||
|
|
||||||
QSet< Session * > availableSessions_;
|
|
||||||
};
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT TcpServerManage: public AbstractManage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY( TcpServerManage )
|
|
||||||
|
|
||||||
public:
|
|
||||||
TcpServerManage(const int &handleMaxThreadCount = 2);
|
|
||||||
|
|
||||||
~TcpServerManage();
|
|
||||||
|
|
||||||
bool listen(const QHostAddress &address, const quint16 &port);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool isRunning();
|
|
||||||
|
|
||||||
bool onStart();
|
|
||||||
|
|
||||||
void onFinish();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPointer< QTcpServer > tcpServer_;
|
|
||||||
|
|
||||||
QHostAddress listenAddress_ = QHostAddress::Any;
|
|
||||||
quint16 listenPort_ = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifndef QT_NO_SSL
|
|
||||||
class SslServerHelper;
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT SslServerManage: public AbstractManage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY( SslServerManage )
|
|
||||||
|
|
||||||
public:
|
|
||||||
SslServerManage(const int &handleMaxThreadCount = 2);
|
|
||||||
|
|
||||||
~SslServerManage();
|
|
||||||
|
|
||||||
bool listen(
|
|
||||||
const QHostAddress &address,
|
|
||||||
const quint16 &port,
|
|
||||||
const QString &crtFilePath,
|
|
||||||
const QString &keyFilePath,
|
|
||||||
const QList< QPair< QString, bool > > &caFileList = { } // [ { filePath, isPem } ]
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool isRunning();
|
|
||||||
|
|
||||||
bool onStart();
|
|
||||||
|
|
||||||
void onFinish();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPointer< SslServerHelper > tcpServer_;
|
|
||||||
|
|
||||||
QHostAddress listenAddress_ = QHostAddress::Any;
|
|
||||||
quint16 listenPort_ = 0;
|
|
||||||
|
|
||||||
QSharedPointer< QSslConfiguration > sslConfiguration_;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT LocalServerManage: public AbstractManage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY( LocalServerManage )
|
|
||||||
|
|
||||||
public:
|
|
||||||
LocalServerManage(const int &handleMaxThreadCount);
|
|
||||||
|
|
||||||
~LocalServerManage();
|
|
||||||
|
|
||||||
bool listen(const QString &name);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool isRunning();
|
|
||||||
|
|
||||||
bool onStart();
|
|
||||||
|
|
||||||
void onFinish();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPointer< QLocalServer > localServer_;
|
|
||||||
|
|
||||||
QString listenName_;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif//JQHTTPSERVER_H_
|
|
|
@ -1,198 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of JQLibrary
|
|
||||||
|
|
||||||
Copyright: Jason
|
|
||||||
|
|
||||||
Contact email: 188080501@qq.com
|
|
||||||
|
|
||||||
GNU Lesser General Public License Usage
|
|
||||||
Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
following information to ensure the GNU Lesser General Public License
|
|
||||||
requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JQLIBRARY_INCLUDE_JQNET_H_
|
|
||||||
#define JQLIBRARY_INCLUDE_JQNET_H_
|
|
||||||
|
|
||||||
#ifndef QT_NETWORK_LIB
|
|
||||||
# error("Please add network in pro file")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// C++ lib import
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
// Qt lib import
|
|
||||||
#include <QSharedPointer>
|
|
||||||
#include <QNetworkAccessManager>
|
|
||||||
#include <QNetworkReply>
|
|
||||||
#include <QHttpMultiPart>
|
|
||||||
#include <QNetworkInterface>
|
|
||||||
#include <QNetworkAddressEntry>
|
|
||||||
|
|
||||||
// JQLibrary lib import
|
|
||||||
#include <JQDeclare>
|
|
||||||
|
|
||||||
namespace JQNet
|
|
||||||
{
|
|
||||||
|
|
||||||
QNetworkAddressEntry getNetworkAddressEntry();
|
|
||||||
|
|
||||||
QPair< QNetworkAddressEntry, QNetworkInterface > getNetworkAddressEntryWithNetworkInterface(const bool &ridVm = true);
|
|
||||||
|
|
||||||
QString getHostName();
|
|
||||||
|
|
||||||
bool tcpReachable(const QString &hostName, const quint16 &port, const int &timeout = 5000);
|
|
||||||
|
|
||||||
#ifdef JQFOUNDATION_LIB
|
|
||||||
bool pingIp(const QHostAddress &hostAddress);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class JQLIBRARY_EXPORT HTTP
|
|
||||||
{
|
|
||||||
Q_DISABLE_COPY( HTTP )
|
|
||||||
|
|
||||||
public:
|
|
||||||
HTTP() = default;
|
|
||||||
|
|
||||||
~HTTP() = default;
|
|
||||||
|
|
||||||
public:
|
|
||||||
inline QNetworkAccessManager &manage() { return manage_; }
|
|
||||||
|
|
||||||
|
|
||||||
bool get(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
void get(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
bool deleteResource(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
void deleteResource(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
bool post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QList< QNetworkReply::RawHeaderPair > &targetRawHeaderPairs,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
bool post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QSharedPointer< QHttpMultiPart > &multiPart,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
void post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
bool put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
bool put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QSharedPointer< QHttpMultiPart > &multiPart,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
void put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
#if !( defined Q_OS_LINUX ) && ( QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 ) )
|
|
||||||
bool patch(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
|
|
||||||
void patch(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const int &timeout = 30 * 1000
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > get(const QString &url, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > get(const QNetworkRequest &request, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > deleteResource(const QString &url, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > deleteResource(const QNetworkRequest &request, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > post(const QString &url, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > post(const QNetworkRequest &request, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QPair< QList< QNetworkReply::RawHeaderPair >, QByteArray > > post2(const QNetworkRequest &request, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > post(const QNetworkRequest &request, const QSharedPointer< QHttpMultiPart > &multiPart, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > put(const QString &url, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > put(const QNetworkRequest &request, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > put(const QNetworkRequest &request, const QSharedPointer< QHttpMultiPart > &multiPart, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
#if !( defined Q_OS_LINUX ) && ( QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 ) )
|
|
||||||
static QPair< bool, QByteArray > patch(const QString &url, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
|
|
||||||
static QPair< bool, QByteArray > patch(const QNetworkRequest &request, const QByteArray &body, const int &timeout = 30 * 1000);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
|
||||||
void handle(
|
|
||||||
QNetworkReply *reply, const int &timeout,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data) > &onFinished,
|
|
||||||
const std::function< void(const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &code, const QByteArray &data) > &onError,
|
|
||||||
const std::function< void() > &onTimeout
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QNetworkAccessManager manage_;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif//JQLIBRARY_INCLUDE_JQNET_H_
|
|
|
@ -1,119 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of JQLibrary
|
|
||||||
|
|
||||||
Copyright: Jason
|
|
||||||
|
|
||||||
Contact email: 188080501@qq.com
|
|
||||||
|
|
||||||
GNU Lesser General Public License Usage
|
|
||||||
Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
following information to ensure the GNU Lesser General Public License
|
|
||||||
requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JQLIBRARY_INCLUDE_JQDECLARE_HPP_
|
|
||||||
#define JQLIBRARY_INCLUDE_JQDECLARE_HPP_
|
|
||||||
|
|
||||||
// Macro define
|
|
||||||
#define JQPROPERTYDECLARE(Type, name, setName, ...) \
|
|
||||||
private: \
|
|
||||||
Type name ## _ __VA_ARGS__; \
|
|
||||||
public: \
|
|
||||||
inline const Type &name() const { return name ## _; } \
|
|
||||||
inline void setName(const Type &name) { name ## _ = name; } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define JQPROPERTYDECLAREWITHSLOT(Type, name, setName, ...) \
|
|
||||||
private: \
|
|
||||||
Type name ## _ __VA_ARGS__; \
|
|
||||||
public Q_SLOTS: \
|
|
||||||
Type name() const { return name ## _; } \
|
|
||||||
void setName(const Type &name) { name ## _ = name; } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define JQPTRPROPERTYDECLARE(Type, name, setName, ...) \
|
|
||||||
private: \
|
|
||||||
Type *name ## _ __VA_ARGS__; \
|
|
||||||
public: \
|
|
||||||
inline const Type *name() const \
|
|
||||||
{ return name ## _; } \
|
|
||||||
inline void setName(const Type &name) \
|
|
||||||
{ if ( name ## _ ) { delete name ## _; } \
|
|
||||||
name ## _ = new Type( name ); } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define JQ_READ_AND_SET_PROPERTY( Type, name, setName ) \
|
|
||||||
public: \
|
|
||||||
inline const Type &name() const { return name ## _; } \
|
|
||||||
inline void setName(const Type &name) { name ## _ = name; } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define JQ_STATIC_READ_AND_SET_PROPERTY( Type, name, setName ) \
|
|
||||||
public: \
|
|
||||||
static inline const Type &name() { return name ## _; } \
|
|
||||||
static inline void setName(const Type &name) { name ## _ = name; } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define JQ_STATIC_SET_PROPERTY( Type, name, setName ) \
|
|
||||||
public: \
|
|
||||||
static inline void setName(const Type &name) { name ## _ = name; } \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define RUNONOUTRANGEHELPER2( x, y ) x ## y
|
|
||||||
#define RUNONOUTRANGEHELPER( x, y ) RUNONOUTRANGEHELPER2( x, y )
|
|
||||||
#define RUNONOUTRANGE( ... ) \
|
|
||||||
auto RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ ) = __VA_ARGS__; \
|
|
||||||
QSharedPointer< int > RUNONOUTRANGEHELPER( runOnOutRange, __LINE__ )( \
|
|
||||||
new int, \
|
|
||||||
[ RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ ) ](int *data) \
|
|
||||||
{ \
|
|
||||||
RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ )(); \
|
|
||||||
delete data; \
|
|
||||||
} ); \
|
|
||||||
if ( RUNONOUTRANGEHELPER( runOnOutRange, __LINE__ ).data() == nullptr ) { exit( -1 ); }
|
|
||||||
|
|
||||||
#define RUNONOUTRANGETIMER( message ) \
|
|
||||||
const auto &&runOnOutRangeTimerTime = QDateTime::currentMSecsSinceEpoch(); \
|
|
||||||
RUNONOUTRANGE( [ = ]() \
|
|
||||||
{ \
|
|
||||||
qDebug() << message << ( QDateTime::currentMSecsSinceEpoch() - runOnOutRangeTimerTime ); \
|
|
||||||
} )
|
|
||||||
|
|
||||||
#define JQCONST( property ) \
|
|
||||||
static_cast< const decltype( property ) >( property )
|
|
||||||
|
|
||||||
#define JQTICKCOUNTERMESSAGE( message ) \
|
|
||||||
{ \
|
|
||||||
static JQTickCounter tickCounter; \
|
|
||||||
tickCounter.tick(); \
|
|
||||||
qDebug() << message << tickCounter.tickPerSecond(); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define JQBUILDDATETIMESTRING \
|
|
||||||
( QDateTime( \
|
|
||||||
QLocale( QLocale::English ).toDate( QString( __DATE__ ).replace( " ", " 0" ), "MMM dd yyyy"), \
|
|
||||||
QTime::fromString( __TIME__, "hh:mm:ss" ) \
|
|
||||||
).toString( "yyyy-MM-dd hh:mm:ss" ).toLatin1().data() )
|
|
||||||
|
|
||||||
#define JQONLYONCE \
|
|
||||||
if ( [](){ static auto flag = true; if ( flag ) { flag = false; return true; } return false; }() )
|
|
||||||
|
|
||||||
#define JQOSKIPFIRST \
|
|
||||||
if ( [](){ static auto flag = true; if ( flag ) { flag = false; return false; } return true; }() )
|
|
||||||
|
|
||||||
// Export
|
|
||||||
#ifdef JQLIBRARY_EXPORT_ENABLE
|
|
||||||
# ifdef JQLIBRARY_EXPORT_MODE
|
|
||||||
# define JQLIBRARY_EXPORT Q_DECL_EXPORT
|
|
||||||
# else
|
|
||||||
# define JQLIBRARY_EXPORT Q_DECL_IMPORT
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define JQLIBRARY_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif//JQLIBRARY_INCLUDE_JQDECLARE_HPP_
|
|
|
@ -1,669 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of JQLibrary
|
|
||||||
|
|
||||||
Copyright: Jason
|
|
||||||
|
|
||||||
Contact email: 188080501@qq.com
|
|
||||||
|
|
||||||
GNU Lesser General Public License Usage
|
|
||||||
Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
following information to ensure the GNU Lesser General Public License
|
|
||||||
requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "JQNet.h"
|
|
||||||
|
|
||||||
// Qt lib import
|
|
||||||
#include <QEventLoop>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QUrl>
|
|
||||||
#include <QHostInfo>
|
|
||||||
#include <QTcpSocket>
|
|
||||||
|
|
||||||
// JQLibrary lib import
|
|
||||||
#ifdef JQFOUNDATION_LIB
|
|
||||||
# include "JQFoundation.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QNetworkAddressEntry JQNet::getNetworkAddressEntry()
|
|
||||||
{
|
|
||||||
return getNetworkAddressEntryWithNetworkInterface().first;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< QNetworkAddressEntry, QNetworkInterface > JQNet::getNetworkAddressEntryWithNetworkInterface(const bool &ridVm)
|
|
||||||
{
|
|
||||||
for ( const auto &interface: static_cast< const QList< QNetworkInterface > >( QNetworkInterface::allInterfaces() ) )
|
|
||||||
{
|
|
||||||
if ( interface.flags() != ( QNetworkInterface::IsUp |
|
|
||||||
QNetworkInterface::IsRunning |
|
|
||||||
QNetworkInterface::CanBroadcast |
|
|
||||||
QNetworkInterface::CanMulticast ) ) { continue; }
|
|
||||||
|
|
||||||
if ( ridVm && interface.humanReadableName().startsWith( "vm" ) ) { continue; }
|
|
||||||
|
|
||||||
for ( const auto &entry: static_cast< QList<QNetworkAddressEntry> >( interface.addressEntries() ) )
|
|
||||||
{
|
|
||||||
if ( entry.ip().toIPv4Address() )
|
|
||||||
{
|
|
||||||
return { entry, interface };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return { };
|
|
||||||
}
|
|
||||||
|
|
||||||
QString JQNet::getHostName()
|
|
||||||
{
|
|
||||||
#if ( defined Q_OS_MAC )
|
|
||||||
return QHostInfo::localHostName().replace( ".local", "" );
|
|
||||||
#else
|
|
||||||
return QHostInfo::localHostName();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::tcpReachable(const QString &hostName, const quint16 &port, const int &timeout)
|
|
||||||
{
|
|
||||||
QTcpSocket socket;
|
|
||||||
|
|
||||||
socket.connectToHost( hostName, port );
|
|
||||||
socket.waitForConnected( timeout );
|
|
||||||
|
|
||||||
return socket.state() == QAbstractSocket::ConnectedState;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef JQFOUNDATION_LIB
|
|
||||||
bool JQNet::pingIp(const QHostAddress &hostAddress)
|
|
||||||
{
|
|
||||||
// qDebug() << "NetworkManage::pingIp:" << hostAddress.toString();
|
|
||||||
|
|
||||||
QPair< int, QByteArray > pingResult = { -1, { } };
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
pingResult = JQFoundation::startProcessAndReadOutput( "ping", { "-c1", "-W300", hostAddress.toString() } );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
pingResult = JQFoundation::startProcessAndReadOutput( "ping", { "-n", "1", "-w", "300", hostAddress.toString() } );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ( pingResult.first == 0 ) && ( pingResult.second.size() > 20 ) && ( pingResult.second.count( hostAddress.toString().toUtf8() ) > 1 );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// HTTP
|
|
||||||
bool JQNet::HTTP::get(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
QByteArray &target, const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.get( request );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ & ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( 1 );
|
|
||||||
},
|
|
||||||
[ & ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( 0 );
|
|
||||||
},
|
|
||||||
[ & ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( 0 );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JQNet::HTTP::get(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &)> &onError,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto reply = manage_.get( request );
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
onFinished,
|
|
||||||
onError,
|
|
||||||
[ onError ]()
|
|
||||||
{
|
|
||||||
onError( { }, QNetworkReply::TimeoutError, { } );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::HTTP::deleteResource(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.deleteResource( request );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ & ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( 1 );
|
|
||||||
},
|
|
||||||
[ & ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( 0 );
|
|
||||||
},
|
|
||||||
[ & ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( 0 );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JQNet::HTTP::deleteResource(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &)> &onError,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto reply = manage_.deleteResource( request );
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
onFinished,
|
|
||||||
onError,
|
|
||||||
[ onError ]()
|
|
||||||
{
|
|
||||||
onError( { }, QNetworkReply::TimeoutError, { } );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::HTTP::post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QList< QNetworkReply::RawHeaderPair > &targetRawHeaderPairs,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.post( request, body );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ &targetRawHeaderPairs, &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &rawHeaderPairs, const QByteArray &data)
|
|
||||||
{
|
|
||||||
targetRawHeaderPairs = rawHeaderPairs;
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( true );
|
|
||||||
},
|
|
||||||
[ &targetRawHeaderPairs, &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &rawHeaderPairs, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
targetRawHeaderPairs = rawHeaderPairs;
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
},
|
|
||||||
[ &failFlag, &eventLoop ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::HTTP::post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QSharedPointer< QHttpMultiPart > &multiPart,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.post( request, multiPart.data() );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( true );
|
|
||||||
},
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
},
|
|
||||||
[ &failFlag, &eventLoop ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JQNet::HTTP::post(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &)> &onError,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto reply = manage_.post( request, body );
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
onFinished,
|
|
||||||
onError,
|
|
||||||
[ onError ]()
|
|
||||||
{
|
|
||||||
onError( { }, QNetworkReply::TimeoutError, { } );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::HTTP::put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.put( request, body );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( true );
|
|
||||||
},
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
},
|
|
||||||
[ &failFlag, &eventLoop ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JQNet::HTTP::put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QSharedPointer< QHttpMultiPart > &multiPart,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.put( request, multiPart.data() );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( true );
|
|
||||||
},
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError & /*e*/, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
},
|
|
||||||
[ &failFlag, &eventLoop ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JQNet::HTTP::put(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &)> &onError,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto reply = manage_.put( request, body );
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
onFinished,
|
|
||||||
onError,
|
|
||||||
[ onError ]()
|
|
||||||
{
|
|
||||||
onError( { }, QNetworkReply::TimeoutError, { } );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !( defined Q_OS_LINUX ) && ( QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 ) )
|
|
||||||
bool JQNet::HTTP::patch(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
QByteArray &target,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
target.clear();
|
|
||||||
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
auto reply = manage_.sendCustomRequest( request, "PATCH", body );
|
|
||||||
bool failFlag = false;
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( true );
|
|
||||||
},
|
|
||||||
[ &target, &eventLoop ](const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)
|
|
||||||
{
|
|
||||||
target = data;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
},
|
|
||||||
[ &failFlag, &eventLoop ]()
|
|
||||||
{
|
|
||||||
failFlag = true;
|
|
||||||
eventLoop.exit( false );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return eventLoop.exec() && !failFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JQNet::HTTP::patch(
|
|
||||||
const QNetworkRequest &request,
|
|
||||||
const QByteArray &body,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &)> &onError,
|
|
||||||
const int &timeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
auto reply = manage_.sendCustomRequest( request, "PATCH", body );
|
|
||||||
|
|
||||||
this->handle(
|
|
||||||
reply,
|
|
||||||
timeout,
|
|
||||||
onFinished,
|
|
||||||
onError,
|
|
||||||
[ onError ]()
|
|
||||||
{
|
|
||||||
onError( { }, QNetworkReply::TimeoutError, { } );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::get(const QString &url, const int &timeout)
|
|
||||||
{
|
|
||||||
QNetworkRequest networkRequest( ( QUrl( url ) ) );
|
|
||||||
QByteArray buf;
|
|
||||||
|
|
||||||
const auto &&flag = HTTP().get( networkRequest, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::get(const QNetworkRequest &request, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.get( request, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::deleteResource(const QString &url, const int &timeout)
|
|
||||||
{
|
|
||||||
QNetworkRequest networkRequest( ( QUrl( url ) ) );
|
|
||||||
QByteArray buf;
|
|
||||||
|
|
||||||
const auto &&flag = HTTP().deleteResource( networkRequest, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::deleteResource(const QNetworkRequest &request, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.deleteResource( request, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::post(const QString &url, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QNetworkRequest networkRequest( ( QUrl( url ) ) );
|
|
||||||
QList< QNetworkReply::RawHeaderPair > rawHeaderPairs;
|
|
||||||
QByteArray buf;
|
|
||||||
|
|
||||||
networkRequest.setRawHeader( "Content-Type", "application/x-www-form-urlencoded" );
|
|
||||||
|
|
||||||
const auto &&flag = HTTP().post( networkRequest, body, rawHeaderPairs, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::post(const QNetworkRequest &request, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
QList< QNetworkReply::RawHeaderPair > rawHeaderPairs;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.post( request, body, rawHeaderPairs, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QPair< QList< QNetworkReply::RawHeaderPair >, QByteArray > > JQNet::HTTP::post2(const QNetworkRequest &request, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
QList< QNetworkReply::RawHeaderPair > rawHeaderPairs;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.post( request, body, rawHeaderPairs, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, { rawHeaderPairs, buf } };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::post(const QNetworkRequest &request, const QSharedPointer<QHttpMultiPart> &multiPart, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.post( request, multiPart, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::put(const QString &url, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QNetworkRequest networkRequest( ( QUrl( url ) ) );
|
|
||||||
QByteArray buf;
|
|
||||||
|
|
||||||
networkRequest.setRawHeader( "Content-Type", "application/x-www-form-urlencoded" );
|
|
||||||
|
|
||||||
const auto &&flag = HTTP().put( networkRequest, body, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::put(const QNetworkRequest &request, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.put( request, body, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::put(const QNetworkRequest &request, const QSharedPointer< QHttpMultiPart > &multiPart, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.put( request, multiPart, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !( defined Q_OS_LINUX ) && ( QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 ) )
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::patch(const QString &url, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QNetworkRequest networkRequest( ( QUrl( url ) ) );
|
|
||||||
QByteArray buf;
|
|
||||||
|
|
||||||
networkRequest.setRawHeader( "Content-Type", "application/x-www-form-urlencoded" );
|
|
||||||
|
|
||||||
const auto &&flag = HTTP().patch( networkRequest, body, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair< bool, QByteArray > JQNet::HTTP::patch(const QNetworkRequest &request, const QByteArray &body, const int &timeout)
|
|
||||||
{
|
|
||||||
QByteArray buf;
|
|
||||||
HTTP http;
|
|
||||||
|
|
||||||
const auto &&flag = http.patch( request, body, buf, timeout );
|
|
||||||
|
|
||||||
return { flag, buf };
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void JQNet::HTTP::handle(
|
|
||||||
QNetworkReply *reply, const int &timeout,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QByteArray &)> &onFinished,
|
|
||||||
const std::function<void (const QList< QNetworkReply::RawHeaderPair > &, const QNetworkReply::NetworkError &, const QByteArray &data)> &onError,
|
|
||||||
const std::function<void ()> &onTimeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
QSharedPointer< bool > isCalled( new bool( false ) );
|
|
||||||
|
|
||||||
QTimer *timer = nullptr;
|
|
||||||
if ( timeout )
|
|
||||||
{
|
|
||||||
timer = new QTimer;
|
|
||||||
timer->setSingleShot(true);
|
|
||||||
|
|
||||||
QObject::connect( timer, &QTimer::timeout, [ timer, onTimeout, isCalled ]()
|
|
||||||
{
|
|
||||||
if ( *isCalled ) { return; }
|
|
||||||
*isCalled = true;
|
|
||||||
|
|
||||||
onTimeout();
|
|
||||||
timer->deleteLater();
|
|
||||||
} );
|
|
||||||
timer->start( timeout );
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject::connect( reply, &QNetworkReply::finished, [ reply, timer, onFinished, isCalled ]()
|
|
||||||
{
|
|
||||||
if ( *isCalled ) { return; }
|
|
||||||
*isCalled = true;
|
|
||||||
|
|
||||||
if ( timer )
|
|
||||||
{
|
|
||||||
timer->deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto &&acceptedData = reply->readAll();
|
|
||||||
const auto &rawHeaderPairs = reply->rawHeaderPairs();
|
|
||||||
|
|
||||||
onFinished( rawHeaderPairs, acceptedData );
|
|
||||||
} );
|
|
||||||
|
|
||||||
#ifndef QT_NO_SSL
|
|
||||||
if ( reply->url().toString().toLower().startsWith( "https" ) )
|
|
||||||
{
|
|
||||||
QObject::connect( reply, static_cast< void( QNetworkReply::* )( const QList< QSslError > & ) >( &QNetworkReply::sslErrors ), [ reply ](const QList< QSslError > &errors)
|
|
||||||
{
|
|
||||||
qDebug() << "HTTP::handle: ignoreSslErrors:" << errors;
|
|
||||||
reply->ignoreSslErrors();
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QObject::connect( reply, static_cast< void( QNetworkReply::* )( QNetworkReply::NetworkError ) >( &QNetworkReply::error ), [ reply, timer, onError, isCalled ](const QNetworkReply::NetworkError &code)
|
|
||||||
{
|
|
||||||
if ( *isCalled ) { return; }
|
|
||||||
*isCalled = true;
|
|
||||||
|
|
||||||
if ( timer )
|
|
||||||
{
|
|
||||||
timer->deleteLater();
|
|
||||||
}
|
|
||||||
const auto &&acceptedData = reply->readAll();
|
|
||||||
const auto &rawHeaderPairs = reply->rawHeaderPairs();
|
|
||||||
|
|
||||||
onError( rawHeaderPairs, code, acceptedData );
|
|
||||||
} );
|
|
||||||
}
|
|
674
LedOK/LICENSE
|
@ -1,674 +0,0 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
507
LedOK/LedOK.pro
|
@ -1,58 +1,46 @@
|
||||||
#-------------------------------------------------
|
QT += core gui widgets
|
||||||
#
|
QT += multimedia
|
||||||
# Project created by QtCreator 2019-04-10T23:15:55
|
|
||||||
#
|
|
||||||
#-------------------------------------------------
|
|
||||||
VERSION = 1.1.46
|
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
|
||||||
QT += core gui
|
|
||||||
QT += network
|
QT += network
|
||||||
QT += core network concurrent
|
QT += concurrent
|
||||||
#QT += axcontainer
|
|
||||||
QT += xlsx
|
|
||||||
QT += serialport
|
QT += serialport
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets multimedia multimediawidgets network
|
QT += opengl
|
||||||
|
QT += webenginewidgets
|
||||||
|
|
||||||
#TARGET = LedOK
|
CONFIG += c++11
|
||||||
TARGET = $$quote(LedOK Express)
|
CONFIG += lrelease
|
||||||
TEMPLATE = app
|
CONFIG += embed_translations
|
||||||
# The following define makes your compiler emit warnings if you use
|
# CONFIG += console
|
||||||
# any feature of Qt which has been marked as deprecated (the exact warnings
|
|
||||||
# depend on your compiler). Please consult the documentation of the
|
|
||||||
# deprecated API in order to know how to port your code away from it.
|
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS
|
|
||||||
|
|
||||||
# You can also make your code fail to compile if you use deprecated APIs.
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
# In order to do so, uncomment the following line.
|
# In order to do so, uncomment the following line.
|
||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
CONFIG += c++11
|
TARGET = $$quote(LedOK Express)
|
||||||
#CONFIG += qaxcontainer
|
VERSION = 1.2.8
|
||||||
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||||
|
|
||||||
|
msvc {
|
||||||
|
QMAKE_CXXFLAGS += -execution-charset:utf-8
|
||||||
|
QMAKE_CXXFLAGS += -source-charset:utf-8
|
||||||
|
|
||||||
|
CONFIG += force_debug_info
|
||||||
|
CONFIG += separate_debug_info
|
||||||
|
}
|
||||||
|
win* {
|
||||||
|
LIBS += -lwinmm
|
||||||
|
LIBS += -lDbghelp
|
||||||
|
}
|
||||||
|
win32 {
|
||||||
|
QMAKE_LFLAGS += /LARGEADDRESSAWARE
|
||||||
|
#QMAKE_LFLAGS += -Wl,--large-address-aware
|
||||||
|
}
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
ColorDialog/BasicColorArea.cpp \
|
|
||||||
ColorDialog/BasicColorItem.cpp \
|
|
||||||
ColorDialog/ColorDialog.cpp \
|
|
||||||
ColorDialog/CustomColorArea.cpp \
|
|
||||||
ColorDialog/HColorArea.cpp \
|
|
||||||
ColorDialog/PreviewColorArea.cpp \
|
|
||||||
ColorDialog/SVColorArea.cpp \
|
|
||||||
LoQClass/extendedgroupbox.cpp \
|
|
||||||
LoQClass/locolorselector.cpp \
|
|
||||||
LoQClass/lodateselector.cpp \
|
|
||||||
LoQClass/loglwindow.cpp \
|
|
||||||
LoQClass/loqgraphicsvideoitem.cpp \
|
|
||||||
LoQClass/loqgraphicsview.cpp \
|
|
||||||
LoQClass/loqheaderviewcheckbox.cpp \
|
|
||||||
LoQClass/loqlineedit.cpp \
|
|
||||||
LoQClass/loqtreewidget.cpp \
|
|
||||||
LoQClass/loqvideosurface.cpp \
|
|
||||||
LoUIClass/aboutdlg.cpp \
|
LoUIClass/aboutdlg.cpp \
|
||||||
LoUIClass/changepasswordform.cpp \
|
LoUIClass/changepasswordform.cpp \
|
||||||
LoUIClass/customprogressindicator.cpp \
|
LoUIClass/customprogressindicator.cpp \
|
||||||
LoUIClass/loemptydialog.cpp \
|
LoUIClass/loemptydialog.cpp \
|
||||||
LoUIClass/louimsgboxokcancel.cpp \
|
|
||||||
LoUIClass/pixbmpshowdialog.cpp \
|
LoUIClass/pixbmpshowdialog.cpp \
|
||||||
LoUIClass/qiplineedit.cpp \
|
LoUIClass/qiplineedit.cpp \
|
||||||
LoUIClass/softconfigdialog.cpp \
|
LoUIClass/softconfigdialog.cpp \
|
||||||
|
@ -60,50 +48,51 @@ SOURCES += \
|
||||||
LoUIClass/taesclass.cpp \
|
LoUIClass/taesclass.cpp \
|
||||||
LoUIClass/updateledset3dialog.cpp \
|
LoUIClass/updateledset3dialog.cpp \
|
||||||
LoUIClass/updaterdialog.cpp \
|
LoUIClass/updaterdialog.cpp \
|
||||||
LoUIClass/updaterfirmwaredialog.cpp \
|
|
||||||
LoUIClass/x_checkboxdelegate.cpp \
|
LoUIClass/x_checkboxdelegate.cpp \
|
||||||
LoUIClass/x_spinboxdelegate.cpp \
|
LoUIClass/x_spinboxdelegate.cpp \
|
||||||
LoUIClass/x_timeeditdelegate.cpp \
|
LoUIClass/x_timeeditdelegate.cpp \
|
||||||
LoUIClass/x_uimsgboxok.cpp \
|
LoUIClass/x_uimsgboxok.cpp \
|
||||||
LoUIClass/x_uimsgboxokcancel.cpp \
|
base/extendedgroupbox.cpp \
|
||||||
LoUIClass/x_uimsgboxonlyclosebtn.cpp \
|
base/locolorselector.cpp \
|
||||||
LoUIClass/x_uimsgboxyesnocancel.cpp \
|
base/lodateselector.cpp \
|
||||||
ccrashstack.cpp \
|
base/loqtitlebar.cpp \
|
||||||
|
base/loqtreewidget.cpp \
|
||||||
|
base/networkmanager.cpp \
|
||||||
|
base/table.cpp \
|
||||||
|
base/waitingdlg.cpp \
|
||||||
|
basedlg.cpp \
|
||||||
|
basewin.cpp \
|
||||||
cfg.cpp \
|
cfg.cpp \
|
||||||
communication/hpptclient.cpp \
|
communication/hpptclient.cpp \
|
||||||
communication/network.cpp \
|
communication/network.cpp \
|
||||||
communication/taserialthread.cpp \
|
communication/taserialthread.cpp \
|
||||||
|
devicectrlpanel.cpp \
|
||||||
|
deviceitem.cpp \
|
||||||
|
devicepanel.cpp \
|
||||||
|
ffplayer.cpp \
|
||||||
globaldefine.cpp \
|
globaldefine.cpp \
|
||||||
jsondecoderloop.cpp \
|
|
||||||
loappconfig.cpp \
|
|
||||||
loapptools.cpp \
|
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
mdevicemanager.cpp \
|
|
||||||
mdevicesetting.cpp \
|
|
||||||
mguangyingpinwidget.cpp \
|
mguangyingpinwidget.cpp \
|
||||||
mprogrammanagera.cpp \
|
passwordindlg.cpp \
|
||||||
mtitlebar.cpp \
|
|
||||||
mtabwidget.cpp \
|
|
||||||
mprogrammanager.cpp \
|
|
||||||
player/digiclock.cpp \
|
player/digiclock.cpp \
|
||||||
player/eleanaclock.cpp \
|
player/eleanaclock.cpp \
|
||||||
player/elebase.cpp \
|
player/elebase.cpp \
|
||||||
|
player/eleborder.cpp \
|
||||||
player/elegif.cpp \
|
player/elegif.cpp \
|
||||||
player/eleimg.cpp \
|
player/eleimg.cpp \
|
||||||
player/elemultipng.cpp \
|
player/elemultipng.cpp \
|
||||||
player/elescroll.cpp \
|
player/elescroll.cpp \
|
||||||
|
player/eletimer.cpp \
|
||||||
player/elevideo.cpp \
|
player/elevideo.cpp \
|
||||||
player/playwin.cpp \
|
player/playwin.cpp \
|
||||||
publishform.cpp \
|
player/posdlg.cpp \
|
||||||
|
progpanel.cpp \
|
||||||
|
synctimer.cpp \
|
||||||
|
tcpsocket.cpp \
|
||||||
|
test.cpp \
|
||||||
tipdialog.cpp \
|
tipdialog.cpp \
|
||||||
ttimer.cpp \
|
tools.cpp \
|
||||||
wDevicesManager/controladvparamwidget.cpp \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.cpp \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.cpp \
|
|
||||||
wDevicesManager/controlbrightnessschedule.cpp \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.cpp \
|
|
||||||
wDevicesManager/controlbrightnesswidget.cpp \
|
|
||||||
wDevicesManager/controlencryptwidget.cpp \
|
wDevicesManager/controlencryptwidget.cpp \
|
||||||
wDevicesManager/controlhdmimanual.cpp \
|
wDevicesManager/controlhdmimanual.cpp \
|
||||||
wDevicesManager/controlhdmischedule.cpp \
|
wDevicesManager/controlhdmischedule.cpp \
|
||||||
|
@ -117,98 +106,45 @@ SOURCES += \
|
||||||
wDevicesManager/controlvolumemanual.cpp \
|
wDevicesManager/controlvolumemanual.cpp \
|
||||||
wDevicesManager/controlvolumeschedule.cpp \
|
wDevicesManager/controlvolumeschedule.cpp \
|
||||||
wDevicesManager/controlvolumewidget.cpp \
|
wDevicesManager/controlvolumewidget.cpp \
|
||||||
wDevicesManager/devicescontrollwidget.cpp \
|
wDevicesManager/ctrladvancedpanel.cpp \
|
||||||
wDevicesManager/inputpassworddialog.cpp \
|
wDevicesManager/ctrlbrightpanel.cpp \
|
||||||
wDevicesManager/ledcard.cpp \
|
wDevicesManager/ledcard.cpp \
|
||||||
wDevicesManager/specialdlg.cpp \
|
wDevicesManager/specialdlg.cpp \
|
||||||
wDevicesManager/subspecifyip.cpp \
|
|
||||||
wDevicesManager/subspecifyiprange.cpp \
|
|
||||||
wDevicesManager/threadupgradeapk.cpp \
|
wDevicesManager/threadupgradeapk.cpp \
|
||||||
wDevicesManager/upgradeapkdialog.cpp \
|
wDevicesManager/upgradeapkdialog.cpp \
|
||||||
wDevicesManager/wdevicesitem.cpp \
|
|
||||||
wDevicesManager/wupgradeapkitem.cpp \
|
wDevicesManager/wupgradeapkitem.cpp \
|
||||||
|
wProgramManager/eaclock.cpp \
|
||||||
|
wProgramManager/eaudio.cpp \
|
||||||
|
wProgramManager/ebase.cpp \
|
||||||
|
wProgramManager/edclock.cpp \
|
||||||
|
wProgramManager/eenviron.cpp \
|
||||||
|
wProgramManager/egif.cpp \
|
||||||
|
wProgramManager/emultiwin.cpp \
|
||||||
|
wProgramManager/ephoto.cpp \
|
||||||
|
wProgramManager/etext.cpp \
|
||||||
|
wProgramManager/etimer.cpp \
|
||||||
|
wProgramManager/evideo.cpp \
|
||||||
|
wProgramManager/eweb.cpp \
|
||||||
wProgramManager/mconverter.cpp \
|
wProgramManager/mconverter.cpp \
|
||||||
|
wProgramManager/pageeditor.cpp \
|
||||||
|
wProgramManager/pagelistitem.cpp \
|
||||||
|
wProgramManager/progeditorwin.cpp \
|
||||||
wProgramManager/sendprogramdialog.cpp \
|
wProgramManager/sendprogramdialog.cpp \
|
||||||
|
wProgramManager/sendprogthread.cpp \
|
||||||
wProgramManager/threadexportprogrampro.cpp \
|
wProgramManager/threadexportprogrampro.cpp \
|
||||||
wProgramManager/threadsendpro.cpp \
|
|
||||||
wProgramManager/usbdetectdialog.cpp \
|
wProgramManager/usbdetectdialog.cpp \
|
||||||
wProgramManager/usbdiskfuncdialog.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclock.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclock.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/egif.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovie.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobject.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephoto.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etemp.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etext.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimer.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweather.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindow.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/fyxcircleprogress.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/imagecutwidget.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/qffwidget.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/videodec.cpp \
|
|
||||||
wProgramManager/wEditProgram/wattrview.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageitem.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.cpp \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.cpp \
|
|
||||||
wProgramManager/wEditProgram/wplanlist.cpp \
|
|
||||||
wProgramManager/wexportprogramitem.cpp \
|
wProgramManager/wexportprogramitem.cpp \
|
||||||
wProgramManager/wnewprogram.cpp \
|
wProgramManager/wnewprogram.cpp \
|
||||||
LoQClass/loqdialog.cpp \
|
wProgramManager/wplanitem.cpp \
|
||||||
LoQClass/loqpushbutton.cpp \
|
wProgramManager/wplanlist.cpp \
|
||||||
wProgramManager/weditprogram.cpp \
|
|
||||||
LoQClass/loqmainwindow.cpp \
|
|
||||||
LoQClass/loqtitlebar.cpp \
|
|
||||||
LoQClass/loqwindowtitlebar.cpp \
|
|
||||||
wProgramManager/wEditProgram/wmaintoolbar.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpagelist.cpp \
|
|
||||||
wProgramManager/wEditProgram/wdrawingboard.cpp \
|
|
||||||
wProgramManager/wprogramitem.cpp \
|
wProgramManager/wprogramitem.cpp \
|
||||||
wProgramManager/wprogrampublishitem.cpp \
|
wProgramManager/wprogrampublishitem.cpp \
|
||||||
wProgramManagerA/wprogramitema.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
ColorDialog/BasicColorArea.h \
|
|
||||||
ColorDialog/BasicColorItem.h \
|
|
||||||
ColorDialog/ColorDialog.h \
|
|
||||||
ColorDialog/CustomColorArea.h \
|
|
||||||
ColorDialog/HColorArea.h \
|
|
||||||
ColorDialog/PreviewColorArea.h \
|
|
||||||
ColorDialog/SVColorArea.h \
|
|
||||||
LoQClass/extendedgroupbox.h \
|
|
||||||
LoQClass/locolorselector.h \
|
|
||||||
LoQClass/lodateselector.h \
|
|
||||||
LoQClass/loglwindow.h \
|
|
||||||
LoQClass/loqgraphicsvideoitem.h \
|
|
||||||
LoQClass/loqgraphicsview.h \
|
|
||||||
LoQClass/loqheaderviewcheckbox.h \
|
|
||||||
LoQClass/loqlineedit.h \
|
|
||||||
LoQClass/loqmacro.h \
|
|
||||||
LoQClass/loqtreewidget.h \
|
|
||||||
LoQClass/loqvideosurface.h \
|
|
||||||
LoUIClass/aboutdlg.h \
|
LoUIClass/aboutdlg.h \
|
||||||
LoUIClass/changepasswordform.h \
|
LoUIClass/changepasswordform.h \
|
||||||
LoUIClass/customprogressindicator.h \
|
LoUIClass/customprogressindicator.h \
|
||||||
LoUIClass/loemptydialog.h \
|
LoUIClass/loemptydialog.h \
|
||||||
LoUIClass/louimsgboxokcancel.h \
|
|
||||||
LoUIClass/pixbmpshowdialog.h \
|
LoUIClass/pixbmpshowdialog.h \
|
||||||
LoUIClass/qiplineedit.h \
|
LoUIClass/qiplineedit.h \
|
||||||
LoUIClass/softconfigdialog.h \
|
LoUIClass/softconfigdialog.h \
|
||||||
|
@ -216,50 +152,50 @@ HEADERS += \
|
||||||
LoUIClass/taesclass.h \
|
LoUIClass/taesclass.h \
|
||||||
LoUIClass/updateledset3dialog.h \
|
LoUIClass/updateledset3dialog.h \
|
||||||
LoUIClass/updaterdialog.h \
|
LoUIClass/updaterdialog.h \
|
||||||
LoUIClass/updaterfirmwaredialog.h \
|
|
||||||
LoUIClass/x_checkboxdelegate.h \
|
LoUIClass/x_checkboxdelegate.h \
|
||||||
LoUIClass/x_spinboxdelegate.h \
|
LoUIClass/x_spinboxdelegate.h \
|
||||||
LoUIClass/x_timeeditdelegate.h \
|
LoUIClass/x_timeeditdelegate.h \
|
||||||
LoUIClass/x_uimsgboxok.h \
|
LoUIClass/x_uimsgboxok.h \
|
||||||
LoUIClass/x_uimsgboxokcancel.h \
|
base/extendedgroupbox.h \
|
||||||
LoUIClass/x_uimsgboxonlyclosebtn.h \
|
base/locolorselector.h \
|
||||||
LoUIClass/x_uimsgboxyesnocancel.h \
|
base/lodateselector.h \
|
||||||
ccrashstack.h \
|
base/loqtitlebar.h \
|
||||||
|
base/loqtreewidget.h \
|
||||||
|
base/networkmanager.h \
|
||||||
|
base/table.h \
|
||||||
|
base/waitingdlg.h \
|
||||||
|
basedlg.h \
|
||||||
|
basewin.h \
|
||||||
cfg.h \
|
cfg.h \
|
||||||
communication/hpptclient.h \
|
communication/hpptclient.h \
|
||||||
communication/network.h \
|
communication/network.h \
|
||||||
communication/taserialthread.h \
|
communication/taserialthread.h \
|
||||||
|
devicectrlpanel.h \
|
||||||
|
deviceitem.h \
|
||||||
|
devicepanel.h \
|
||||||
|
ffplayer.h \
|
||||||
globaldefine.h \
|
globaldefine.h \
|
||||||
gqt.h \
|
gqt.h \
|
||||||
jsondecoderloop.h \
|
|
||||||
loappconfig.h \
|
|
||||||
loapptools.h \
|
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
mdevicemanager.h \
|
|
||||||
mdevicesetting.h \
|
|
||||||
mguangyingpinwidget.h \
|
mguangyingpinwidget.h \
|
||||||
mprogrammanagera.h \
|
passwordindlg.h \
|
||||||
mtitlebar.h \
|
|
||||||
mtabwidget.h \
|
|
||||||
mprogrammanager.h \
|
|
||||||
player/digiclock.h \
|
player/digiclock.h \
|
||||||
player/eleanaclock.h \
|
player/eleanaclock.h \
|
||||||
player/elebase.h \
|
player/elebase.h \
|
||||||
|
player/eleborder.h \
|
||||||
player/elegif.h \
|
player/elegif.h \
|
||||||
player/eleimg.h \
|
player/eleimg.h \
|
||||||
player/elemultipng.h \
|
player/elemultipng.h \
|
||||||
player/elescroll.h \
|
player/elescroll.h \
|
||||||
|
player/eletimer.h \
|
||||||
player/elevideo.h \
|
player/elevideo.h \
|
||||||
player/playwin.h \
|
player/playwin.h \
|
||||||
publishform.h \
|
player/posdlg.h \
|
||||||
|
progpanel.h \
|
||||||
|
synctimer.h \
|
||||||
|
tcpsocket.h \
|
||||||
tipdialog.h \
|
tipdialog.h \
|
||||||
ttimer.h \
|
tools.h \
|
||||||
wDevicesManager/controladvparamwidget.h \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.h \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.h \
|
|
||||||
wDevicesManager/controlbrightnessschedule.h \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.h \
|
|
||||||
wDevicesManager/controlbrightnesswidget.h \
|
|
||||||
wDevicesManager/controlencryptwidget.h \
|
wDevicesManager/controlencryptwidget.h \
|
||||||
wDevicesManager/controlhdmimanual.h \
|
wDevicesManager/controlhdmimanual.h \
|
||||||
wDevicesManager/controlhdmischedule.h \
|
wDevicesManager/controlhdmischedule.h \
|
||||||
|
@ -273,108 +209,51 @@ HEADERS += \
|
||||||
wDevicesManager/controlvolumemanual.h \
|
wDevicesManager/controlvolumemanual.h \
|
||||||
wDevicesManager/controlvolumeschedule.h \
|
wDevicesManager/controlvolumeschedule.h \
|
||||||
wDevicesManager/controlvolumewidget.h \
|
wDevicesManager/controlvolumewidget.h \
|
||||||
wDevicesManager/devicescontrollwidget.h \
|
wDevicesManager/ctrladvancedpanel.h \
|
||||||
wDevicesManager/inputpassworddialog.h \
|
wDevicesManager/ctrlbrightpanel.h \
|
||||||
wDevicesManager/ledcard.h \
|
wDevicesManager/ledcard.h \
|
||||||
wDevicesManager/specialdlg.h \
|
wDevicesManager/specialdlg.h \
|
||||||
wDevicesManager/subspecifyip.h \
|
|
||||||
wDevicesManager/subspecifyiprange.h \
|
|
||||||
wDevicesManager/threadupgradeapk.h \
|
wDevicesManager/threadupgradeapk.h \
|
||||||
wDevicesManager/upgradeapkdialog.h \
|
wDevicesManager/upgradeapkdialog.h \
|
||||||
wDevicesManager/wdevicesitem.h \
|
|
||||||
wDevicesManager/wupgradeapkitem.h \
|
wDevicesManager/wupgradeapkitem.h \
|
||||||
|
wProgramManager/eaclock.h \
|
||||||
|
wProgramManager/eaudio.h \
|
||||||
|
wProgramManager/ebase.h \
|
||||||
|
wProgramManager/edclock.h \
|
||||||
|
wProgramManager/eenviron.h \
|
||||||
|
wProgramManager/egif.h \
|
||||||
|
wProgramManager/emultiwin.h \
|
||||||
|
wProgramManager/ephoto.h \
|
||||||
|
wProgramManager/etext.h \
|
||||||
|
wProgramManager/etimer.h \
|
||||||
|
wProgramManager/evideo.h \
|
||||||
|
wProgramManager/eweb.h \
|
||||||
wProgramManager/mconverter.h \
|
wProgramManager/mconverter.h \
|
||||||
|
wProgramManager/pageeditor.h \
|
||||||
|
wProgramManager/pagelistitem.h \
|
||||||
|
wProgramManager/progeditorwin.h \
|
||||||
wProgramManager/sendprogramdialog.h \
|
wProgramManager/sendprogramdialog.h \
|
||||||
|
wProgramManager/sendprogthread.h \
|
||||||
wProgramManager/threadexportprogrampro.h \
|
wProgramManager/threadexportprogrampro.h \
|
||||||
wProgramManager/threadsendpro.h \
|
|
||||||
wProgramManager/usbdetectdialog.h \
|
wProgramManager/usbdetectdialog.h \
|
||||||
wProgramManager/usbdiskfuncdialog.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclock.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclock.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/egif.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovie.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobject.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephoto.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etemp.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etext.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimer.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweather.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindow.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/fyxcircleprogress.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/imagecutwidget.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/qffwidget.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/videodec.h \
|
|
||||||
wProgramManager/wEditProgram/wattrview.h \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.h \
|
|
||||||
wProgramManager/wEditProgram/wpageitem.h \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.h \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.h \
|
|
||||||
wProgramManager/wEditProgram/wplanlist.h \
|
|
||||||
wProgramManager/wexportprogramitem.h \
|
wProgramManager/wexportprogramitem.h \
|
||||||
wProgramManager/wnewprogram.h \
|
wProgramManager/wnewprogram.h \
|
||||||
LoQClass/loqdialog.h \
|
wProgramManager/wplanitem.h \
|
||||||
LoQClass/loqpushbutton.h \
|
wProgramManager/wplanlist.h \
|
||||||
wProgramManager/weditprogram.h \
|
|
||||||
LoQClass/loqmainwindow.h \
|
|
||||||
LoQClass/loqtitlebar.h \
|
|
||||||
LoQClass/loqwindowtitlebar.h \
|
|
||||||
wProgramManager/wEditProgram/wmaintoolbar.h \
|
|
||||||
wProgramManager/wEditProgram/wpagelist.h \
|
|
||||||
wProgramManager/wEditProgram/wdrawingboard.h \
|
|
||||||
wProgramManager/wprogramitem.h \
|
wProgramManager/wprogramitem.h \
|
||||||
wProgramManager/wprogrampublishitem.h \
|
wProgramManager/wprogrampublishitem.h \
|
||||||
wProgramManagerA/wprogramitema.h
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
ColorDialog/ColorDialog.ui \
|
|
||||||
LoUIClass/aboutdlg.ui \
|
|
||||||
LoUIClass/changepasswordform.ui \
|
|
||||||
LoUIClass/loemptydialog.ui \
|
|
||||||
LoUIClass/louimsgboxokcancel.ui \
|
|
||||||
LoUIClass/pixbmpshowdialog.ui \
|
LoUIClass/pixbmpshowdialog.ui \
|
||||||
LoUIClass/softconfigdialog.ui \
|
|
||||||
LoUIClass/updateledset3dialog.ui \
|
LoUIClass/updateledset3dialog.ui \
|
||||||
LoUIClass/updaterdialog.ui \
|
LoUIClass/updaterdialog.ui \
|
||||||
LoUIClass/updaterfirmwaredialog.ui \
|
|
||||||
LoUIClass/x_uimsgboxok.ui \
|
LoUIClass/x_uimsgboxok.ui \
|
||||||
LoUIClass/x_uimsgboxokcancel.ui \
|
|
||||||
LoUIClass/x_uimsgboxonlyclosebtn.ui \
|
|
||||||
LoUIClass/x_uimsgboxyesnocancel.ui \
|
|
||||||
mainwindow.ui \
|
|
||||||
mdevicemanager.ui \
|
|
||||||
mdevicesetting.ui \
|
|
||||||
mguangyingpinwidget.ui \
|
mguangyingpinwidget.ui \
|
||||||
mprogrammanager.ui \
|
|
||||||
mprogrammanagera.ui \
|
|
||||||
publishform.ui \
|
|
||||||
tipdialog.ui \
|
tipdialog.ui \
|
||||||
wDevicesManager/controladvparamwidget.ui \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.ui \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.ui \
|
|
||||||
wDevicesManager/controlbrightnessschedule.ui \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.ui \
|
|
||||||
wDevicesManager/controlbrightnesswidget.ui \
|
|
||||||
wDevicesManager/controlencryptwidget.ui \
|
wDevicesManager/controlencryptwidget.ui \
|
||||||
wDevicesManager/controlhdmimanual.ui \
|
wDevicesManager/controlhdmimanual.ui \
|
||||||
wDevicesManager/controlhdmischedule.ui \
|
wDevicesManager/controlhdmischedule.ui \
|
||||||
wDevicesManager/controlhdmiwidget.ui \
|
wDevicesManager/controlhdmiwidget.ui \
|
||||||
wDevicesManager/controlnetconfigwidget.ui \
|
|
||||||
wDevicesManager/controlpowermanual.ui \
|
wDevicesManager/controlpowermanual.ui \
|
||||||
wDevicesManager/controlpowerschedule.ui \
|
wDevicesManager/controlpowerschedule.ui \
|
||||||
wDevicesManager/controlpowerwidget.ui \
|
wDevicesManager/controlpowerwidget.ui \
|
||||||
|
@ -383,141 +262,59 @@ FORMS += \
|
||||||
wDevicesManager/controlvolumemanual.ui \
|
wDevicesManager/controlvolumemanual.ui \
|
||||||
wDevicesManager/controlvolumeschedule.ui \
|
wDevicesManager/controlvolumeschedule.ui \
|
||||||
wDevicesManager/controlvolumewidget.ui \
|
wDevicesManager/controlvolumewidget.ui \
|
||||||
wDevicesManager/devicescontrollwidget.ui \
|
|
||||||
wDevicesManager/inputpassworddialog.ui \
|
|
||||||
wDevicesManager/specialdlg.ui \
|
|
||||||
wDevicesManager/subspecifyip.ui \
|
|
||||||
wDevicesManager/subspecifyiprange.ui \
|
|
||||||
wDevicesManager/upgradeapkdialog.ui \
|
wDevicesManager/upgradeapkdialog.ui \
|
||||||
wProgramManager/sendprogramdialog.ui \
|
|
||||||
wProgramManager/usbdetectdialog.ui \
|
|
||||||
wProgramManager/usbdiskfuncdialog.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/imagecutwidget.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/qffwidget.ui \
|
|
||||||
wProgramManager/wEditProgram/wattrview.ui \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.ui \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.ui \
|
|
||||||
wProgramManager/wnewprogram.ui \
|
wProgramManager/wnewprogram.ui \
|
||||||
wProgramManager/weditprogram.ui
|
wProgramManager/wplanitem.ui \
|
||||||
|
|
||||||
|
TRANSLATIONS += \
|
||||||
|
translations/app_zh_CN.ts \
|
||||||
|
translations/app_zh_TW.ts \
|
||||||
|
translations/app_ja.ts \
|
||||||
|
translations/app_en.ts
|
||||||
|
|
||||||
|
EXTRA_TRANSLATIONS += \
|
||||||
|
translations/qt_zh_CN.ts \
|
||||||
|
translations/qt_zh_TW.ts \
|
||||||
|
translations/qt_ja.ts \
|
||||||
|
translations/qt_en.ts
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
res.qrc \
|
||||||
|
qss.qrc
|
||||||
|
|
||||||
|
win32:RC_ICONS = res/Logo.ico
|
||||||
|
osx:ICON = res/Logo.icns
|
||||||
|
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
DISTFILES += \
|
|
||||||
qss/00_Common.css \
|
|
||||||
qss/01_Global.css \
|
|
||||||
qss/10_MainWindow.css \
|
|
||||||
qss/11_MainWindowTab.css \
|
|
||||||
qss/20_DeviceManager.css \
|
|
||||||
qss/21_DeviceSetting.css \
|
|
||||||
qss/30_ProgramManager.css \
|
|
||||||
qss/31_EditProgram.css \
|
|
||||||
qss/32_PageAttr.css \
|
|
||||||
qss/33_EWindow.css \
|
|
||||||
qss/MainWnd.css \
|
|
||||||
qss/MainTab.css \
|
|
||||||
qss/TabDeviceManager.css \
|
|
||||||
qss/TabProgramManager.css \
|
|
||||||
qss/TabPMEditProgram.css \
|
|
||||||
res/Logo.ico
|
|
||||||
|
|
||||||
RESOURCES += \
|
|
||||||
icons.qrc \
|
|
||||||
images.qrc \
|
|
||||||
languages.qrc \
|
|
||||||
qss.qrc
|
|
||||||
|
|
||||||
TRANSLATIONS += Languages/zhCN.ts Languages/enUS.ts Languages/jaJP.ts Languages/zhTH.ts
|
|
||||||
|
|
||||||
#DEFINES += QT_NO_CAST_FROM_ASCII
|
|
||||||
|
|
||||||
win32:RC_ICONS = res/Logo.ico
|
|
||||||
osx:ICON = res/Logo.icns
|
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/include
|
|
||||||
win32 {
|
|
||||||
LIBS += -L$$PWD/lib -lquazip
|
|
||||||
}
|
|
||||||
win64 {
|
|
||||||
LIBS += -L$$PWD/lib64 -lquazip
|
|
||||||
}
|
|
||||||
win32 {
|
|
||||||
INCLUDEPATH += $$PWD/ffmpeg-4.2.2-win32-dev/include
|
|
||||||
LIBS += $$PWD/ffmpeg-4.2.2-win32-dev/lib/avformat.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avcodec.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avdevice.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avfilter.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avutil.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/postproc.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/swresample.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/swscale.lib
|
|
||||||
}
|
|
||||||
|
|
||||||
include(./JQLibrary/JQLibrary.pri)
|
|
||||||
include(./QSimpleUpdater/QSimpleUpdater.pri)
|
|
||||||
|
|
||||||
#QMAKE_CXXFLAGS_RELEASE += -g
|
|
||||||
#QMAKE_CFLAGS_RELEASE += -g
|
|
||||||
#QMAKE_LFLAGS_RELEASE = -mthreads -Wl,#其中最后的逗号注意添加,如果不添加可能编译不过
|
|
||||||
##禁止优化
|
|
||||||
#QMAKE_CFLAGS_RELEASE -= -O2
|
|
||||||
#QMAKE_CXXFLAGS_RELEASE -= -O2
|
|
||||||
|
|
||||||
#QMAKE_CXXFLAGS_RELEASE += -g
|
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/ffmpeg/include
|
||||||
|
LIBS += -L$$PWD/ffmpeg/lib/\
|
||||||
#QMAKE_CFLAGS_RELEASE += -g
|
|
||||||
#QMAKE_LFLAGS_RELEASE = -mthreads -W
|
|
||||||
#LIBS += -ldbghelp
|
|
||||||
#QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
|
|
||||||
#QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
|
|
||||||
#QMAKE_LFLAGS_RELEASE += /MAP /DEBUG /opt:ref /INCREMENTAL:NO
|
|
||||||
#QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG
|
|
||||||
|
|
||||||
#LIBS += -Lffmpeg/Lib/ffmpeg/lib -lavutil -lavformat -lavcodec -lavdevice -lavfilter -lpostproc -lswresample -lswscale
|
|
||||||
#LIBS += -LG:\Dev\QT\LedOK-master\LedOK-master\ffmpeg\lib -lavutil -lavformat -lavcodec -lavdevice -lavfilter -lpostproc -lswresample -lswscale
|
|
||||||
#LIBS += -LG:\Dev\QT\LedOK-master\LedOK-master\sdl\lib -lSDL2
|
|
||||||
|
|
||||||
#RC_FILE=main.rc
|
|
||||||
|
|
||||||
|
|
||||||
unix|win32: LIBS += -L$$PWD/wProgramManager/wEditProgram/wElement/mpv/ -llibmpv.dll
|
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/wProgramManager/wEditProgram/wElement/mpv
|
|
||||||
DEPENDPATH += $$PWD/wProgramManager/wEditProgram/wElement/mpv
|
|
||||||
|
|
||||||
LIBS += -L$$PWD/../ffmpeg/lib/\
|
|
||||||
-lavcodec \
|
-lavcodec \
|
||||||
-lavdevice \
|
-lavdevice \
|
||||||
-lavfilter \
|
-lavfilter \
|
||||||
-lavformat \
|
-lavformat \
|
||||||
-lavutil \
|
-lavutil \
|
||||||
-lswresample \
|
-lswresample \
|
||||||
-lswscale\
|
-lswscale
|
||||||
|
|
||||||
#SDL2
|
copy.files += $$files(ffmpeg/lib/*.dll)
|
||||||
LIBS += -L$$PWD/../SDL2/lib/\
|
|
||||||
-lSDL2
|
|
||||||
INCLUDEPATH += $$PWD/../ffmpeg/include \
|
|
||||||
$$PWD/../SDL2/include
|
|
||||||
|
|
||||||
|
include(./xlsx/qtxlsx.pri)
|
||||||
|
include(./QSimpleUpdater/QSimpleUpdater.pri)
|
||||||
|
|
||||||
|
# for https requests
|
||||||
|
copy.files += $$files(OpenSSL/*.dll)
|
||||||
|
|
||||||
|
copy.files += 7z/7z.dll
|
||||||
|
copy.files += 7z/7z.exe
|
||||||
|
|
||||||
|
copy.path = $$OUT_PWD/release
|
||||||
|
|
||||||
|
CONFIG += file_copies
|
||||||
|
COPIES += copy
|
||||||
|
|
|
@ -1,471 +0,0 @@
|
||||||
#-------------------------------------------------
|
|
||||||
#
|
|
||||||
# Project created by QtCreator 2019-04-10T23:15:55
|
|
||||||
#
|
|
||||||
#-------------------------------------------------
|
|
||||||
|
|
||||||
QT += core gui
|
|
||||||
QT += network
|
|
||||||
QT += core network concurrent
|
|
||||||
QT += axcontainer
|
|
||||||
|
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets multimedia multimediawidgets network
|
|
||||||
|
|
||||||
#TARGET = LedOK
|
|
||||||
TARGET = $$quote(Xanadu Express)
|
|
||||||
TEMPLATE = app
|
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
|
||||||
# any feature of Qt which has been marked as deprecated (the exact warnings
|
|
||||||
# depend on your compiler). Please consult the documentation of the
|
|
||||||
# deprecated API in order to know how to port your code away from it.
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS
|
|
||||||
|
|
||||||
# You can also make your code fail to compile if you use deprecated APIs.
|
|
||||||
# In order to do so, uncomment the following line.
|
|
||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
|
||||||
|
|
||||||
CONFIG += c++11
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
LoQClass/extendedgroupbox.cpp \
|
|
||||||
LoQClass/locolorselector.cpp \
|
|
||||||
LoQClass/lodateselector.cpp \
|
|
||||||
LoQClass/loglwindow.cpp \
|
|
||||||
LoQClass/loqgraphicsobject.cpp \
|
|
||||||
LoQClass/loqgraphicsvideoitem.cpp \
|
|
||||||
LoQClass/loqheaderviewcheckbox.cpp \
|
|
||||||
LoQClass/loqlineedit.cpp \
|
|
||||||
LoQClass/loqtreewidget.cpp \
|
|
||||||
LoQClass/loqvideosurface.cpp \
|
|
||||||
LoQClass/qexcel.cpp \
|
|
||||||
LoQClass/readexcel.cpp \
|
|
||||||
LoUIClass/aboutdlg.cpp \
|
|
||||||
LoUIClass/customprogressindicator.cpp \
|
|
||||||
LoUIClass/loemptydialog.cpp \
|
|
||||||
LoUIClass/louimsgboxokcancel.cpp \
|
|
||||||
LoUIClass/qiplineedit.cpp \
|
|
||||||
LoUIClass/switchcontrol.cpp \
|
|
||||||
LoUIClass/x_spinboxdelegate.cpp \
|
|
||||||
LoUIClass/x_timeeditdelegate.cpp \
|
|
||||||
LoUIClass/x_uimsgboxok.cpp \
|
|
||||||
LoUIClass/x_uimsgboxokcancel.cpp \
|
|
||||||
LoUIClass/x_uimsgboxyesnocancel.cpp \
|
|
||||||
backup/mprogrammanager.cpp \
|
|
||||||
communication/hpptclient.cpp \
|
|
||||||
communication/network.cpp \
|
|
||||||
globaldefine.cpp \
|
|
||||||
importbninprogramdlg.cpp \
|
|
||||||
jsondecoderloop.cpp \
|
|
||||||
loappconfig.cpp \
|
|
||||||
loapptools.cpp \
|
|
||||||
main.cpp \
|
|
||||||
mainwindow.cpp \
|
|
||||||
mdevicemanager.cpp \
|
|
||||||
mdevicesetting.cpp \
|
|
||||||
mprogrammanagera.cpp \
|
|
||||||
mtitlebar.cpp \
|
|
||||||
mtabwidget.cpp \
|
|
||||||
mprogrammanager.cpp \
|
|
||||||
publishform.cpp \
|
|
||||||
switchcontrol.cpp \
|
|
||||||
tipdialog.cpp \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.cpp \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.cpp \
|
|
||||||
wDevicesManager/controlbrightnessschedule.cpp \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.cpp \
|
|
||||||
wDevicesManager/controlbrightnesswidget.cpp \
|
|
||||||
wDevicesManager/controlencryptwidget.cpp \
|
|
||||||
wDevicesManager/controlhdmimanual.cpp \
|
|
||||||
wDevicesManager/controlhdmischedule.cpp \
|
|
||||||
wDevicesManager/controlhdmiwidget.cpp \
|
|
||||||
wDevicesManager/controlnetconfigwidget.cpp \
|
|
||||||
wDevicesManager/controlpowermanual.cpp \
|
|
||||||
wDevicesManager/controlpowerschedule.cpp \
|
|
||||||
wDevicesManager/controlpowerwidget.cpp \
|
|
||||||
wDevicesManager/controlverifyclockwidget.cpp \
|
|
||||||
wDevicesManager/devicescontrollwidget.cpp \
|
|
||||||
wDevicesManager/inputpassworddialog.cpp \
|
|
||||||
wDevicesManager/ledcard.cpp \
|
|
||||||
wDevicesManager/specialdlg.cpp \
|
|
||||||
wDevicesManager/subspecifyip.cpp \
|
|
||||||
wDevicesManager/subspecifyiprange.cpp \
|
|
||||||
wDevicesManager/wdevicesitem.cpp \
|
|
||||||
wProgramManager/mconverter.cpp \
|
|
||||||
wProgramManager/sendprogramdialog.cpp \
|
|
||||||
wProgramManager/threadsendpro.cpp \
|
|
||||||
wProgramManager/usbdiskfuncdialog.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/backup/etext.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclock.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclock.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/egif.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovie.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobject.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephoto.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etemp.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etext.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimer.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweather.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindow.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wElement/fyxcircleprogress.cpp \
|
|
||||||
wProgramManager/wEditProgram/wattrview.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageitem.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.cpp \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.cpp \
|
|
||||||
wProgramManager/wEditProgram/wplanlist.cpp \
|
|
||||||
wProgramManager/wnewprogram.cpp \
|
|
||||||
LoQClass/loqdialog.cpp \
|
|
||||||
LoQClass/loqpushbutton.cpp \
|
|
||||||
wProgramManager/weditprogram.cpp \
|
|
||||||
LoQClass/loqmainwindow.cpp \
|
|
||||||
LoQClass/loqtitlebar.cpp \
|
|
||||||
LoQClass/loqwindowtitlebar.cpp \
|
|
||||||
wProgramManager/wEditProgram/wmaintoolbar.cpp \
|
|
||||||
wProgramManager/wEditProgram/wpagelist.cpp \
|
|
||||||
wProgramManager/wEditProgram/wdrawingboard.cpp \
|
|
||||||
wProgramManager/wprogramitem.cpp \
|
|
||||||
wProgramManager/wprogrampublishitem.cpp \
|
|
||||||
wProgramManagerA/wprogramitema.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
LoQClass/extendedgroupbox.h \
|
|
||||||
LoQClass/locolorselector.h \
|
|
||||||
LoQClass/lodateselector.h \
|
|
||||||
LoQClass/loglwindow.h \
|
|
||||||
LoQClass/loqgraphicsobject.h \
|
|
||||||
LoQClass/loqgraphicsvideoitem.h \
|
|
||||||
LoQClass/loqheaderviewcheckbox.h \
|
|
||||||
LoQClass/loqlineedit.h \
|
|
||||||
LoQClass/loqmacro.h \
|
|
||||||
LoQClass/loqtreewidget.h \
|
|
||||||
LoQClass/loqvideosurface.h \
|
|
||||||
LoQClass/qexcel.h \
|
|
||||||
LoQClass/readexcel.h \
|
|
||||||
LoUIClass/aboutdlg.h \
|
|
||||||
LoUIClass/customprogressindicator.h \
|
|
||||||
LoUIClass/loemptydialog.h \
|
|
||||||
LoUIClass/louimsgboxok.h \
|
|
||||||
LoUIClass/louimsgboxokcancel.h \
|
|
||||||
LoUIClass/qiplineedit.h \
|
|
||||||
LoUIClass/switchcontrol.h \
|
|
||||||
LoUIClass/x_spinboxdelegate.h \
|
|
||||||
LoUIClass/x_timeeditdelegate.h \
|
|
||||||
LoUIClass/x_uimsgboxok.h \
|
|
||||||
LoUIClass/x_uimsgboxokcancel.h \
|
|
||||||
LoUIClass/x_uimsgboxyesnocancel.h \
|
|
||||||
backup/mprogrammanager.h \
|
|
||||||
communication/hpptclient - 副本.h \
|
|
||||||
communication/hpptclient.h \
|
|
||||||
communication/network.h \
|
|
||||||
globaldefine.h \
|
|
||||||
importbninprogramdlg.h \
|
|
||||||
include/JlCompress.h \
|
|
||||||
include/ioapi.h \
|
|
||||||
include/minizip_crypt.h \
|
|
||||||
include/quaadler32.h \
|
|
||||||
include/quachecksum32.h \
|
|
||||||
include/quacrc32.h \
|
|
||||||
include/quagzipfile.h \
|
|
||||||
include/quaziodevice.h \
|
|
||||||
include/quazip.h \
|
|
||||||
include/quazip_global.h \
|
|
||||||
include/quazipdir.h \
|
|
||||||
include/quazipfile.h \
|
|
||||||
include/quazipfileinfo.h \
|
|
||||||
include/quazipnewinfo.h \
|
|
||||||
include/unzip.h \
|
|
||||||
include/zconf.h \
|
|
||||||
include/zip.h \
|
|
||||||
include/zlib.h \
|
|
||||||
jsondecoderloop.h \
|
|
||||||
loappconfig.h \
|
|
||||||
loapptools.h \
|
|
||||||
mainwindow.h \
|
|
||||||
mdevicemanager.h \
|
|
||||||
mdevicesetting.h \
|
|
||||||
mprogrammanagera.h \
|
|
||||||
mtitlebar.h \
|
|
||||||
mtabwidget.h \
|
|
||||||
mprogrammanager.h \
|
|
||||||
publishform.h \
|
|
||||||
sdl/include/SDL.h \
|
|
||||||
sdl/include/SDL_assert.h \
|
|
||||||
sdl/include/SDL_atomic.h \
|
|
||||||
sdl/include/SDL_audio.h \
|
|
||||||
sdl/include/SDL_bits.h \
|
|
||||||
sdl/include/SDL_blendmode.h \
|
|
||||||
sdl/include/SDL_clipboard.h \
|
|
||||||
sdl/include/SDL_config.h \
|
|
||||||
sdl/include/SDL_cpuinfo.h \
|
|
||||||
sdl/include/SDL_egl.h \
|
|
||||||
sdl/include/SDL_endian.h \
|
|
||||||
sdl/include/SDL_error.h \
|
|
||||||
sdl/include/SDL_events.h \
|
|
||||||
sdl/include/SDL_filesystem.h \
|
|
||||||
sdl/include/SDL_gamecontroller.h \
|
|
||||||
sdl/include/SDL_gesture.h \
|
|
||||||
sdl/include/SDL_haptic.h \
|
|
||||||
sdl/include/SDL_hints.h \
|
|
||||||
sdl/include/SDL_joystick.h \
|
|
||||||
sdl/include/SDL_keyboard.h \
|
|
||||||
sdl/include/SDL_keycode.h \
|
|
||||||
sdl/include/SDL_loadso.h \
|
|
||||||
sdl/include/SDL_log.h \
|
|
||||||
sdl/include/SDL_main.h \
|
|
||||||
sdl/include/SDL_messagebox.h \
|
|
||||||
sdl/include/SDL_metal.h \
|
|
||||||
sdl/include/SDL_mouse.h \
|
|
||||||
sdl/include/SDL_mutex.h \
|
|
||||||
sdl/include/SDL_name.h \
|
|
||||||
sdl/include/SDL_opengl.h \
|
|
||||||
sdl/include/SDL_opengl_glext.h \
|
|
||||||
sdl/include/SDL_opengles.h \
|
|
||||||
sdl/include/SDL_opengles2.h \
|
|
||||||
sdl/include/SDL_opengles2_gl2.h \
|
|
||||||
sdl/include/SDL_opengles2_gl2ext.h \
|
|
||||||
sdl/include/SDL_opengles2_gl2platform.h \
|
|
||||||
sdl/include/SDL_opengles2_khrplatform.h \
|
|
||||||
sdl/include/SDL_pixels.h \
|
|
||||||
sdl/include/SDL_platform.h \
|
|
||||||
sdl/include/SDL_power.h \
|
|
||||||
sdl/include/SDL_quit.h \
|
|
||||||
sdl/include/SDL_rect.h \
|
|
||||||
sdl/include/SDL_render.h \
|
|
||||||
sdl/include/SDL_revision.h \
|
|
||||||
sdl/include/SDL_rwops.h \
|
|
||||||
sdl/include/SDL_scancode.h \
|
|
||||||
sdl/include/SDL_sensor.h \
|
|
||||||
sdl/include/SDL_shape.h \
|
|
||||||
sdl/include/SDL_stdinc.h \
|
|
||||||
sdl/include/SDL_surface.h \
|
|
||||||
sdl/include/SDL_system.h \
|
|
||||||
sdl/include/SDL_syswm.h \
|
|
||||||
sdl/include/SDL_test.h \
|
|
||||||
sdl/include/SDL_test_assert.h \
|
|
||||||
sdl/include/SDL_test_common.h \
|
|
||||||
sdl/include/SDL_test_compare.h \
|
|
||||||
sdl/include/SDL_test_crc32.h \
|
|
||||||
sdl/include/SDL_test_font.h \
|
|
||||||
sdl/include/SDL_test_fuzzer.h \
|
|
||||||
sdl/include/SDL_test_harness.h \
|
|
||||||
sdl/include/SDL_test_images.h \
|
|
||||||
sdl/include/SDL_test_log.h \
|
|
||||||
sdl/include/SDL_test_md5.h \
|
|
||||||
sdl/include/SDL_test_memory.h \
|
|
||||||
sdl/include/SDL_test_random.h \
|
|
||||||
sdl/include/SDL_thread.h \
|
|
||||||
sdl/include/SDL_timer.h \
|
|
||||||
sdl/include/SDL_touch.h \
|
|
||||||
sdl/include/SDL_types.h \
|
|
||||||
sdl/include/SDL_version.h \
|
|
||||||
sdl/include/SDL_video.h \
|
|
||||||
sdl/include/SDL_vulkan.h \
|
|
||||||
sdl/include/begin_code.h \
|
|
||||||
sdl/include/close_code.h \
|
|
||||||
switchcontrol.h \
|
|
||||||
tipdialog.h \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.h \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.h \
|
|
||||||
wDevicesManager/controlbrightnessschedule.h \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.h \
|
|
||||||
wDevicesManager/controlbrightnesswidget.h \
|
|
||||||
wDevicesManager/controlencryptwidget.h \
|
|
||||||
wDevicesManager/controlhdmimanual.h \
|
|
||||||
wDevicesManager/controlhdmischedule.h \
|
|
||||||
wDevicesManager/controlhdmiwidget.h \
|
|
||||||
wDevicesManager/controlnetconfigwidget.h \
|
|
||||||
wDevicesManager/controlpowermanual.h \
|
|
||||||
wDevicesManager/controlpowerschedule.h \
|
|
||||||
wDevicesManager/controlpowerwidget.h \
|
|
||||||
wDevicesManager/controlverifyclockwidget.h \
|
|
||||||
wDevicesManager/devicescontrollwidget.h \
|
|
||||||
wDevicesManager/inputpassworddialog.h \
|
|
||||||
wDevicesManager/ledcard.h \
|
|
||||||
wDevicesManager/specialdlg.h \
|
|
||||||
wDevicesManager/subspecifyip.h \
|
|
||||||
wDevicesManager/subspecifyiprange.h \
|
|
||||||
wDevicesManager/wdevicesitem.h \
|
|
||||||
wProgramManager/mconverter.h \
|
|
||||||
wProgramManager/sendprogramdialog.h \
|
|
||||||
wProgramManager/threadsendpro.h \
|
|
||||||
wProgramManager/usbdiskfuncdialog.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/backup/etext.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclock.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclock.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/egif.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovie.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobject.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephoto.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etemp.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etext.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimer.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweather.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindow.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.h \
|
|
||||||
wProgramManager/wEditProgram/wElement/fyxcircleprogress.h \
|
|
||||||
wProgramManager/wEditProgram/wattrview.h \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.h \
|
|
||||||
wProgramManager/wEditProgram/wpageitem.h \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.h \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.h \
|
|
||||||
wProgramManager/wEditProgram/wplanlist.h \
|
|
||||||
wProgramManager/wnewprogram.h \
|
|
||||||
LoQClass/loqdialog.h \
|
|
||||||
LoQClass/loqpushbutton.h \
|
|
||||||
wProgramManager/weditprogram.h \
|
|
||||||
LoQClass/loqmainwindow.h \
|
|
||||||
LoQClass/loqtitlebar.h \
|
|
||||||
LoQClass/loqwindowtitlebar.h \
|
|
||||||
wProgramManager/wEditProgram/wmaintoolbar.h \
|
|
||||||
wProgramManager/wEditProgram/wpagelist.h \
|
|
||||||
wProgramManager/wEditProgram/wdrawingboard.h \
|
|
||||||
wProgramManager/wprogramitem.h \
|
|
||||||
wProgramManager/wprogrampublishitem.h \
|
|
||||||
wProgramManagerA/wprogramitema.h
|
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
LoUIClass/aboutdlg.ui \
|
|
||||||
LoUIClass/loemptydialog.ui \
|
|
||||||
LoUIClass/louimsgboxokcancel.ui \
|
|
||||||
LoUIClass/x_uimsgboxok.ui \
|
|
||||||
LoUIClass/x_uimsgboxokcancel.ui \
|
|
||||||
LoUIClass/x_uimsgboxyesnocancel.ui \
|
|
||||||
mainwindow.ui \
|
|
||||||
mdevicemanager.ui \
|
|
||||||
mdevicesetting.ui \
|
|
||||||
mprogrammanager.ui \
|
|
||||||
mprogrammanagera.ui \
|
|
||||||
publishform.ui \
|
|
||||||
tipdialog.ui \
|
|
||||||
wDevicesManager/controlbrightnessautowidget.ui \
|
|
||||||
wDevicesManager/controlbrightnessmanualwidget.ui \
|
|
||||||
wDevicesManager/controlbrightnessschedule.ui \
|
|
||||||
wDevicesManager/controlbrightnessscheduleedit.ui \
|
|
||||||
wDevicesManager/controlbrightnesswidget.ui \
|
|
||||||
wDevicesManager/controlencryptwidget.ui \
|
|
||||||
wDevicesManager/controlhdmimanual.ui \
|
|
||||||
wDevicesManager/controlhdmischedule.ui \
|
|
||||||
wDevicesManager/controlhdmiwidget.ui \
|
|
||||||
wDevicesManager/controlnetconfigwidget.ui \
|
|
||||||
wDevicesManager/controlpowermanual.ui \
|
|
||||||
wDevicesManager/controlpowerschedule.ui \
|
|
||||||
wDevicesManager/controlpowerwidget.ui \
|
|
||||||
wDevicesManager/controlverifyclockwidget.ui \
|
|
||||||
wDevicesManager/devicescontrollwidget.ui \
|
|
||||||
wDevicesManager/inputpassworddialog.ui \
|
|
||||||
wDevicesManager/specialdlg.ui \
|
|
||||||
wDevicesManager/subspecifyip.ui \
|
|
||||||
wDevicesManager/subspecifyiprange.ui \
|
|
||||||
wProgramManager/sendprogramdialog.ui \
|
|
||||||
wProgramManager/usbdiskfuncdialog.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eaclockattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/edclockattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/egifattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/emovieattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eobjectattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/ephotoattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etempattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextflipattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextinput.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextscrollattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etextstaticattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/etimerattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/eweatherattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wElement/ewindowattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wattrview.ui \
|
|
||||||
wProgramManager/wEditProgram/wpageattr.ui \
|
|
||||||
wProgramManager/wEditProgram/wpageitemwidget.ui \
|
|
||||||
wProgramManager/wEditProgram/wplanitem.ui \
|
|
||||||
wProgramManager/wnewprogram.ui \
|
|
||||||
wProgramManager/weditprogram.ui
|
|
||||||
|
|
||||||
# Default rules for deployment.
|
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|
||||||
!isEmpty(target.path): INSTALLS += target
|
|
||||||
|
|
||||||
DISTFILES += \
|
|
||||||
qss/MainWnd.css \
|
|
||||||
qss/MainTab.css \
|
|
||||||
qss/TabDeviceManager.css \
|
|
||||||
qss/TabProgramManager.css \
|
|
||||||
qss/TabPMEditProgram.css \
|
|
||||||
res/Logo.ico
|
|
||||||
|
|
||||||
RESOURCES += \
|
|
||||||
icons.qrc \
|
|
||||||
images.qrc \
|
|
||||||
languages.qrc \
|
|
||||||
qss.qrc
|
|
||||||
|
|
||||||
TRANSLATIONS += Languages/zhCN.ts Languages/enUS.ts Languages/jaJP.ts
|
|
||||||
|
|
||||||
#DEFINES += QT_NO_CAST_FROM_ASCII
|
|
||||||
win32:RC_ICONS = res/Logo.ico
|
|
||||||
osx:ICON = res/Logo.icns
|
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/include
|
|
||||||
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
LIBS += -L$$PWD/lib -lquazipd
|
|
||||||
} else {
|
|
||||||
LIBS += -L$$PWD/lib -lquazip
|
|
||||||
}
|
|
||||||
|
|
||||||
win32 {
|
|
||||||
INCLUDEPATH += $$PWD/ffmpeg-4.2.2-win32-dev/include
|
|
||||||
LIBS += $$PWD/ffmpeg-4.2.2-win32-dev/lib/avformat.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avcodec.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avdevice.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avfilter.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/avutil.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/postproc.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/swresample.lib \
|
|
||||||
$$PWD/ffmpeg-4.2.2-win32-dev/lib/swscale.lib
|
|
||||||
}
|
|
||||||
|
|
||||||
include(./JQLibrary/JQLibrary.pri)
|
|
||||||
|
|
||||||
#INCLUDEPATH +="G:\Dev\QT\LedOK-master\LedOK-master\ffmpeg\include"
|
|
||||||
#INCLUDEPATH +="G:\Dev\QT\LedOK-master\LedOK-master\sdl\include"
|
|
||||||
|
|
||||||
#LIBS += -Lffmpeg/Lib/ffmpeg/lib -lavutil -lavformat -lavcodec -lavdevice -lavfilter -lpostproc -lswresample -lswscale
|
|
||||||
#LIBS += -LG:\Dev\QT\LedOK-master\LedOK-master\ffmpeg\lib -lavutil -lavformat -lavcodec -lavdevice -lavfilter -lpostproc -lswresample -lswscale
|
|
||||||
#LIBS += -LG:\Dev\QT\LedOK-master\LedOK-master\sdl\lib -lSDL2
|
|
||||||
|
|
||||||
SUBDIRS += \
|
|
|
@ -1,63 +0,0 @@
|
||||||
#include "locolorselector.h"
|
|
||||||
#include "./ColorDialog/ColorDialog.h"
|
|
||||||
LoColorSelector::LoColorSelector(QWidget *parent) :
|
|
||||||
QPushButton(parent),
|
|
||||||
m_text(""),
|
|
||||||
m_color(Qt::transparent)
|
|
||||||
{ init(); }
|
|
||||||
|
|
||||||
LoColorSelector::LoColorSelector(const QString &text, const QColor &color, QWidget *parent):
|
|
||||||
QPushButton(parent),
|
|
||||||
m_text(text),
|
|
||||||
m_color(color)
|
|
||||||
{ init(); }
|
|
||||||
|
|
||||||
void LoColorSelector::init()
|
|
||||||
{
|
|
||||||
setText(m_text);
|
|
||||||
setColor(m_color);
|
|
||||||
connect(this, SIGNAL(clicked()), this, SLOT(onColorChanged()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoColorSelector::setColor(const QColor &color)
|
|
||||||
{
|
|
||||||
QFont ft = font();
|
|
||||||
QString sColor;
|
|
||||||
if(color.alpha() == 0) {
|
|
||||||
ft.setStrikeOut(true);
|
|
||||||
} else {
|
|
||||||
ft.setStrikeOut(false);
|
|
||||||
}
|
|
||||||
sColor = QString("background-color: rgba(%1, %2, %3, %4);color: rgba(%5, %6, %7, %8);").
|
|
||||||
arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha()).arg(255-color.red()).arg(255-color.green()).arg(255-color.blue()).arg(255);
|
|
||||||
setStyleSheet(sColor);
|
|
||||||
// QString strFontColor;
|
|
||||||
// strFontColor = QString("color: rgba(%1, %2, %3, %4);").
|
|
||||||
// arg(255-color.red()).arg(255-color.green()).arg(255-color.blue()).arg(255);
|
|
||||||
// setStyleSheet(strFontColor);
|
|
||||||
|
|
||||||
setFont(ft);
|
|
||||||
m_color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoColorSelector::onColorChanged()
|
|
||||||
{
|
|
||||||
bool bAlpha=true;
|
|
||||||
// if(this->text()=="T")
|
|
||||||
// bAlpha=false;
|
|
||||||
ColorDialog *m_pColorDlg = new ColorDialog(m_color,bAlpha,this);
|
|
||||||
connect(m_pColorDlg, SIGNAL(accepted()), this, SLOT(onAccepted()));
|
|
||||||
m_pColorDlg->showDialog();
|
|
||||||
if(m_pColorDlg->m_buttonRole==m_pColorDlg->Yes)
|
|
||||||
{
|
|
||||||
QColor color=m_pColorDlg->getRgba();
|
|
||||||
// m_color.setAlpha(255);
|
|
||||||
// QColor color = ColorDialog::getColor();//::getColor(m_color, nullptr, tr("Select Color"), QColorDialog::ShowAlphaChannel);
|
|
||||||
if(color.isValid()) {
|
|
||||||
setColor(color);
|
|
||||||
|
|
||||||
emit sColorChanged(color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
#include "lodateselector.h"
|
|
||||||
#include "LoUIClass/x_uimsgboxonlyclosebtn.h"
|
|
||||||
LoDateSelector::LoDateSelector(QWidget *parent) :
|
|
||||||
QPushButton(parent)
|
|
||||||
{
|
|
||||||
connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoDateSelector::onClicked(bool)
|
|
||||||
{
|
|
||||||
|
|
||||||
// LoQDialog *w = new LoQDialog(this);
|
|
||||||
// QCalendarWidget *wDate = new QCalendarWidget();
|
|
||||||
// QVBoxLayout *layout = new QVBoxLayout();
|
|
||||||
// layout->addWidget(wDate, 1);
|
|
||||||
// connect(wDate, SIGNAL(clicked(const QDate &)), w, SLOT(accept()));
|
|
||||||
// connect(wDate, SIGNAL(clicked(const QDate &)), this, SIGNAL(sDateSelected(const QDate &)));
|
|
||||||
// w->setLayout(layout);
|
|
||||||
// w->exec();
|
|
||||||
x_uiMsgBoxOnlyCloseBtn *w = new x_uiMsgBoxOnlyCloseBtn(tr("Date selector"),this);
|
|
||||||
QCalendarWidget *wDate = new QCalendarWidget();
|
|
||||||
connect(wDate, SIGNAL(clicked(const QDate &)), w, SLOT(accept()));
|
|
||||||
connect(wDate, SIGNAL(clicked(const QDate &)), this, SIGNAL(sDateSelected(const QDate &)));
|
|
||||||
w->InSertDateSelector(wDate);
|
|
||||||
w->exec();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
#include "loglwindow.h"
|
|
||||||
|
|
||||||
LoGLWindow::LoGLWindow(QScreen *screen)
|
|
||||||
: QWindow(screen)
|
|
||||||
{
|
|
||||||
setSurfaceType(OpenGLSurface);
|
|
||||||
create();
|
|
||||||
// Create an OpenGL context
|
|
||||||
m_context = new QOpenGLContext;
|
|
||||||
m_context->create();
|
|
||||||
// Setup scene and render it
|
|
||||||
m_context->makeCurrent(this);
|
|
||||||
initializeOpenGLFunctions();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString LoGLWindow::vendor() { return QString(reinterpret_cast<const char *>(glGetString(GL_VENDOR))); }
|
|
||||||
QString LoGLWindow::renderer() { return QString(reinterpret_cast<const char *>(glGetString(GL_RENDERER))); }
|
|
||||||
QString LoGLWindow::version() { return QString(reinterpret_cast<const char *>(glGetString(GL_VERSION))); }
|
|
||||||
QString LoGLWindow::extensions() { return QString(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS))); }
|
|
|
@ -1,28 +0,0 @@
|
||||||
#ifndef LOGLWINDOW_H
|
|
||||||
#define LOGLWINDOW_H
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QWindow>
|
|
||||||
#include <QOpenGLWidget>
|
|
||||||
#include <QOpenGLFunctions>
|
|
||||||
|
|
||||||
class LoGLWindow : public QWindow, protected QOpenGLFunctions
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
LoGLWindow(QScreen *screen = nullptr);
|
|
||||||
|
|
||||||
public:
|
|
||||||
QString vendor();
|
|
||||||
QString renderer();
|
|
||||||
QString version();
|
|
||||||
QString extensions();
|
|
||||||
|
|
||||||
public:
|
|
||||||
QOpenGLContext *context() { return m_context; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QOpenGLContext *m_context;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOGLWINDOW_H
|
|
|
@ -1,65 +0,0 @@
|
||||||
#include "loqdialog.h"
|
|
||||||
|
|
||||||
LoQDialog::LoQDialog(QWidget *parent) : QDialog(parent)
|
|
||||||
{
|
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
setAttribute(Qt::WA_TranslucentBackground);
|
|
||||||
setWindowFlags(windowFlags() &
|
|
||||||
~Qt::WindowContextHelpButtonHint |
|
|
||||||
Qt::Dialog|Qt::FramelessWindowHint
|
|
||||||
//|Qt::Tool
|
|
||||||
);
|
|
||||||
setWindowModality(Qt::WindowModal);
|
|
||||||
|
|
||||||
// setWindowFlags(windowFlags() &
|
|
||||||
// ~Qt::WindowContextHelpButtonHint |
|
|
||||||
// Qt::FramelessWindowHint |
|
|
||||||
// Qt::Tool);
|
|
||||||
// setWindowFlags(windowFlags() &
|
|
||||||
// ~Qt::WindowContextHelpButtonHint |
|
|
||||||
// Qt::FramelessWindowHint |
|
|
||||||
// Qt::Tool);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQDialog::mousePressEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (event->button() == Qt::LeftButton) {
|
|
||||||
QRect gRect = this->geometry();
|
|
||||||
gRect.setWidth(gRect.width() - 10);
|
|
||||||
gRect.setHeight(gRect.height() - 10);
|
|
||||||
gRect.setX(gRect.x() + 5);
|
|
||||||
gRect.setY(gRect.y() + 5);
|
|
||||||
|
|
||||||
if(gRect.contains(event->globalPos())) {
|
|
||||||
m_winMove = true;
|
|
||||||
m_winOrgPoint = event->globalPos();
|
|
||||||
m_winWorldPoint = this->frameGeometry().topLeft();
|
|
||||||
} else {
|
|
||||||
// Resize the window
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQDialog::mouseMoveEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
//return;
|
|
||||||
if(m_winMove) {
|
|
||||||
if (event->buttons() & Qt::LeftButton) {
|
|
||||||
QPoint relativePos = event->globalPos() - m_winOrgPoint;
|
|
||||||
this->move(m_winWorldPoint + relativePos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQDialog::mouseReleaseEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
if (event->button() == Qt::LeftButton) {
|
|
||||||
m_winMove = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void LoQDialog::showEvent(QShowEvent *event) {
|
|
||||||
this->setAttribute(Qt::WA_Mapped);
|
|
||||||
QWidget::showEvent(event);
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
#ifndef LOQDIALOG_H
|
|
||||||
#define LOQDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
|
|
||||||
class LoQDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQDialog(QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void mousePressEvent(QMouseEvent *event);
|
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event);
|
|
||||||
virtual void mouseReleaseEvent(QMouseEvent *event);
|
|
||||||
virtual void showEvent(QShowEvent *event);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool m_winMove=false;
|
|
||||||
QPoint m_winOrgPoint;
|
|
||||||
QPoint m_winWorldPoint;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQDIALOG_H
|
|
|
@ -1,24 +0,0 @@
|
||||||
#include "loqgraphicsvideoitem.h"
|
|
||||||
#include "loappconfig.h"
|
|
||||||
|
|
||||||
LoQGraphicsVideoItem::LoQGraphicsVideoItem(QGraphicsItem *parent) :
|
|
||||||
QGraphicsVideoItem(parent),
|
|
||||||
m_painterCompositionMode(QPainter::CompositionMode_SourceOver)
|
|
||||||
{
|
|
||||||
QString glVendor = LoAppConfig::getInstance()->OpenGLVendor();
|
|
||||||
if(glVendor.contains("NVIDIA Corporation")) { // QPainter::RasterOp_SourceAndNotDestination
|
|
||||||
m_painterCompositionMode = QPainter::RasterOp_SourceAndNotDestination;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQGraphicsVideoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
|
||||||
{
|
|
||||||
if(m_painterCompositionMode != QPainter::CompositionMode_SourceOver) {
|
|
||||||
painter->save();
|
|
||||||
painter->setCompositionMode(static_cast<QPainter::CompositionMode>(m_painterCompositionMode));
|
|
||||||
QGraphicsVideoItem::paint(painter, option, widget);
|
|
||||||
painter->restore();
|
|
||||||
} else {
|
|
||||||
QGraphicsVideoItem::paint(painter, option, widget);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
#ifndef LOQGRAPHICSVIDEOITEM_H
|
|
||||||
#define LOQGRAPHICSVIDEOITEM_H
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QGraphicsVideoItem>
|
|
||||||
|
|
||||||
class LoQGraphicsVideoItem : public QGraphicsVideoItem
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQGraphicsVideoItem(QGraphicsItem *parent = nullptr);
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_painterCompositionMode;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQGRAPHICSVIDEOITEM_H
|
|
|
@ -1,38 +0,0 @@
|
||||||
#include "loqgraphicsview.h"
|
|
||||||
|
|
||||||
LoQGraphicsview::LoQGraphicsview()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void LoQGraphicsview::paintEvent(QPaintEvent * event)
|
|
||||||
{
|
|
||||||
QGraphicsView::paintEvent(event);
|
|
||||||
QPainter painter(this);
|
|
||||||
QPen CitiePen=QPen(QColor::fromRgb(255, 0, 0),2,Qt::SolidLine);
|
|
||||||
painter.setPen(CitiePen);
|
|
||||||
painter.drawLine(QPointF(0,0),QPointF(400,400));
|
|
||||||
if(true)
|
|
||||||
{
|
|
||||||
switch (0) {
|
|
||||||
case 0:
|
|
||||||
painter.setPen(CitiePen);
|
|
||||||
painter.drawLine(QPointF(0,0),QPointF(400,400));
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
painter.setPen(CitiePen);
|
|
||||||
painter.drawLine(QPointF(rect().topLeft()),QPointF(rect().topRight()));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
painter.setPen(CitiePen);
|
|
||||||
painter.drawLine(QPointF(rect().topRight()),QPointF(rect().bottomRight()));
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
painter.setPen(CitiePen);
|
|
||||||
painter.drawLine(QPointF(rect().bottomLeft()),QPointF(rect().bottomRight()));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef LOQGRAPHICSVIEW_H
|
|
||||||
#define LOQGRAPHICSVIEW_H
|
|
||||||
|
|
||||||
#include <QGraphicsView>
|
|
||||||
class LoQGraphicsview : public QGraphicsView
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LoQGraphicsview();
|
|
||||||
virtual void paintEvent(QPaintEvent * event) ;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQGRAPHICSVIEW_H
|
|
|
@ -1,37 +0,0 @@
|
||||||
#include "loqheaderviewcheckbox.h"
|
|
||||||
|
|
||||||
LoQHeaderViewCheckBox::LoQHeaderViewCheckBox(Qt::Orientation orientation, QWidget *parent, const QString &id) : QHeaderView(orientation, parent)
|
|
||||||
{
|
|
||||||
qDebug() <<"LoQHeaderViewCheckBox -s";
|
|
||||||
m_checkBox = new QCheckBox(this);
|
|
||||||
m_checkBox->setProperty("ssType", "header");
|
|
||||||
m_checkBox->setProperty("ssName", "selectAll");
|
|
||||||
m_checkBox->setProperty("ssId" , id);
|
|
||||||
m_checkBox->setChecked(false);
|
|
||||||
connect(m_checkBox, SIGNAL(toggled(bool)), this, SIGNAL(sigCheckAll(bool)));
|
|
||||||
qDebug() <<"LoQHeaderViewCheckBox -o";
|
|
||||||
}
|
|
||||||
void LoQHeaderViewCheckBox::HideHeaderCheckBox(bool b)
|
|
||||||
{
|
|
||||||
qDebug() <<"HideHeaderCheckBox -s";
|
|
||||||
if(b)
|
|
||||||
m_checkBox->hide();
|
|
||||||
else {
|
|
||||||
m_checkBox->show();
|
|
||||||
}
|
|
||||||
qDebug() <<"HideHeaderCheckBox -o";
|
|
||||||
}
|
|
||||||
void LoQHeaderViewCheckBox::paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const
|
|
||||||
{
|
|
||||||
QHeaderView::paintSection(painter, rect, logicalIndex);
|
|
||||||
if (logicalIndex == 0) {
|
|
||||||
m_checkBox->setGeometry(rect);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQHeaderViewCheckBox::onAllChecked(bool f)
|
|
||||||
{
|
|
||||||
m_checkBox->blockSignals(true);
|
|
||||||
m_checkBox->setChecked(f);
|
|
||||||
m_checkBox->blockSignals(false);
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
#ifndef LOQHEADERVIEWCHECKBOX_H
|
|
||||||
#define LOQHEADERVIEWCHECKBOX_H
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QHeaderView>
|
|
||||||
#include <QCheckBox>
|
|
||||||
|
|
||||||
class LoQHeaderViewCheckBox : public QHeaderView
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQHeaderViewCheckBox(Qt::Orientation orientation, QWidget *parent = nullptr, const QString &id = "none");
|
|
||||||
void HideHeaderCheckBox(bool b);
|
|
||||||
protected:
|
|
||||||
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void sigCheckAll(bool);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void onAllChecked(bool f);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QCheckBox *m_checkBox;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQHEADERVIEWCHECKBOX_H
|
|
|
@ -1,11 +0,0 @@
|
||||||
#include "loqlineedit.h"
|
|
||||||
|
|
||||||
LoQLineEdit::LoQLineEdit(QWidget *parent) : QLineEdit(parent)
|
|
||||||
{
|
|
||||||
connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(onTextChanged(const QString &)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQLineEdit::onTextChanged(const QString &text)
|
|
||||||
{
|
|
||||||
emit sigTextChanged(this, text);
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
#ifndef LOQLINEEDIT_H
|
|
||||||
#define LOQLINEEDIT_H
|
|
||||||
|
|
||||||
#include <QLineEdit>
|
|
||||||
|
|
||||||
class LoQLineEdit : public QLineEdit
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQLineEdit(QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void sigTextChanged(LoQLineEdit *obj, const QString &text);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void onTextChanged(const QString &text);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQLINEEDIT_H
|
|
|
@ -1,14 +0,0 @@
|
||||||
#ifndef LOQMACRO_H
|
|
||||||
#define LOQMACRO_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
#define LoQ_PROPERTY(type, name) \
|
|
||||||
public slots: type get##name() const { return m_##name; } \
|
|
||||||
public slots: void set##name(const type &a) { m_##name = a; } \
|
|
||||||
signals: void name##Changed(const type &); \
|
|
||||||
private: \
|
|
||||||
Q_PROPERTY(type name MEMBER m_##name READ get##name WRITE set##name NOTIFY name##Changed) \
|
|
||||||
type m_##name;
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif // LOQMACRO_H
|
|
|
@ -1,172 +0,0 @@
|
||||||
#include "loqmainwindow.h"
|
|
||||||
#include "QtMath"
|
|
||||||
LoQMainWindow::LoQMainWindow(QWidget *parent) :
|
|
||||||
QMainWindow(parent),
|
|
||||||
m_winMove(false)
|
|
||||||
{
|
|
||||||
setAttribute(Qt::WA_TranslucentBackground,true);
|
|
||||||
setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
|
||||||
setMouseTracking(true);
|
|
||||||
|
|
||||||
// ui->centralWidget->setMouseTracking(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQMainWindow::mousePressEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
if (event->button() == Qt::LeftButton) {
|
|
||||||
QRect gRect = this->geometry();
|
|
||||||
gRect.setWidth(gRect.width() - 10);
|
|
||||||
gRect.setHeight(gRect.height() - 10);
|
|
||||||
gRect.setX(gRect.x() + 5);
|
|
||||||
gRect.setY(gRect.y() + 5);
|
|
||||||
QPoint pointXiangDui = event->pos();
|
|
||||||
if((pointXiangDui.y()<100&&pointXiangDui.x()>5)&&(pointXiangDui.y()<100&&pointXiangDui.x()<gRect.width()-5))
|
|
||||||
{
|
|
||||||
if(gRect.contains(event->globalPos())) {
|
|
||||||
m_winMove = true;
|
|
||||||
m_winOrgPoint = event->globalPos();
|
|
||||||
m_winWorldPoint = this->frameGeometry().topLeft();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Resize the window
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_winMove = false;
|
|
||||||
m_iCalCursorPos = CalCursorPos(event->pos(),CalCursorCol(event->pos()));
|
|
||||||
if (event->button() == Qt::LeftButton /*&& Qt::WindowMaximized != windowState()*/)
|
|
||||||
{
|
|
||||||
if(m_iCalCursorPos != CENTER)
|
|
||||||
{
|
|
||||||
m_bLeftPress = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_rtPreGeometry = geometry();
|
|
||||||
m_ptViewMousePos = event->globalPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQMainWindow::mouseMoveEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
if(m_winMove) {
|
|
||||||
if (event->buttons() & Qt::LeftButton) {
|
|
||||||
QPoint relativePos = event->globalPos() - m_winOrgPoint;
|
|
||||||
this->move(m_winWorldPoint + relativePos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//窗体不是最大的话就改变鼠标的形状
|
|
||||||
if(Qt::WindowMaximized != windowState())
|
|
||||||
{
|
|
||||||
setCursorShape(CalCursorPos(event->pos(),CalCursorCol(event->pos())));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//获取当前的点,这个点是全局的
|
|
||||||
QPoint ptCurrentPos = QCursor::pos();
|
|
||||||
//计算出移动的位置,当前点 - 鼠标左键按下的点
|
|
||||||
QPoint ptMoveSize = ptCurrentPos - m_ptViewMousePos;
|
|
||||||
QRect rtTempGeometry = m_rtPreGeometry;
|
|
||||||
if(m_bLeftPress)
|
|
||||||
{
|
|
||||||
switch(m_iCalCursorPos)
|
|
||||||
{
|
|
||||||
case TOPLEFT:
|
|
||||||
rtTempGeometry.setTopLeft(m_rtPreGeometry.topLeft()+ptMoveSize);
|
|
||||||
break;
|
|
||||||
case TOP:
|
|
||||||
rtTempGeometry.setTop(m_rtPreGeometry.top()+ptMoveSize.y());
|
|
||||||
break;
|
|
||||||
case TOPRIGHT:
|
|
||||||
rtTempGeometry.setTopRight(m_rtPreGeometry.topRight()+ptMoveSize);
|
|
||||||
break;
|
|
||||||
case LEFT:
|
|
||||||
rtTempGeometry.setLeft(m_rtPreGeometry.left()+ptMoveSize.x());
|
|
||||||
break;
|
|
||||||
case RIGHT:
|
|
||||||
rtTempGeometry.setRight(m_rtPreGeometry.right()+ptMoveSize.x());
|
|
||||||
break;
|
|
||||||
case BUTTOMLEFT:
|
|
||||||
rtTempGeometry.setBottomLeft(m_rtPreGeometry.bottomLeft()+ptMoveSize);
|
|
||||||
break;
|
|
||||||
case BUTTOM:
|
|
||||||
rtTempGeometry.setBottom(m_rtPreGeometry.bottom()+ptMoveSize.y());
|
|
||||||
break;
|
|
||||||
case BUTTOMRIGHT:
|
|
||||||
rtTempGeometry.setBottomRight(m_rtPreGeometry.bottomRight()+ptMoveSize);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//移动窗体,如果比最小窗体大,就移动
|
|
||||||
if(rtTempGeometry.width() >= 200 && rtTempGeometry.height() >= 300)
|
|
||||||
setGeometry(rtTempGeometry);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQMainWindow::mouseReleaseEvent(QMouseEvent *event)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (event->button() == Qt::LeftButton) {
|
|
||||||
|
|
||||||
m_winMove = false;
|
|
||||||
}
|
|
||||||
m_bLeftPress = false;
|
|
||||||
setCursor(Qt::ArrowCursor);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQMainWindow::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QStyleOption opt;
|
|
||||||
opt.init(this);
|
|
||||||
QPainter p(this);
|
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LoQMainWindow::CalCursorCol(QPoint pt)
|
|
||||||
{
|
|
||||||
return (pt.x() < FRAMESHAPE ? 1 : ((pt.x() > this->width() - FRAMESHAPE) ? 3 : 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
int LoQMainWindow::CalCursorPos(QPoint pt, int colPos)
|
|
||||||
{
|
|
||||||
return ((pt.y() < FRAMESHAPE ? 10 : ((pt.y() > this->height() - FRAMESHAPE) ? 30 : 20)) + colPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQMainWindow::setCursorShape(int CalPos)
|
|
||||||
{
|
|
||||||
Qt::CursorShape cursor;
|
|
||||||
switch(CalPos)
|
|
||||||
{
|
|
||||||
case TOPLEFT:
|
|
||||||
case BUTTOMRIGHT:
|
|
||||||
cursor = Qt::SizeFDiagCursor;
|
|
||||||
break;
|
|
||||||
case TOPRIGHT:
|
|
||||||
case BUTTOMLEFT:
|
|
||||||
cursor = Qt::SizeBDiagCursor;
|
|
||||||
break;
|
|
||||||
case TOP:
|
|
||||||
case BUTTOM:
|
|
||||||
cursor = Qt::SizeVerCursor;
|
|
||||||
break;
|
|
||||||
case LEFT:
|
|
||||||
case RIGHT:
|
|
||||||
cursor = Qt::SizeHorCursor;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cursor = Qt::ArrowCursor;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
setCursor(cursor);
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
#ifndef LOQMAINWINDOW_H
|
|
||||||
#define LOQMAINWINDOW_H
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QStyleOption>
|
|
||||||
|
|
||||||
class LoQMainWindow : public QMainWindow
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQMainWindow(QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void mousePressEvent(QMouseEvent *event);
|
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event);
|
|
||||||
virtual void mouseReleaseEvent(QMouseEvent *event);
|
|
||||||
virtual void paintEvent(QPaintEvent *);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_winMove=false;
|
|
||||||
QPoint m_winOrgPoint;
|
|
||||||
QPoint m_winWorldPoint;
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
|
||||||
TOPLEFT = 11,
|
|
||||||
TOP = 12,
|
|
||||||
TOPRIGHT = 13,
|
|
||||||
LEFT = 21,
|
|
||||||
CENTER = 22,
|
|
||||||
RIGHT = 23,
|
|
||||||
BUTTOMLEFT = 31,
|
|
||||||
BUTTOM = 32,
|
|
||||||
BUTTOMRIGHT = 33
|
|
||||||
};
|
|
||||||
|
|
||||||
#define FRAMESHAPE 10
|
|
||||||
|
|
||||||
int CalCursorCol(QPoint pt); //计算鼠标X的位置
|
|
||||||
int CalCursorPos(QPoint pt, int colPos); //计算鼠标的位置
|
|
||||||
void setCursorShape(int CalPos); //设置鼠标对应位置的形状
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_iCalCursorPos;
|
|
||||||
bool m_bLeftPress;
|
|
||||||
QRect m_rtPreGeometry;
|
|
||||||
QPoint m_ptViewMousePos;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQMAINWINDOW_H
|
|
|
@ -1,27 +0,0 @@
|
||||||
#include "loqpushbutton.h"
|
|
||||||
|
|
||||||
LoQPushButton::LoQPushButton(QWidget *parent) :
|
|
||||||
QPushButton(parent),
|
|
||||||
m_customData(nullptr)
|
|
||||||
{
|
|
||||||
connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
LoQPushButton::LoQPushButton(const QString &text, QWidget *parent) :
|
|
||||||
QPushButton(text, parent),
|
|
||||||
m_customData(nullptr)
|
|
||||||
{
|
|
||||||
connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
LoQPushButton::LoQPushButton(const QIcon& icon, const QString &text, QWidget *parent) :
|
|
||||||
QPushButton(icon, text, parent),
|
|
||||||
m_customData(nullptr)
|
|
||||||
{
|
|
||||||
connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQPushButton::onClicked(bool f)
|
|
||||||
{
|
|
||||||
emit sigClicked(this, f);
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
#ifndef LOQPUSHBUTTON_H
|
|
||||||
#define LOQPUSHBUTTON_H
|
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
class LoQPushButton : public QPushButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQPushButton(QWidget *parent = nullptr);
|
|
||||||
explicit LoQPushButton(const QString &text, QWidget *parent = nullptr);
|
|
||||||
LoQPushButton(const QIcon& icon, const QString &text, QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
public:
|
|
||||||
void setCustomData(void *data) { m_customData = data; }
|
|
||||||
void* customData() { return m_customData; }
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void sigClicked(LoQPushButton* obj, bool f);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void onClicked(bool f);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void *m_customData;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQPUSHBUTTON_H
|
|
|
@ -1,80 +0,0 @@
|
||||||
#include "loqtitlebar.h"
|
|
||||||
#include "QDebug"
|
|
||||||
LoQTitleBar::LoQTitleBar(QWidget *parent) : QWidget(parent)
|
|
||||||
{
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
|
|
||||||
bn_Minimize = new QPushButton(this);
|
|
||||||
bn_Maximize = new QPushButton(this);
|
|
||||||
bn_Close = new QPushButton(this);
|
|
||||||
|
|
||||||
bn_Minimize->setObjectName("bnMinimize");
|
|
||||||
bn_Maximize->setObjectName("bnMaximize");
|
|
||||||
bn_Close->setObjectName("bnClose");
|
|
||||||
|
|
||||||
bn_Minimize->setToolTip(tr("Minimize"));
|
|
||||||
bn_Maximize->setToolTip(tr("Maximize"));
|
|
||||||
bn_Close->setToolTip(tr("Close"));
|
|
||||||
|
|
||||||
connect(bn_Minimize, SIGNAL(clicked(bool)), window(), SLOT(showMinimized()));
|
|
||||||
connect(bn_Maximize, SIGNAL(clicked(bool)), this, SLOT(onBnMaximizeClicked()));
|
|
||||||
connect(bn_Close, SIGNAL(clicked(bool)), window(), SLOT(close()));
|
|
||||||
}
|
|
||||||
void LoQTitleBar::hideMixmumButton()
|
|
||||||
{
|
|
||||||
bn_Minimize->hide();
|
|
||||||
|
|
||||||
}
|
|
||||||
void LoQTitleBar::refreshLable()
|
|
||||||
{
|
|
||||||
bn_Minimize->setToolTip(tr("Minimize"));
|
|
||||||
bn_Maximize->setToolTip(tr("Maximize"));
|
|
||||||
bn_Close->setToolTip(tr("Close"));
|
|
||||||
|
|
||||||
}
|
|
||||||
bool LoQTitleBar::eventFilter(QObject *obj, QEvent *event)
|
|
||||||
{
|
|
||||||
switch (event->type()) {
|
|
||||||
case QEvent::WindowStateChange:
|
|
||||||
case QEvent::Resize:
|
|
||||||
updateMaximize();
|
|
||||||
return true;
|
|
||||||
// case QEvent::MouseButtonPress: {
|
|
||||||
// QMouseEvent *e = static_cast<QMouseEvent*>(event);
|
|
||||||
// if(this->geometry().contains(e->pos())){
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
return QWidget::eventFilter(obj, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQTitleBar::updateMaximize()
|
|
||||||
{
|
|
||||||
QWidget *pWindow = window();
|
|
||||||
if (pWindow->isTopLevel()) {
|
|
||||||
bool bMaximize = pWindow->isMaximized();
|
|
||||||
if (bMaximize) {
|
|
||||||
bn_Maximize->setToolTip(tr("Restore"));
|
|
||||||
} else {
|
|
||||||
bn_Maximize->setToolTip(tr("Maximize"));
|
|
||||||
}
|
|
||||||
bn_Maximize->setStyle(QApplication::style());
|
|
||||||
}
|
|
||||||
bn_Minimize->setToolTip(tr("Minimize"));
|
|
||||||
bn_Close->setToolTip(tr("Close"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQTitleBar::onBnMaximizeClicked()
|
|
||||||
{
|
|
||||||
QWidget *pWindow = window();
|
|
||||||
if(pWindow->isMaximized()) {
|
|
||||||
pWindow->showNormal();
|
|
||||||
qDebug()<<"showNormal";
|
|
||||||
} else {
|
|
||||||
pWindow->showMaximized();
|
|
||||||
qDebug()<<"showMaximized";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,119 +0,0 @@
|
||||||
#include "loqtreewidget.h"
|
|
||||||
|
|
||||||
LoQTreeWidget::LoQTreeWidget(QWidget *parent) :
|
|
||||||
QTreeWidget(parent),
|
|
||||||
m_checkState(CheckNone)
|
|
||||||
{
|
|
||||||
qDebug() <<"LoQTreeWidget::LoQTreeWidget -s";
|
|
||||||
m_header = new LoQHeaderViewCheckBox(Qt::Horizontal, this);
|
|
||||||
setHeader(m_header);
|
|
||||||
setProperty("ssType", "topList");
|
|
||||||
connect(m_header, SIGNAL(sigCheckAll(bool)), this, SLOT(onCheckAll(bool)));
|
|
||||||
connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onItemClicked(QTreeWidgetItem*,int)));
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
|
||||||
qDebug() <<"LoQTreeWidget::LoQTreeWidget -o";
|
|
||||||
|
|
||||||
}
|
|
||||||
void LoQTreeWidget::HideHeaderCheckBox(bool b)
|
|
||||||
{
|
|
||||||
qDebug() <<"HideHeaderCheckBox -s";
|
|
||||||
m_header->HideHeaderCheckBox(b);
|
|
||||||
qDebug() <<"HideHeaderCheckBox -o";
|
|
||||||
}
|
|
||||||
void LoQTreeWidget::adjustCheckState()
|
|
||||||
{
|
|
||||||
qDebug() <<"adjustCheckState -s";
|
|
||||||
bool isAllChecked = true;
|
|
||||||
int cnt = topLevelItemCount();
|
|
||||||
if(cnt == 0) {
|
|
||||||
isAllChecked = false;
|
|
||||||
m_checkState = CheckNone;
|
|
||||||
} else {
|
|
||||||
int k = 0;
|
|
||||||
for(int i=0; i<cnt; i++) {
|
|
||||||
if(!this->isRowHidden(i,indexFromItem(topLevelItem(i)->parent())))
|
|
||||||
{
|
|
||||||
if(topLevelItem(i)->checkState(0) == Qt::Unchecked) {
|
|
||||||
isAllChecked = false;
|
|
||||||
} else {
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(k > 1) {
|
|
||||||
m_checkState = CheckMulti;
|
|
||||||
} else if(k > 0) {
|
|
||||||
m_checkState = CheckOne;
|
|
||||||
} else {
|
|
||||||
m_checkState = CheckNone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_header->onAllChecked(isAllChecked);
|
|
||||||
sigCheckStateChanged(m_checkState);
|
|
||||||
qDebug() <<"adjustCheckState -o";
|
|
||||||
}
|
|
||||||
|
|
||||||
QTreeWidgetItem* LoQTreeWidget::itemChecked()
|
|
||||||
{
|
|
||||||
qDebug() <<"itemChecked -s";
|
|
||||||
QTreeWidgetItem *res = nullptr;
|
|
||||||
int cnt = topLevelItemCount();
|
|
||||||
for(int i=0; i<cnt; i++) {
|
|
||||||
QTreeWidgetItem *item = topLevelItem(i);
|
|
||||||
if(Qt::Checked == item->checkState(0)) {
|
|
||||||
res = item;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qDebug() <<"itemChecked -o";
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQTreeWidget::onCheckAll(bool checked)
|
|
||||||
{
|
|
||||||
qDebug() <<"onCheckAll -s";
|
|
||||||
int cnt = topLevelItemCount();
|
|
||||||
for(int i=0; i<cnt; i++) {
|
|
||||||
if(checked)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(this->isRowHidden(i,indexFromItem(topLevelItem(i)->parent())))
|
|
||||||
{
|
|
||||||
topLevelItem(i)->setCheckState(0, Qt::Unchecked);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
topLevelItem(i)->setCheckState(0, Qt::Checked);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
topLevelItem(i)->setCheckState(0, Qt::Unchecked);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// topLevelItem(i)->setCheckState(0, checked ? Qt::Checked : Qt::Unchecked);
|
|
||||||
adjustCheckState();
|
|
||||||
qDebug() <<"onCheckAll -o";
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoQTreeWidget::onItemClicked(QTreeWidgetItem *item, int column)
|
|
||||||
{
|
|
||||||
qDebug() <<"onItemClicked -s";
|
|
||||||
if(column > 0) {
|
|
||||||
item->setCheckState(0, item->checkState(0) == Qt::Unchecked ? Qt::Checked : Qt::Unchecked);
|
|
||||||
}
|
|
||||||
adjustCheckState();
|
|
||||||
qDebug() <<"onItemClicked -o";
|
|
||||||
}
|
|
||||||
QModelIndex LoQTreeWidget::indexFromItem(QTreeWidgetItem *item, int column) const
|
|
||||||
{
|
|
||||||
qDebug() <<"onItemClicked -s";
|
|
||||||
return QTreeWidget::indexFromItem(item, column);
|
|
||||||
qDebug() <<"onItemClicked -o";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
#include "loqvideosurface.h"
|
|
||||||
|
|
||||||
LoQVideoSurface::LoQVideoSurface(QObject *parent) :
|
|
||||||
QAbstractVideoSurface(parent)
|
|
||||||
{}
|
|
||||||
|
|
||||||
QList<QVideoFrame::PixelFormat> LoQVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(handleType);
|
|
||||||
QList<QVideoFrame::PixelFormat> listPixelFormats;
|
|
||||||
listPixelFormats << QVideoFrame::Format_ARGB32
|
|
||||||
<< QVideoFrame::Format_ARGB32_Premultiplied
|
|
||||||
<< QVideoFrame::Format_RGB32
|
|
||||||
<< QVideoFrame::Format_RGB24
|
|
||||||
<< QVideoFrame::Format_RGB565
|
|
||||||
<< QVideoFrame::Format_RGB555
|
|
||||||
<< QVideoFrame::Format_ARGB8565_Premultiplied
|
|
||||||
<< QVideoFrame::Format_BGRA32
|
|
||||||
<< QVideoFrame::Format_BGRA32_Premultiplied
|
|
||||||
<< QVideoFrame::Format_BGR32
|
|
||||||
<< QVideoFrame::Format_BGR24
|
|
||||||
<< QVideoFrame::Format_BGR565
|
|
||||||
<< QVideoFrame::Format_BGR555
|
|
||||||
<< QVideoFrame::Format_BGRA5658_Premultiplied
|
|
||||||
<< QVideoFrame::Format_AYUV444
|
|
||||||
<< QVideoFrame::Format_AYUV444_Premultiplied
|
|
||||||
<< QVideoFrame::Format_YUV444
|
|
||||||
<< QVideoFrame::Format_YUV420P
|
|
||||||
<< QVideoFrame::Format_YV12
|
|
||||||
<< QVideoFrame::Format_UYVY
|
|
||||||
<< QVideoFrame::Format_YUYV
|
|
||||||
<< QVideoFrame::Format_NV12
|
|
||||||
<< QVideoFrame::Format_NV21
|
|
||||||
<< QVideoFrame::Format_IMC1
|
|
||||||
<< QVideoFrame::Format_IMC2
|
|
||||||
<< QVideoFrame::Format_IMC3
|
|
||||||
<< QVideoFrame::Format_IMC4
|
|
||||||
<< QVideoFrame::Format_Y8
|
|
||||||
<< QVideoFrame::Format_Y16
|
|
||||||
<< QVideoFrame::Format_Jpeg
|
|
||||||
<< QVideoFrame::Format_CameraRaw
|
|
||||||
<< QVideoFrame::Format_AdobeDng;
|
|
||||||
// Return the formats you will support
|
|
||||||
return listPixelFormats;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoQVideoSurface::present(const QVideoFrame &frame)
|
|
||||||
{
|
|
||||||
// Handle the frame and do your processing
|
|
||||||
if (frame.isValid())
|
|
||||||
{
|
|
||||||
QVideoFrame cloneFrame(frame);
|
|
||||||
emit frameAvailable(cloneFrame);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
#ifndef LOQVIDEOSURFACE_H
|
|
||||||
#define LOQVIDEOSURFACE_H
|
|
||||||
|
|
||||||
#include <QAbstractVideoSurface>
|
|
||||||
|
|
||||||
class LoQVideoSurface : public QAbstractVideoSurface
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQVideoSurface(QObject *parent = nullptr);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual QList<QVideoFrame::PixelFormat>supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const override;
|
|
||||||
virtual bool present(const QVideoFrame &frame) override;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void frameAvailable(QVideoFrame &frame);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQVIDEOSURFACE_H
|
|
|
@ -1,56 +0,0 @@
|
||||||
#include "loqwindowtitlebar.h"
|
|
||||||
|
|
||||||
LoQWindowTitleBar::LoQWindowTitleBar(QWidget *parent) :
|
|
||||||
LoQTitleBar(parent)
|
|
||||||
{
|
|
||||||
QHBoxLayout *pLayout = new QHBoxLayout(this);
|
|
||||||
pLayout->addStretch();
|
|
||||||
pLayout->addWidget(bn_Minimize);
|
|
||||||
pLayout->addWidget(bn_Maximize);
|
|
||||||
pLayout->addWidget(bn_Close);
|
|
||||||
pLayout->setContentsMargins(3, 3, 3, 0);
|
|
||||||
setLayout(pLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoQWindowTitleBar::LoQWindowTitleBar(const QString &text, QWidget *parent) :
|
|
||||||
LoQTitleBar(parent)
|
|
||||||
{
|
|
||||||
m_wText = new QLabel(text, this);
|
|
||||||
m_wText->adjustSize();
|
|
||||||
|
|
||||||
QHBoxLayout *pLayout = new QHBoxLayout(this);
|
|
||||||
pLayout->addStretch();
|
|
||||||
pLayout->addWidget(m_wText);
|
|
||||||
pLayout->addStretch();
|
|
||||||
pLayout->addWidget(bn_Minimize);
|
|
||||||
pLayout->addWidget(bn_Maximize);
|
|
||||||
pLayout->addWidget(bn_Close);
|
|
||||||
pLayout->setContentsMargins(3, 3, 3, 0);
|
|
||||||
setLayout(pLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoQWindowTitleBar::LoQWindowTitleBar(const QPixmap &icon, const QString &text, QWidget *parent) :
|
|
||||||
LoQTitleBar(parent)
|
|
||||||
{
|
|
||||||
m_wIcon = new QLabel(this);
|
|
||||||
m_wIcon->setPixmap(icon);
|
|
||||||
m_wIcon->adjustSize();
|
|
||||||
|
|
||||||
m_wText = new QLabel(text, this);
|
|
||||||
m_wText->adjustSize();
|
|
||||||
|
|
||||||
QHBoxLayout *pLayout = new QHBoxLayout(this);
|
|
||||||
pLayout->addWidget(m_wIcon);
|
|
||||||
pLayout->addStretch();
|
|
||||||
pLayout->addWidget(m_wText);
|
|
||||||
pLayout->addStretch();
|
|
||||||
pLayout->addWidget(bn_Minimize);
|
|
||||||
pLayout->addWidget(bn_Maximize);
|
|
||||||
pLayout->addWidget(bn_Close);
|
|
||||||
pLayout->setContentsMargins(3, 3, 3, 0);
|
|
||||||
setLayout(pLayout);
|
|
||||||
}
|
|
||||||
void LoQWindowTitleBar::RenameTitle(QString strName)
|
|
||||||
{
|
|
||||||
m_wText->setText(strName);
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
#ifndef LOQWINDOWTITLEBAR_H
|
|
||||||
#define LOQWINDOWTITLEBAR_H
|
|
||||||
|
|
||||||
#include <LoQClass/loqtitlebar.h>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
|
|
||||||
class LoQWindowTitleBar : public LoQTitleBar
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit LoQWindowTitleBar(QWidget *parent = nullptr);
|
|
||||||
LoQWindowTitleBar(const QString &text, QWidget *parent = nullptr);
|
|
||||||
LoQWindowTitleBar(const QPixmap &icon, const QString &text, QWidget *parent = nullptr);
|
|
||||||
void RenameTitle(QString strName);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
|
||||||
QLabel *m_wIcon;
|
|
||||||
QLabel *m_wText;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOQWINDOWTITLEBAR_H
|
|
|
@ -1,18 +1,43 @@
|
||||||
#include "aboutdlg.h"
|
#include "aboutdlg.h"
|
||||||
#include "ui_aboutdlg.h"
|
|
||||||
#include "globaldefine.h"
|
#include "globaldefine.h"
|
||||||
AboutDlg::AboutDlg(QWidget *parent) :
|
#include <QVBoxLayout>
|
||||||
LoQDialog(parent),
|
#include <QLabel>
|
||||||
ui(new Ui::AboutDlg)
|
#include <QPushButton>
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->label_2->setText(APP_VERSION);
|
|
||||||
#ifdef MACRO_YUANHENG_VERSION
|
|
||||||
ui->label_3->setVisible(false);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
AboutDlg::~AboutDlg()
|
AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent) {
|
||||||
{
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
delete ui;
|
setWindowTitle(tr("About"));
|
||||||
|
|
||||||
|
auto hBox = new QHBoxLayout(this);
|
||||||
|
hBox->setContentsMargins(24,24,24,24);
|
||||||
|
hBox->setSpacing(24);
|
||||||
|
auto label_4 = new QLabel();
|
||||||
|
label_4->setPixmap(QPixmap(":/res/Logo.png"));
|
||||||
|
hBox->addWidget(label_4);
|
||||||
|
|
||||||
|
auto vBox = new QVBoxLayout();
|
||||||
|
auto label = new QLabel("LedOK Express");
|
||||||
|
QFont font;
|
||||||
|
font.setPointSize(24);
|
||||||
|
label->setFont(font);
|
||||||
|
label->setTextFormat(Qt::AutoText);
|
||||||
|
label->setAlignment(Qt::AlignCenter);
|
||||||
|
vBox->addWidget(label);
|
||||||
|
|
||||||
|
auto label_2 = new QLabel(APP_VERSION);
|
||||||
|
QFont font1;
|
||||||
|
font1.setPointSize(14);
|
||||||
|
label_2->setFont(font1);
|
||||||
|
label_2->setAlignment(Qt::AlignCenter);
|
||||||
|
vBox->addWidget(label_2);
|
||||||
|
|
||||||
|
auto label_3 = new QLabel("<a href=\"https://www.ledok.cn/\">www.ledok.cn");
|
||||||
|
QFont font2;
|
||||||
|
font2.setPointSize(15);
|
||||||
|
label_3->setFont(font2);
|
||||||
|
label_3->setAlignment(Qt::AlignCenter);
|
||||||
|
label_3->setOpenExternalLinks(true);
|
||||||
|
vBox->addWidget(label_3);
|
||||||
|
|
||||||
|
hBox->addLayout(vBox);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
#ifndef ABOUTDLG_H
|
#ifndef ABOUTDLG_H
|
||||||
#define ABOUTDLG_H
|
#define ABOUTDLG_H
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
#include <basedlg.h>
|
||||||
|
|
||||||
namespace Ui {
|
class AboutDlg : public QDialog {
|
||||||
class AboutDlg;
|
|
||||||
}
|
|
||||||
|
|
||||||
class AboutDlg : public LoQDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AboutDlg(QWidget *parent = nullptr);
|
explicit AboutDlg(QWidget *parent = nullptr);
|
||||||
~AboutDlg();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::AboutDlg *ui;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ABOUTDLG_H
|
#endif // ABOUTDLG_H
|
||||||
|
|
|
@ -1,202 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>AboutDlg</class>
|
|
||||||
<widget class="QDialog" name="AboutDlg">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>410</width>
|
|
||||||
<height>192</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="frame">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>About</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>X</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border-top: 2px solid gray; </string>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>64</width>
|
|
||||||
<height>64</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">image: url(:/res/Logo.png);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<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>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Arial</family>
|
|
||||||
<pointsize>24</pointsize>
|
|
||||||
<weight>50</weight>
|
|
||||||
<italic>false</italic>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font: 24pt "Arial";
|
|
||||||
color: rgb(255, 255, 255);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>LedOK Express</string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::AutoText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>14</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>V20200429</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>15</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string><a href="https://www.ledok.cn/">www.ledok.cn</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>pushButton</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>AboutDlg</receiver>
|
|
||||||
<slot>close()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>361</x>
|
|
||||||
<y>19</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>193</x>
|
|
||||||
<y>89</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
|
@ -1,143 +1,84 @@
|
||||||
#include "changepasswordform.h"
|
#include "changepasswordform.h"
|
||||||
#include "ui_changepasswordform.h"
|
#include <QVBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include "loappconfig.h"
|
#include "cfg.h"
|
||||||
#include "x_uimsgboxok.h"
|
|
||||||
#include "QTextCodec"
|
#include "QTextCodec"
|
||||||
ChangePasswordForm::ChangePasswordForm(QWidget *parent) :
|
ChangePasswordForm::ChangePasswordForm(QWidget *parent) : BaseDlg(parent) {
|
||||||
LoQDialog(parent),
|
resize(240, 160);
|
||||||
ui(new Ui::ChangePasswordForm)
|
auto vBox = new QVBoxLayout(this);
|
||||||
{
|
auto hBox = new QHBoxLayout();
|
||||||
ui->setupUi(this);
|
auto label = new QLabel(tr("Old password"));
|
||||||
ui->lineEdit->setEchoMode(QLineEdit::Password);
|
hBox->addWidget(label);
|
||||||
ui->lineEdit_2->setEchoMode(QLineEdit::Password);
|
|
||||||
ui->lineEdit_3->setEchoMode(QLineEdit::Password);
|
|
||||||
ui->pushButton_2->setProperty("ssType", "progManageTool");
|
|
||||||
ui->pushButton_2->setStyleSheet("QPushButton{background:rgba(28,154,210,1);}");
|
|
||||||
ui->pushButton->setProperty("ssType", "progManageTool");
|
|
||||||
ui->pushButton->setStyleSheet("QPushButton{background:rgba(28,154,210,1);}");
|
|
||||||
setStyleSheet("background-color: #D8D8D8;");
|
|
||||||
ui->lineEdit->setStyleSheet("background-color: #FFFFFF;");
|
|
||||||
ui->lineEdit_2->setStyleSheet("background-color: #FFFFFF;");
|
|
||||||
ui->lineEdit_3->setStyleSheet("background-color: #FFFFFF;");
|
|
||||||
connect(this, SIGNAL(accepted()), this, SLOT(onAccepted()));
|
|
||||||
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(onOkButton()));
|
|
||||||
}
|
|
||||||
|
|
||||||
ChangePasswordForm::~ChangePasswordForm()
|
fdOld = new QLineEdit();
|
||||||
{
|
fdOld->setEchoMode(QLineEdit::Password);
|
||||||
delete ui;
|
fdOld->setMaxLength(16);
|
||||||
}
|
hBox->addWidget(fdOld);
|
||||||
void ChangePasswordForm::onAccepted()
|
vBox->addLayout(hBox);
|
||||||
{
|
|
||||||
|
|
||||||
}
|
hBox = new QHBoxLayout();
|
||||||
void ChangePasswordForm::onOkButton()
|
auto label_2 = new QLabel(tr("New password"));
|
||||||
{
|
hBox->addWidget(label_2);
|
||||||
//如果旧密码错误
|
|
||||||
LoAppConfig *cfg = LoAppConfig::getInstance();
|
|
||||||
QSettings *settings = new QSettings(cfg->OrganizationName(), cfg->ApplicationName());
|
|
||||||
#ifndef MACRO_YUANHENG_VERSION
|
|
||||||
|
|
||||||
QString strMiWenPs=settings->value("advUiPs").toString();
|
fdNew = new QLineEdit();
|
||||||
#else
|
fdNew->setEchoMode(QLineEdit::Password);
|
||||||
QString strMiWenPs=settings->value("advUiPs_YuanHeng").toString();
|
fdNew->setMaxLength(8);
|
||||||
|
hBox->addWidget(fdNew);
|
||||||
|
vBox->addLayout(hBox);
|
||||||
|
|
||||||
#endif
|
hBox = new QHBoxLayout();
|
||||||
QString result = QTextCodec::codecForName("GBK")->toUnicode(QByteArray::fromBase64(strMiWenPs.toLocal8Bit()));
|
auto label_3 = new QLabel(tr("Repeat again"));
|
||||||
// QByteArray miwen = strMiWenPs.toLatin1();
|
hBox->addWidget(label_3);
|
||||||
// if(miwen.size()>=3)
|
|
||||||
// {
|
|
||||||
// miwen[0]=miwen[0]-'1';
|
|
||||||
// miwen[1]=miwen[1]-'7';
|
|
||||||
// miwen[2]=miwen[2]-'5';
|
|
||||||
// miwen[3]=miwen[3]-'8';
|
|
||||||
// miwen[4]=miwen[4]-'0';
|
|
||||||
// miwen[5]=miwen[5]-'1';
|
|
||||||
// }
|
|
||||||
QString strPs=result;
|
|
||||||
|
|
||||||
|
fdAgn = new QLineEdit();
|
||||||
|
fdAgn->setEchoMode(QLineEdit::Password);
|
||||||
|
fdAgn->setMaxLength(8);
|
||||||
|
hBox->addWidget(fdAgn);
|
||||||
|
vBox->addLayout(hBox);
|
||||||
|
|
||||||
if(strPs.isEmpty())
|
hBox = new QHBoxLayout();
|
||||||
{
|
auto pushButton_2 = new QPushButton(tr("OK"));
|
||||||
#ifndef MACRO_YUANHENG_VERSION
|
pushButton_2->setProperty("ssType", "progManageTool");
|
||||||
strPs = "888";
|
hBox->addWidget(pushButton_2);
|
||||||
#else
|
connect(pushButton_2, &QPushButton::clicked, this, [this]() {
|
||||||
strPs = "Cargo10065!@#";
|
QString pwdOld = fdOld->text();
|
||||||
|
if(pwdOld.isEmpty()) {
|
||||||
#endif
|
QMessageBox::warning(this, tr("Tip"), tr("Please input old password"));
|
||||||
}
|
fdOld->setFocus();
|
||||||
|
|
||||||
QString strOldPs=ui->lineEdit->text();
|
|
||||||
if(strOldPs.isEmpty())
|
|
||||||
{
|
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Please input old password"),this,1);
|
|
||||||
pDlg->exec();
|
|
||||||
ui->lineEdit->setFocus();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(ui->lineEdit->text()!=strPs)
|
QSettings settings;
|
||||||
{
|
QString pwdRaw = settings.value("advUiPs").toString();
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Old password is wrong"),this,1);
|
QString pwd = pwdRaw.isEmpty() ? "888" : QTextCodec::codecForName("GBK")->toUnicode(QByteArray::fromBase64(pwdRaw.toLocal8Bit()));
|
||||||
pDlg->exec();
|
if(pwd != pwdOld) {
|
||||||
ui->lineEdit->setFocus();
|
QMessageBox::critical(this, tr("Tip"), tr("Old password is wrong"));
|
||||||
|
fdOld->setFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(ui->lineEdit_2->text().length()<6)
|
QString pwdNew = fdNew->text();
|
||||||
{
|
if(pwdNew.length() < 6) {
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Please enter a password with more than 6 characters"),this,1);
|
QMessageBox::warning(this, tr("Tip"), tr("Please enter a password with more than 6 characters"));
|
||||||
pDlg->exec();
|
fdNew->setFocus();
|
||||||
ui->lineEdit_2->setFocus();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(ui->lineEdit_3->text().length()<6)
|
QString pwdAgn = fdAgn->text();
|
||||||
{
|
if(pwdAgn != pwdNew) {
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Please enter a password with more than 6 characters"),this,1);
|
QMessageBox::warning(this, tr("Tip"), tr("The new password is not consistent in two times"));
|
||||||
pDlg->exec();
|
fdAgn->setFocus();
|
||||||
ui->lineEdit_3->setFocus();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(ui->lineEdit_2->text()!=ui->lineEdit_3->text())//两次输入新密码不一致
|
settings.setValue("advUiPs", QString::fromLatin1(pwdNew.toLocal8Bit().toBase64()));
|
||||||
{
|
QMessageBox::information(this, tr("Tip"), tr("Password changed successfully"));
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("The new password is not consistent in two times"),this,1);
|
accept();
|
||||||
pDlg->exec();
|
});
|
||||||
ui->lineEdit_2->setFocus();
|
|
||||||
return;
|
auto pushButton = new QPushButton(tr("Cancel"));
|
||||||
}
|
pushButton->setProperty("ssType", "progManageTool");
|
||||||
QString strNewPs=ui->lineEdit_2->text();
|
hBox->addWidget(pushButton);
|
||||||
if(strNewPs.isEmpty())
|
connect(pushButton, &QPushButton::clicked, this, &ChangePasswordForm::reject);
|
||||||
{
|
vBox->addLayout(hBox);
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Please enter a new password"),this,1);
|
|
||||||
pDlg->exec();
|
|
||||||
ui->lineEdit_2->setFocus();
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
QString str=ui->lineEdit_2->text();
|
|
||||||
QByteArray a = str.toLocal8Bit().toBase64();
|
|
||||||
|
|
||||||
QString newStr(a);
|
|
||||||
// QByteArray New_mingwen = str.toLatin1();
|
|
||||||
// New_mingwen[0]=New_mingwen[0]+'1';
|
|
||||||
// New_mingwen[1]=New_mingwen[1]+'7';
|
|
||||||
// New_mingwen[2]=New_mingwen[2]+'5';
|
|
||||||
// New_mingwen[3]=New_mingwen[3]+'8';
|
|
||||||
// New_mingwen[4]=New_mingwen[4]+'0';
|
|
||||||
// New_mingwen[5]=New_mingwen[5]+'1';
|
|
||||||
// QString strtemp=New_mingwen;
|
|
||||||
#ifndef MACRO_YUANHENG_VERSION
|
|
||||||
|
|
||||||
settings->setValue("advUiPs",newStr);
|
|
||||||
#else
|
|
||||||
settings->setValue("advUiPs_YuanHeng",newStr);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Password changed successfully"),this,1);
|
|
||||||
pDlg->exec();
|
|
||||||
this->accept();
|
|
||||||
// emit sigAcceptData(ui->lineEdit_2->text());
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,16 @@
|
||||||
#ifndef CHANGEPASSWORDFORM_H
|
#ifndef CHANGEPASSWORDFORM_H
|
||||||
#define CHANGEPASSWORDFORM_H
|
#define CHANGEPASSWORDFORM_H
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
#include "basedlg.h"
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
namespace Ui {
|
class ChangePasswordForm : public BaseDlg {
|
||||||
class ChangePasswordForm;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ChangePasswordForm : public LoQDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ChangePasswordForm(QWidget *parent = nullptr);
|
explicit ChangePasswordForm(QWidget *parent = nullptr);
|
||||||
~ChangePasswordForm();
|
QLineEdit *fdOld, *fdNew, *fdAgn;
|
||||||
signals:
|
|
||||||
void sigAcceptData(QString strIP);
|
|
||||||
private:
|
|
||||||
Ui::ChangePasswordForm *ui;
|
|
||||||
protected slots:
|
|
||||||
void onAccepted();
|
|
||||||
void onOkButton();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHANGEPASSWORDFORM_H
|
#endif // CHANGEPASSWORDFORM_H
|
||||||
|
|
|
@ -1,135 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ChangePasswordForm</class>
|
|
||||||
<widget class="QWidget" name="ChangePasswordForm">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>236</width>
|
|
||||||
<height>159</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="frame">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Old password</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>16</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>New password</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit_2">
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Repeat again</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit_3">
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>OK</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>pushButton</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>ChangePasswordForm</receiver>
|
|
||||||
<slot>close()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>167</x>
|
|
||||||
<y>126</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>117</x>
|
|
||||||
<y>79</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
|
@ -78,26 +78,16 @@ QSize CustomProgressIndicator::sizeHint() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CustomProgressIndicator::timerEvent(QTimerEvent * /*event*/) {
|
void CustomProgressIndicator::timerEvent(QTimerEvent *) {
|
||||||
angle_ = (angle_+30)%360;
|
angle_ = (angle_+30)%360;
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomProgressIndicator::paintEvent(QPaintEvent * /*event*/) {
|
void CustomProgressIndicator::paintEvent(QPaintEvent *) {
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
|
|
||||||
// if(m_iFlagFinishedSuccess==1)
|
|
||||||
// {
|
|
||||||
// drawUnderCircle(&p);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
{
|
|
||||||
drawJuHua(&p);
|
drawJuHua(&p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
||||||
{
|
{
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
@ -112,7 +102,6 @@ void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
||||||
|
|
||||||
int width = qMin(this->width(), this->height());
|
int width = qMin(this->width(), this->height());
|
||||||
|
|
||||||
|
|
||||||
int outerRadius = (width-1) >> 1;
|
int outerRadius = (width-1) >> 1;
|
||||||
int innerRadius = int(((width-1) >> 1)*0.38);
|
int innerRadius = int(((width-1) >> 1)*0.38);
|
||||||
|
|
||||||
|
@ -123,7 +112,6 @@ void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
||||||
{
|
{
|
||||||
painter->setPen(color_);
|
painter->setPen(color_);
|
||||||
painter->drawText(rect(), Qt::AlignCenter, m_strTiping);
|
painter->drawText(rect(), Qt::AlignCenter, m_strTiping);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* 撰写进度 */
|
/* 撰写进度 */
|
||||||
|
@ -135,7 +123,6 @@ void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
||||||
stopAnimation();
|
stopAnimation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<12; ++i) {
|
for (int i=0; i<12; ++i) {
|
||||||
QColor color = color_;
|
QColor color = color_;
|
||||||
color.setAlphaF(1.0f - (i/12.0f));
|
color.setAlphaF(1.0f - (i/12.0f));
|
||||||
|
@ -147,40 +134,4 @@ void CustomProgressIndicator::drawJuHua(QPainter *painter)
|
||||||
painter->drawRoundedRect(((-capsuleWidth) >> 1), -(innerRadius+capsuleHeight), capsuleWidth, capsuleHeight, capsuleRadius, capsuleRadius);
|
painter->drawRoundedRect(((-capsuleWidth) >> 1), -(innerRadius+capsuleHeight), capsuleWidth, capsuleHeight, capsuleRadius, capsuleRadius);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
//没有使用的画圆环函数
|
|
||||||
void CustomProgressIndicator::drawUnderCircle(QPainter *painter)
|
|
||||||
{
|
|
||||||
int bigradius = 50;
|
|
||||||
painter->save();
|
|
||||||
painter->setPen(color_);
|
|
||||||
painter->setBrush(color_);
|
|
||||||
|
|
||||||
QPainterPath bigCircle;
|
|
||||||
bigCircle.addEllipse(-width()/2, -height()/2, bigradius*2, bigradius*2);
|
|
||||||
|
|
||||||
int smallradius = 40;
|
|
||||||
QPainterPath smallCircle;
|
|
||||||
smallCircle.addEllipse(-width()/2, -height()/2, smallradius*2, smallradius*2);
|
|
||||||
|
|
||||||
QPainterPath path = bigCircle - smallCircle;
|
|
||||||
painter->drawPath(path);
|
|
||||||
painter->setPen(color_);
|
|
||||||
painter->drawText(rect(), Qt::AlignCenter, m_strTip);
|
|
||||||
painter->restore();
|
|
||||||
|
|
||||||
/* painter->save();
|
|
||||||
painter->setPen(color_);
|
|
||||||
painter->setBrush(color_);
|
|
||||||
int m_outerRadius=width()>height()?(qreal)height()/2-4:(qreal)width()/2-4;//求最小的那个值。自己可以测试一下减4个像素与不减的区别
|
|
||||||
QPointF TopLeft(rect().center().x() - m_outerRadius,rect().center().y() - m_outerRadius);
|
|
||||||
QPointF BottomRight(rect().center().x() + m_outerRadius,rect().center().y() + m_outerRadius);
|
|
||||||
QRectF CircleRect(TopLeft,BottomRight);//大圆矩形
|
|
||||||
|
|
||||||
//painter->setPen(Qt::NoPen);//大家可以注释掉这行看一下,有什么差别?
|
|
||||||
painter->drawEllipse(CircleRect);//画椭圆,其实就是画圆。特殊椭圆而已
|
|
||||||
painter->setPen(Qt::white);
|
|
||||||
painter->drawText(rect(), Qt::AlignCenter, m_strTip);
|
|
||||||
painter->restore();*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,6 @@ protected:
|
||||||
/* 系统基类函数 */
|
/* 系统基类函数 */
|
||||||
virtual void timerEvent(QTimerEvent * event);
|
virtual void timerEvent(QTimerEvent * event);
|
||||||
virtual void paintEvent(QPaintEvent * event);
|
virtual void paintEvent(QPaintEvent * event);
|
||||||
|
|
||||||
void drawUnderCircle(QPainter *painter);
|
|
||||||
void drawJuHua(QPainter *painter);
|
void drawJuHua(QPainter *painter);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -1,97 +1,78 @@
|
||||||
#include "loemptydialog.h"
|
#include "loemptydialog.h"
|
||||||
#include "ui_loemptydialog.h"
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "QThread"
|
LoEmptyDialog::LoEmptyDialog(QWidget *parent) : BaseDlg(parent) {
|
||||||
LoEmptyDialog::LoEmptyDialog(QWidget *parent) :
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
LoQDialog(parent),
|
|
||||||
ui(new Ui::LoEmptyDialog)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
setStyleSheet("background-color: rgba(216,216,216,0.8);");
|
|
||||||
ui->label->setStyleSheet("font-size: 24px;font-weight: 650;color: rgba(0,147,221,1); background-color: transparent;");
|
|
||||||
m_pIndicator = new CustomProgressIndicator(this);
|
|
||||||
m_pIndicator->setDisplayStringInfo(tr(""),tr(""));
|
|
||||||
m_pIndicator->setDisplayModel(1);
|
|
||||||
ui->horizontalLayout_2->addWidget(m_pIndicator,Qt::AlignCenter);
|
|
||||||
m_pIndicator->show();
|
|
||||||
m_pIndicator->setColor(QColor(0,147,221));
|
|
||||||
m_pIndicator->setDisplayedWhenStopped(true);//动画停止后任就显示,直到关闭窗口
|
|
||||||
m_pIndicator->startAnimation();
|
|
||||||
|
|
||||||
|
auto pal = palette();
|
||||||
|
pal.setBrush(QPalette::Window, QColor(0xdd, 0xdd, 0xdd, 0xdd));
|
||||||
|
setPalette(pal);
|
||||||
|
|
||||||
|
auto vBox = new QVBoxLayout(this);
|
||||||
|
vBox->addStretch();
|
||||||
|
|
||||||
|
mIndicator = new CustomProgressIndicator(this);
|
||||||
|
mIndicator->setDisplayModel(1);
|
||||||
|
mIndicator->setColor(QColor(0x0088dd));
|
||||||
|
mIndicator->setDisplayedWhenStopped(true);//动画停止后任就显示,直到关闭窗口
|
||||||
|
mIndicator->startAnimation();
|
||||||
|
vBox->addWidget(mIndicator, 0, Qt::AlignCenter);
|
||||||
|
|
||||||
|
vBox->addStretch();
|
||||||
|
|
||||||
|
label = new QLabel();
|
||||||
|
label->setAlignment(Qt::AlignCenter);
|
||||||
|
label->setStyleSheet("font-size: 24px; font-weight: bold; color: #08d;");
|
||||||
|
vBox->addWidget(label);
|
||||||
|
|
||||||
|
vBox->addStretch();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoEmptyDialog::~LoEmptyDialog()
|
void LoEmptyDialog::SetTipTextContent(QString strTip) {
|
||||||
{
|
label->setText(strTip);
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
void LoEmptyDialog::SetTipTextContent(QString strTip)
|
void LoEmptyDialog::SetFailedTipString(QString strTip) {
|
||||||
{
|
mTimeroutTip = strTip;
|
||||||
ui->label->setText(strTip);
|
}
|
||||||
|
bool LoEmptyDialog::getLockStatus() {
|
||||||
|
return iLockFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoEmptyDialog::lock(QString strTip,QString strUnLockTip,QString strTimerOutUnLockTip)
|
void LoEmptyDialog::lock(QString strTip, QString finishTip, QString timeroutTip) {
|
||||||
{
|
|
||||||
iLockFlag = true;
|
iLockFlag = true;
|
||||||
ui->label->setText(strTip);
|
label->setText(strTip);
|
||||||
m_strUnLockTip=strUnLockTip;
|
mFinishTip = finishTip;
|
||||||
m_strTimerOutUnLockTip=strTimerOutUnLockTip;
|
mTimeroutTip = timeroutTip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoEmptyDialog::unlock()
|
void LoEmptyDialog::unlock() {
|
||||||
{
|
if(iClosedFlag==1) return;
|
||||||
if(iClosedFlag==1)
|
label->setText(mFinishTip);
|
||||||
return;
|
if(mIndicator != nullptr) {
|
||||||
ui->label->setText(m_strUnLockTip);
|
mIndicator->setBackground(":/res/success.png");
|
||||||
if(m_pIndicator != nullptr)
|
mIndicator->stopAnimation();
|
||||||
{
|
|
||||||
m_pIndicator->setBackground(":/res/success.png");
|
|
||||||
m_pIndicator->stopAnimation();
|
|
||||||
// QThread::sleep(1);
|
|
||||||
CloseWndByDelaySec(600);
|
CloseWndByDelaySec(600);
|
||||||
}
|
}
|
||||||
iClosedFlag=1;
|
iClosedFlag=1;
|
||||||
iLockFlag = false;
|
iLockFlag = false;
|
||||||
}
|
}
|
||||||
bool LoEmptyDialog::getLockStatus()
|
void LoEmptyDialog::TimerOutUnlock() {
|
||||||
{
|
if(iClosedFlag==1) return;
|
||||||
return iLockFlag;
|
label->setText(mTimeroutTip);
|
||||||
}
|
if(mIndicator != nullptr) {
|
||||||
void LoEmptyDialog::TimerOutUnlock()
|
mIndicator->setBackground(":/res/tip.png");
|
||||||
{
|
mIndicator->stopAnimation();
|
||||||
if(iClosedFlag==1)
|
|
||||||
return;
|
|
||||||
ui->label->setText(m_strTimerOutUnLockTip);
|
|
||||||
if(m_pIndicator != nullptr)
|
|
||||||
{
|
|
||||||
m_pIndicator->setBackground(":/res/tip.png");
|
|
||||||
m_pIndicator->stopAnimation();
|
|
||||||
// QThread::sleep(1);
|
|
||||||
CloseWndByDelaySec(600);
|
CloseWndByDelaySec(600);
|
||||||
|
|
||||||
}
|
}
|
||||||
iClosedFlag = 1;
|
iClosedFlag = 1;
|
||||||
}
|
}
|
||||||
void LoEmptyDialog::SetFailedTipString(QString strTip)
|
|
||||||
{
|
|
||||||
m_strTimerOutUnLockTip=strTip;
|
|
||||||
}
|
|
||||||
void LoEmptyDialog::CloseWndByDelaySec(int iCloseWndDelaySec) {
|
void LoEmptyDialog::CloseWndByDelaySec(int iCloseWndDelaySec) {
|
||||||
m_pTimer = new QTimer(this);
|
auto timer = new QTimer(this);
|
||||||
m_pTimer->setSingleShot(true);
|
timer->setSingleShot(true);
|
||||||
//connect(m_pTimer, &QTimer::timeout, this, [=](){this->close();});
|
connect(timer, &QTimer::timeout, this, [this, timer] {
|
||||||
//connect(m_pTimer, &QTimer::timeout, this, SLOT(CloseDlg()));
|
timer->stop();
|
||||||
connect(m_pTimer,SIGNAL(timeout()),this,SLOT(CloseDlg()));
|
close();
|
||||||
m_pTimer->start(iCloseWndDelaySec);
|
|
||||||
}
|
|
||||||
void LoEmptyDialog::CloseDlg()
|
|
||||||
{
|
|
||||||
m_pTimer->stop();
|
|
||||||
this->close();
|
|
||||||
emit sigClose();
|
emit sigClose();
|
||||||
}
|
});
|
||||||
void LoEmptyDialog::DeleteSelf(const LoEmptyDialog *p)
|
timer->start(iCloseWndDelaySec);
|
||||||
{
|
|
||||||
|
|
||||||
//m_pSelf=p;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,19 @@
|
||||||
#ifndef LOEMPTYDIALOG_H
|
#ifndef LOEMPTYDIALOG_H
|
||||||
#define LOEMPTYDIALOG_H
|
#define LOEMPTYDIALOG_H
|
||||||
|
|
||||||
|
#include <basedlg.h>
|
||||||
#include <LoUIClass/customprogressindicator.h>
|
#include <LoUIClass/customprogressindicator.h>
|
||||||
#include <LoQClass/loqdialog.h>
|
#include <QLabel>
|
||||||
#include <QTimer>
|
|
||||||
namespace Ui {
|
|
||||||
class LoEmptyDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
class LoEmptyDialog : public LoQDialog
|
class LoEmptyDialog : public BaseDlg {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LoEmptyDialog(QWidget *parent = nullptr);
|
explicit LoEmptyDialog(QWidget *parent = nullptr);
|
||||||
~LoEmptyDialog();
|
int exec() override {
|
||||||
CustomProgressIndicator *m_pIndicator = nullptr;
|
emit startUp();
|
||||||
virtual int exec() override { emit startUp(); return LoQDialog::exec(); }
|
return BaseDlg::exec();
|
||||||
void DeleteSelf(const LoEmptyDialog *p);
|
}
|
||||||
private:
|
CustomProgressIndicator *mIndicator{0};
|
||||||
Ui::LoEmptyDialog *ui;
|
|
||||||
int iClosedFlag=0;
|
|
||||||
bool iLockFlag=false;
|
|
||||||
/*延时关闭定时器*/
|
|
||||||
QTimer *m_pTimer;
|
|
||||||
QString m_strUnLockTip="";
|
|
||||||
QString m_strTimerOutUnLockTip="";
|
|
||||||
LoEmptyDialog *m_pSelf=nullptr;
|
|
||||||
void CloseWndByDelaySec(int iCloseWndDelaySec);
|
|
||||||
signals:
|
signals:
|
||||||
void startUp();
|
void startUp();
|
||||||
void sigClose();
|
void sigClose();
|
||||||
|
@ -37,8 +24,14 @@ public slots:
|
||||||
bool getLockStatus();
|
bool getLockStatus();
|
||||||
void SetFailedTipString(QString strTip);
|
void SetFailedTipString(QString strTip);
|
||||||
void SetTipTextContent(QString strTip);
|
void SetTipTextContent(QString strTip);
|
||||||
void CloseDlg();
|
private:
|
||||||
|
QLabel *label;
|
||||||
|
int iClosedFlag=0;
|
||||||
|
bool iLockFlag = false;
|
||||||
|
QString mFinishTip;
|
||||||
|
QString mTimeroutTip;
|
||||||
|
LoEmptyDialog *m_pSelf=nullptr;
|
||||||
|
void CloseWndByDelaySec(int iCloseWndDelaySec);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LOEMPTYDIALOG_H
|
#endif // LOEMPTYDIALOG_H
|
||||||
|
|
|
@ -1,122 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>LoEmptyDialog</class>
|
|
||||||
<widget class="QDialog" name="LoEmptyDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>142</width>
|
|
||||||
<height>127</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="frame">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -1,37 +0,0 @@
|
||||||
#include "louimsgboxokcancel.h"
|
|
||||||
#include "ui_louimsgboxokcancel.h"
|
|
||||||
|
|
||||||
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QWidget *parent) :
|
|
||||||
LoQDialog(parent),
|
|
||||||
ui(new Ui::LoUIMsgBoxOkCancel)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
//让QLabel自适应text的大小,直接用下面的代码:
|
|
||||||
ui->lInfo->adjustSize();
|
|
||||||
//让QLabel能够自动判断并换行显示:
|
|
||||||
ui->lInfo->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距
|
|
||||||
ui->lInfo->setWordWrap(true);
|
|
||||||
ui->lInfo->setAlignment(Qt::AlignTop);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QString text, QWidget *parent) :
|
|
||||||
LoQDialog(parent),
|
|
||||||
ui(new Ui::LoUIMsgBoxOkCancel)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->lInfo->setText(text);
|
|
||||||
// ui->plainTextEdit->sett>setText(text);
|
|
||||||
}
|
|
||||||
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QPixmap icon, QString text, QWidget *parent) :
|
|
||||||
LoQDialog(parent),
|
|
||||||
ui(new Ui::LoUIMsgBoxOkCancel)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->lInfo->setText(text);
|
|
||||||
ui->lIcon->setPixmap(icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoUIMsgBoxOkCancel::~LoUIMsgBoxOkCancel()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
#ifndef LOUIMSGBOXOKCANCEL_H
|
|
||||||
#define LOUIMSGBOXOKCANCEL_H
|
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class LoUIMsgBoxOkCancel;
|
|
||||||
}
|
|
||||||
|
|
||||||
class LoUIMsgBoxOkCancel : public LoQDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit LoUIMsgBoxOkCancel(QWidget *parent = nullptr);
|
|
||||||
LoUIMsgBoxOkCancel(QString text, QWidget *parent = nullptr);
|
|
||||||
LoUIMsgBoxOkCancel(QPixmap icon, QString text, QWidget *parent = nullptr);
|
|
||||||
~LoUIMsgBoxOkCancel();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::LoUIMsgBoxOkCancel *ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOUIMSGBOXOKCANCEL_H
|
|
|
@ -1,200 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>LoUIMsgBoxOkCancel</class>
|
|
||||||
<widget class="QDialog" name="LoUIMsgBoxOkCancel">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>327</width>
|
|
||||||
<height>85</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<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="QFrame" name="frame">
|
|
||||||
<property name="mouseTracking">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background-color: rgb(207, 207, 207);</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lIcon">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">image: url(:/res/Warning.png);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lInfo">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="inputMethodHints">
|
|
||||||
<set>Qt::ImhMultiLine</set>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="midLineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0,0,1">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="bnOK">
|
|
||||||
<property name="text">
|
|
||||||
<string>OK</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="bnCancel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>bnOK</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>LoUIMsgBoxOkCancel</receiver>
|
|
||||||
<slot>accept()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>123</x>
|
|
||||||
<y>62</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>163</x>
|
|
||||||
<y>42</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>bnCancel</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>LoUIMsgBoxOkCancel</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>204</x>
|
|
||||||
<y>62</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>163</x>
|
|
||||||
<y>42</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
|
@ -2,9 +2,10 @@
|
||||||
#include "ui_pixbmpshowdialog.h"
|
#include "ui_pixbmpshowdialog.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
PixbmpShowDialog::PixbmpShowDialog(QWidget *parent) :
|
PixbmpShowDialog::PixbmpShowDialog(QWidget *parent) :
|
||||||
LoQDialog(parent),
|
BaseDlg(parent),
|
||||||
ui(new Ui::PixbmpShowDialog)
|
ui(new Ui::PixbmpShowDialog)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#ifndef PIXBMPSHOWDIALOG_H
|
#ifndef PIXBMPSHOWDIALOG_H
|
||||||
#define PIXBMPSHOWDIALOG_H
|
#define PIXBMPSHOWDIALOG_H
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
#include <basedlg.h>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PixbmpShowDialog;
|
class PixbmpShowDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PixbmpShowDialog : public LoQDialog
|
class PixbmpShowDialog : public BaseDlg
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
<height>600</height>
|
<height>600</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
|
|
@ -21,17 +21,14 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDebug>
|
#define SPACE 5
|
||||||
|
|
||||||
QIPLineEdit::QIPLineEdit(QWidget *parent)
|
QIPLineEdit::QIPLineEdit(QWidget *parent) : QLineEdit(parent) {
|
||||||
: QLineEdit(parent)
|
|
||||||
{
|
|
||||||
QRegExp rx("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
|
QRegExp rx("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
|
||||||
pHBox = new QHBoxLayout(this);
|
pHBox = new QHBoxLayout(this);
|
||||||
pHBox->setSpacing(SPACE);
|
pHBox->setSpacing(SPACE);
|
||||||
pHBox->setContentsMargins(0, 0, 0, 0);
|
pHBox->setContentsMargins(0, 0, 0, 0);
|
||||||
for (int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++) {
|
||||||
{
|
|
||||||
m_lineEidt[i] = new QLineEdit(this);
|
m_lineEidt[i] = new QLineEdit(this);
|
||||||
m_lineEidt[i]->setFrame(false);
|
m_lineEidt[i]->setFrame(false);
|
||||||
m_lineEidt[i]->setMaxLength(3);
|
m_lineEidt[i]->setMaxLength(3);
|
||||||
|
@ -39,7 +36,6 @@ QIPLineEdit::QIPLineEdit(QWidget *parent)
|
||||||
m_lineEidt[i]->installEventFilter(this);
|
m_lineEidt[i]->installEventFilter(this);
|
||||||
m_lineEidt[i]->setValidator(new QRegExpValidator(rx, this));
|
m_lineEidt[i]->setValidator(new QRegExpValidator(rx, this));
|
||||||
m_lineEidt[i]->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
m_lineEidt[i]->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -73,21 +69,14 @@ QIPLineEdit::QIPLineEdit(QWidget *parent)
|
||||||
connect(m_lineEidt[1],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit2TextChanged(const QString &)));
|
connect(m_lineEidt[1],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit2TextChanged(const QString &)));
|
||||||
connect(m_lineEidt[2],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit3TextChanged(const QString &)));
|
connect(m_lineEidt[2],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit3TextChanged(const QString &)));
|
||||||
connect(m_lineEidt[3],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit4TextChanged(const QString &)));
|
connect(m_lineEidt[3],SIGNAL(textChanged(const QString &)),this,SLOT(OnLineEdit4TextChanged(const QString &)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QIPLineEdit::~QIPLineEdit()
|
QIPLineEdit::~QIPLineEdit() {
|
||||||
{
|
|
||||||
m_lineEidt[0]->deleteLater();
|
m_lineEidt[0]->deleteLater();
|
||||||
m_lineEidt[1]->deleteLater();
|
m_lineEidt[1]->deleteLater();
|
||||||
m_lineEidt[2]->deleteLater();
|
m_lineEidt[2]->deleteLater();
|
||||||
m_lineEidt[3]->deleteLater();
|
m_lineEidt[3]->deleteLater();
|
||||||
pHBox->deleteLater();
|
pHBox->deleteLater();
|
||||||
// delete pHBox;
|
|
||||||
// delete m_lineEidt[1];
|
|
||||||
// delete m_lineEidt[2];
|
|
||||||
// delete m_lineEidt[3];
|
|
||||||
// delete m_lineEidt[4];
|
|
||||||
}
|
}
|
||||||
void QIPLineEdit::MySetColor(QColor cr)
|
void QIPLineEdit::MySetColor(QColor cr)
|
||||||
{
|
{
|
||||||
|
@ -127,28 +116,22 @@ void QIPLineEdit::OnLineEdit4TextChanged(const QString & strtemp)
|
||||||
m_lineEidt[3]->setText(strtemp.left(strtemp.length()-1));
|
m_lineEidt[3]->setText(strtemp.left(strtemp.length()-1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void QIPLineEdit::paintEvent(QPaintEvent *event)
|
void QIPLineEdit::paintEvent(QPaintEvent *event) {
|
||||||
{
|
|
||||||
QWidget::paintEvent(event);
|
QWidget::paintEvent(event);
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
QBrush brush;
|
QBrush brush;
|
||||||
|
|
||||||
int width = 0;
|
int width = 0;
|
||||||
for (int i = 0; i < 3; i++)
|
for(int i = 0; i < 3; i++) {
|
||||||
{
|
|
||||||
brush.setStyle(Qt::BrushStyle::SolidPattern);
|
brush.setStyle(Qt::BrushStyle::SolidPattern);
|
||||||
|
|
||||||
//将两个lineEdit之间的空隙绘制成白色
|
//将两个lineEdit之间的空隙绘制成白色
|
||||||
brush.setColor(m_Color);
|
brush.setColor(m_Color);
|
||||||
painter.setPen(m_Color);
|
painter.setPen(m_Color);
|
||||||
painter.setBrush(brush);
|
painter.setBrush(brush);
|
||||||
painter.drawRect(m_lineEidt[i]->x() + m_lineEidt[i]->width(), m_lineEidt[i]->y(), SPACE, height());
|
painter.drawRect(m_lineEidt[i]->x() + m_lineEidt[i]->width(), m_lineEidt[i]->y(), SPACE, height());
|
||||||
|
|
||||||
//绘制空隙的边框
|
//绘制空隙的边框
|
||||||
painter.setPen(Qt::black);
|
painter.setPen(Qt::black);
|
||||||
painter.drawLine(0, 0, this->width(), 0);
|
painter.drawLine(0, 0, this->width(), 0);
|
||||||
painter.drawLine(0, this->height() - 1, this->width(), this->height() - 1);
|
painter.drawLine(0, this->height() - 1, this->width(), this->height() - 1);
|
||||||
|
|
||||||
//绘制小黑点
|
//绘制小黑点
|
||||||
brush.setColor(Qt::black);
|
brush.setColor(Qt::black);
|
||||||
painter.setPen(QPen());
|
painter.setPen(QPen());
|
||||||
|
@ -158,25 +141,17 @@ void QIPLineEdit::paintEvent(QPaintEvent *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int QIPLineEdit::getIndex(QLineEdit *pEdit)
|
int QIPLineEdit::getIndex(QLineEdit *pEdit){
|
||||||
{
|
|
||||||
int index = -1;
|
int index = -1;
|
||||||
for (int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++) if(pEdit == m_lineEidt[i]) index = i;
|
||||||
{
|
|
||||||
if (pEdit == m_lineEidt[i])
|
|
||||||
index = i;
|
|
||||||
}
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QIPLineEdit::eventFilter(QObject *obj, QEvent *ev)
|
bool QIPLineEdit::eventFilter(QObject *obj, QEvent *ev) {
|
||||||
{
|
if(children().contains(obj) && QEvent::KeyPress == ev->type()) {
|
||||||
if (children().contains(obj) && QEvent::KeyPress == ev->type())
|
|
||||||
{
|
|
||||||
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent *>(ev);
|
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent *>(ev);
|
||||||
QLineEdit *pEdit = qobject_cast<QLineEdit *>(obj);
|
QLineEdit *pEdit = qobject_cast<QLineEdit *>(obj);
|
||||||
switch (keyEvent->key())
|
switch (keyEvent->key()) {
|
||||||
{
|
|
||||||
case Qt::Key_0:
|
case Qt::Key_0:
|
||||||
case Qt::Key_1:
|
case Qt::Key_1:
|
||||||
case Qt::Key_2:
|
case Qt::Key_2:
|
||||||
|
@ -202,7 +177,7 @@ bool QIPLineEdit::eventFilter(QObject *obj, QEvent *ev)
|
||||||
m_lineEidt[index + 1]->selectAll();
|
m_lineEidt[index + 1]->selectAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strText.length() == 1 && strText.toInt() * 10 < 255)
|
else if (strText.length() == 2 && strText.toInt() * 10 < 255)
|
||||||
{
|
{
|
||||||
if (Qt::Key_0 == keyEvent->key() && strText.toInt())
|
if (Qt::Key_0 == keyEvent->key() && strText.toInt())
|
||||||
{
|
{
|
||||||
|
@ -257,21 +232,6 @@ bool QIPLineEdit::eventFilter(QObject *obj, QEvent *ev)
|
||||||
return QWidget::eventFilter(obj, ev);
|
return QWidget::eventFilter(obj, ev);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// case Qt::Key_Period:
|
|
||||||
// {
|
|
||||||
// if (pEdit->cursorPosition() == pEdit->text().length())
|
|
||||||
// {
|
|
||||||
// int index = getIndex(pEdit);
|
|
||||||
// if (index != -1 && index != 3)
|
|
||||||
// {
|
|
||||||
// m_lineEidt[index + 1]->setFocus();
|
|
||||||
// m_lineEidt[index + 1]->setCursorPosition(0);
|
|
||||||
// pEdit->setText(pEdit->text().left(pEdit->text().length()-1));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return QWidget::eventFilter(obj, ev);
|
|
||||||
// }
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -279,21 +239,6 @@ bool QIPLineEdit::eventFilter(QObject *obj, QEvent *ev)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//void QIPLineEdit::keyPressEvent(QKeyEvent *e)
|
|
||||||
//{
|
|
||||||
// int key=e->key();
|
|
||||||
// QMessageBox::warning(this, "Attention", "Your IP Address is Invalid!", QMessageBox::StandardButton::Ok);
|
|
||||||
// if(key==Qt::Key_Period )
|
|
||||||
// {
|
|
||||||
// // QLineEdit::keyPressEvent(e); //调用父类键盘事件处理函数
|
|
||||||
// QMessageBox::warning(this, "Attention", "Your IP Address is Invalid!", QMessageBox::StandardButton::Ok);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// QLineEdit::keyPressEvent(e);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
void QIPLineEdit::setText(const QString &strIP)
|
void QIPLineEdit::setText(const QString &strIP)
|
||||||
{
|
{
|
||||||
if (!isTextValid(strIP))
|
if (!isTextValid(strIP))
|
||||||
|
@ -313,12 +258,9 @@ void QIPLineEdit::setText(const QString &strIP)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QIPLineEdit::isTextValid(const QString &strIP)
|
bool QIPLineEdit::isTextValid(const QString &strIP) {
|
||||||
{
|
|
||||||
QRegExp rx2("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b");
|
QRegExp rx2("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b");
|
||||||
if (!rx2.exactMatch(strIP))
|
return rx2.exactMatch(strIP);
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QIPLineEdit::text() const
|
QString QIPLineEdit::text() const
|
||||||
|
|
|
@ -4,12 +4,9 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#define SPACE 5
|
|
||||||
|
|
||||||
class QIPLineEdit : public QLineEdit
|
class QIPLineEdit : public QLineEdit {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QIPLineEdit(QWidget *parent = nullptr);
|
QIPLineEdit(QWidget *parent = nullptr);
|
||||||
~QIPLineEdit();
|
~QIPLineEdit();
|
||||||
|
@ -25,7 +22,6 @@ protected:
|
||||||
|
|
||||||
int getIndex(QLineEdit *pEdit);
|
int getIndex(QLineEdit *pEdit);
|
||||||
bool isTextValid(const QString &strIP);
|
bool isTextValid(const QString &strIP);
|
||||||
// virtual void keyPressEvent(QKeyEvent *e);
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void OnLineEdit1TextChanged(const QString & strtemp);
|
void OnLineEdit1TextChanged(const QString & strtemp);
|
||||||
void OnLineEdit2TextChanged(const QString & strtemp);
|
void OnLineEdit2TextChanged(const QString & strtemp);
|
||||||
|
|
|
@ -1,102 +1,59 @@
|
||||||
#include "softconfigdialog.h"
|
#include "softconfigdialog.h"
|
||||||
#include "ui_softconfigdialog.h"
|
#include "cfg.h"
|
||||||
#include "loappconfig.h"
|
#include "globaldefine.h"
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
SoftConfigDialog::SoftConfigDialog(QWidget *parent) :
|
|
||||||
LoQDialog(parent),
|
|
||||||
ui(new Ui::SoftConfigDialog)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
LoAppConfig *cfg = LoAppConfig::getInstance();
|
|
||||||
|
|
||||||
QSettings *settings = new QSettings(cfg->OrganizationName(), cfg->ApplicationName());
|
SoftConfigDialog::SoftConfigDialog(QWidget *parent) : BaseDlg(parent) {
|
||||||
if(settings->value("videoconvert").isValid())
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
{
|
resize(400, 300);
|
||||||
if(settings->value("videoconvert").toBool())
|
setWindowTitle(tr("Software Configuration"));
|
||||||
{
|
auto vbox = new QVBoxLayout(this);
|
||||||
ui->checkBoxVideoConvert->setChecked(true);
|
|
||||||
}
|
auto pushButton = new QPushButton("X");
|
||||||
else {
|
pushButton->setFixedSize(30, 24);
|
||||||
ui->checkBoxVideoConvert->setChecked(false);
|
connect(pushButton, &QPushButton::clicked, this, &QWidget::close);
|
||||||
|
vbox->addWidget(pushButton, 0, Qt::AlignRight);
|
||||||
|
|
||||||
|
press_fd = new QCheckBox(tr("Video compress to")+" 720p");
|
||||||
|
vbox->addWidget(press_fd);
|
||||||
|
|
||||||
|
trans_fd = new QCheckBox(tr("Video transcoding to")+" h264");
|
||||||
|
vbox->addWidget(trans_fd);
|
||||||
|
|
||||||
|
auto hbox = new QHBoxLayout();
|
||||||
|
hbox->setContentsMargins(-1, 0, -1, -1);
|
||||||
|
anti_fd = new QCheckBox(tr("Text antialiasing"));
|
||||||
|
hbox->addWidget(anti_fd, 0, Qt::AlignTop);
|
||||||
|
|
||||||
|
auto anti_tip = new QLabel(tr("TextAntilaTip"));
|
||||||
|
anti_tip->setStyleSheet("color:#FF0000;");
|
||||||
|
anti_tip->setWordWrap(true);
|
||||||
|
hbox->addWidget(anti_tip);
|
||||||
|
|
||||||
|
vbox->addLayout(hbox);
|
||||||
|
|
||||||
|
vbox->addWidget(guangying_fd = new QCheckBox(tr("GuangYinPin")));
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
press_fd->setChecked(settings.value("VideoCompress", true).toBool());
|
||||||
|
trans_fd->setChecked(settings.value("VideoTranscoding", true).toBool());
|
||||||
|
anti_fd->setChecked(settings.value("TextAntialiasing", false).toBool());
|
||||||
|
guangying_fd->setChecked(settings.value("GuangYingPin", false).toBool());
|
||||||
|
|
||||||
|
auto ok_btn = new QPushButton(tr("OK"));
|
||||||
|
vbox->addWidget(ok_btn, 0, Qt::AlignCenter);
|
||||||
|
connect(ok_btn, &QPushButton::clicked, this, [this]() {
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("VideoCompress", press_fd->isChecked());
|
||||||
|
settings.setValue("VideoTranscoding", trans_fd->isChecked());
|
||||||
|
gTextAntialiasing = anti_fd->isChecked();
|
||||||
|
settings.setValue("TextAntialiasing", gTextAntialiasing);
|
||||||
|
gShowLoraScreen = guangying_fd->isChecked();
|
||||||
|
settings.setValue("GuangYingPin",gShowLoraScreen);
|
||||||
|
accept();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->checkBoxVideoConvert->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
if(settings->value("TextAntialiasing").isValid())
|
|
||||||
{
|
|
||||||
if(settings->value("TextAntialiasing").toBool())
|
|
||||||
{
|
|
||||||
ui->checkBoxFontGuanghua->setChecked(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->checkBoxFontGuanghua->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->checkBoxFontGuanghua->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
//元亨
|
|
||||||
// ui->checkBoxGuangYingPin->setVisible(false);
|
|
||||||
if(settings->value("GuangYingPin").isValid())
|
|
||||||
{
|
|
||||||
if(settings->value("GuangYingPin").toBool())
|
|
||||||
{
|
|
||||||
ui->checkBoxGuangYingPin->setChecked(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->checkBoxGuangYingPin->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->checkBoxGuangYingPin->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(OnOK()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
SoftConfigDialog::~SoftConfigDialog()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
void SoftConfigDialog::OnOK()
|
|
||||||
{
|
|
||||||
LoAppConfig *cfg = LoAppConfig::getInstance();
|
|
||||||
|
|
||||||
QSettings *settings = new QSettings(cfg->OrganizationName(), cfg->ApplicationName());
|
|
||||||
if(ui->checkBoxVideoConvert->isChecked())
|
|
||||||
{
|
|
||||||
settings->setValue("videoconvert",true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
settings->setValue("videoconvert",false);
|
|
||||||
|
|
||||||
}
|
|
||||||
m_globBoolFontantialiasing=ui->checkBoxFontGuanghua->isChecked();
|
|
||||||
if(m_globBoolFontantialiasing)
|
|
||||||
{
|
|
||||||
settings->setValue("TextAntialiasing",true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
settings->setValue("TextAntialiasing",false);
|
|
||||||
|
|
||||||
}
|
|
||||||
m_globBoolGuangYingPin=ui->checkBoxGuangYingPin->isChecked();
|
|
||||||
if(m_globBoolGuangYingPin)
|
|
||||||
{
|
|
||||||
settings->setValue("GuangYingPin",true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
settings->setValue("GuangYingPin",false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QDialog::accept();
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,25 +1,15 @@
|
||||||
#ifndef SOFTCONFIGDIALOG_H
|
#ifndef SOFTCONFIGDIALOG_H
|
||||||
#define SOFTCONFIGDIALOG_H
|
#define SOFTCONFIGDIALOG_H
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
#include "basedlg.h"
|
||||||
|
#include <QCheckBox>
|
||||||
|
|
||||||
namespace Ui {
|
class SoftConfigDialog : public BaseDlg {
|
||||||
class SoftConfigDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SoftConfigDialog : public LoQDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SoftConfigDialog(QWidget *parent = nullptr);
|
explicit SoftConfigDialog(QWidget *parent = nullptr);
|
||||||
~SoftConfigDialog();
|
|
||||||
|
|
||||||
private:
|
QCheckBox *press_fd, *trans_fd, *anti_fd, *guangying_fd;
|
||||||
Ui::SoftConfigDialog *ui;
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void OnOK();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SOFTCONFIGDIALOG_H
|
#endif // SOFTCONFIGDIALOG_H
|
||||||
|
|
|
@ -1,168 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>SoftConfigDialog</class>
|
|
||||||
<widget class="QDialog" name="SoftConfigDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>399</width>
|
|
||||||
<height>259</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Dialog</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QFrame" name="frame">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>382</width>
|
|
||||||
<height>241</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Software Configuration</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>X</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border-top: 2px solid gray; </string>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxVideoConvert">
|
|
||||||
<property name="text">
|
|
||||||
<string>Video convert format</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item alignment="Qt::AlignTop">
|
|
||||||
<widget class="QCheckBox" name="checkBoxFontGuanghua">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Text antialiasing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item alignment="Qt::AlignTop">
|
|
||||||
<widget class="QLabel" name="labelTextAntilaTip">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">color: #FF0000;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>TextAntilaTip</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</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>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxGuangYingPin">
|
|
||||||
<property name="text">
|
|
||||||
<string>GuangYinPin</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item alignment="Qt::AlignHCenter">
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>OK</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>pushButton</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>SoftConfigDialog</receiver>
|
|
||||||
<slot>close()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>365</x>
|
|
||||||
<y>32</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>199</x>
|
|
||||||
<y>90</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
|
@ -1,26 +1,24 @@
|
||||||
#include "updateledset3dialog.h"
|
#include "updateledset3dialog.h"
|
||||||
#include "ui_updateledset3dialog.h"
|
#include "ui_updateledset3dialog.h"
|
||||||
#include "x_uimsgboxok.h"
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <loappconfig.h>
|
#include <cfg.h>
|
||||||
static const QString DEFS_LEDSET_URL = "https://www.ledok.cn/download/definitions/ledset3updates.json";
|
|
||||||
|
extern const QString DEFS_LEDSET_URL = "https://www.ledok.cn/download/definitions/ledset3updates.json";
|
||||||
|
|
||||||
UpdateLedset3Dialog::UpdateLedset3Dialog(QWidget *parent) :
|
UpdateLedset3Dialog::UpdateLedset3Dialog(QWidget *parent) :
|
||||||
LoQDialog(parent),
|
BaseDlg(parent),
|
||||||
ui(new Ui::UpdateLedset3Dialog)
|
ui(new Ui::UpdateLedset3Dialog)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->pushButton_2->setVisible(false);
|
ui->pushButton_2->setVisible(false);
|
||||||
|
|
||||||
QString strCurApkVersion="";
|
QString strCurApkVersion="";
|
||||||
LoAppConfig *cfg = LoAppConfig::getInstance();
|
QSettings settings;
|
||||||
QSettings *settings = new QSettings(cfg->OrganizationName(), cfg->ApplicationName());
|
strCurApkVersion = settings.value(DEFS_LEDSET_URL).toString();
|
||||||
strCurApkVersion=settings->value(DEFS_LEDSET_URL).toString();
|
if(strCurApkVersion.isEmpty()) strCurApkVersion="0.0.0";
|
||||||
if(strCurApkVersion.isEmpty())
|
|
||||||
strCurApkVersion="0.0.0";
|
|
||||||
strCurApkVersion="0.0.0";
|
strCurApkVersion="0.0.0";
|
||||||
|
|
||||||
setStyleSheet("background-color:#D8D8D8");
|
|
||||||
ui->label_2->setText(tr("CurVersion")+":"+strCurApkVersion);
|
ui->label_2->setText(tr("CurVersion")+":"+strCurApkVersion);
|
||||||
ui->label_2->setVisible(false);
|
ui->label_2->setVisible(false);
|
||||||
|
|
||||||
|
@ -29,17 +27,13 @@ UpdateLedset3Dialog::UpdateLedset3Dialog(QWidget *parent) :
|
||||||
connect(m_updater,SIGNAL(checkingFinished(QString)),this,SLOT(updateChangelog(QString)));
|
connect(m_updater,SIGNAL(checkingFinished(QString)),this,SLOT(updateChangelog(QString)));
|
||||||
connect(m_updater,SIGNAL(downloadFinished(QString,QString)),this,SLOT(OnDownloadFinished(QString,QString)));
|
connect(m_updater,SIGNAL(downloadFinished(QString,QString)),this,SLOT(OnDownloadFinished(QString,QString)));
|
||||||
|
|
||||||
|
|
||||||
m_updater->getInstance()->setModuleVersion(DEFS_LEDSET_URL,strCurApkVersion);
|
m_updater->getInstance()->setModuleVersion(DEFS_LEDSET_URL,strCurApkVersion);
|
||||||
m_updater->getInstance()->setNotifyOnUpdate(DEFS_LEDSET_URL,false);
|
m_updater->getInstance()->setNotifyOnUpdate(DEFS_LEDSET_URL,false);
|
||||||
m_updater->getInstance()->setNotifyOnFinish(DEFS_LEDSET_URL,false);
|
m_updater->getInstance()->setNotifyOnFinish(DEFS_LEDSET_URL,false);
|
||||||
m_updater->getInstance()->setCompareBySameString(DEFS_LEDSET_URL,true);
|
m_updater->getInstance()->setCompareBySameString(DEFS_LEDSET_URL,true);
|
||||||
m_updater->getInstance()->checkForUpdates(DEFS_LEDSET_URL);
|
m_updater->getInstance()->checkForUpdates(DEFS_LEDSET_URL);
|
||||||
ui->pushButton->setProperty("ssType", "progManageTool");
|
ui->pushButton->setProperty("ssType", "progManageTool");
|
||||||
ui->pushButton->setStyleSheet("QPushButton{background:rgba(28,154,210,1);}");
|
|
||||||
ui->pushButton_2->setProperty("ssType", "progManageTool");
|
ui->pushButton_2->setProperty("ssType", "progManageTool");
|
||||||
ui->pushButton_2->setStyleSheet("QPushButton{background:rgba(28,154,210,1);}");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateLedset3Dialog::~UpdateLedset3Dialog()
|
UpdateLedset3Dialog::~UpdateLedset3Dialog()
|
||||||
|
@ -51,13 +45,9 @@ void UpdateLedset3Dialog::OnDownloadFinished( QString url, QString filepath)
|
||||||
ui->label_2->setText(tr("CurVersion")+":"+m_updater->getInstance()->getLatestVersion(DEFS_LEDSET_URL));
|
ui->label_2->setText(tr("CurVersion")+":"+m_updater->getInstance()->getLatestVersion(DEFS_LEDSET_URL));
|
||||||
ui->textEdit->setText(tr("Apk is download finished from internet,you can select LED Screen SYNC firmware now!"));
|
ui->textEdit->setText(tr("Apk is download finished from internet,you can select LED Screen SYNC firmware now!"));
|
||||||
ui->pushButton_2->setVisible(false);
|
ui->pushButton_2->setVisible(false);
|
||||||
LoAppConfig *cfg = LoAppConfig::getInstance();
|
QSettings settings;
|
||||||
QSettings *settings = new QSettings(cfg->OrganizationName(), cfg->ApplicationName());
|
settings.setValue(url, m_strLastestVersion);
|
||||||
settings->setValue(url, m_strLastestVersion);
|
settings.setValue("ledset", filepath);
|
||||||
settings->setValue("ledset", filepath);
|
|
||||||
// m_updater->getInstance()->setNotifyOnUpdate(DEFS_FIRMWARE_URL,false);
|
|
||||||
// m_updater->getInstance()->setNotifyOnFinish(DEFS_FIRMWARE_URL,false);
|
|
||||||
// m_updater->getInstance()->checkForUpdates(DEFS_FIRMWARE_URL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateLedset3Dialog::OnCheckForUpdates()
|
void UpdateLedset3Dialog::OnCheckForUpdates()
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#ifndef UPDATELEDSET3DIALOG_H
|
#ifndef UPDATELEDSET3DIALOG_H
|
||||||
#define UPDATELEDSET3DIALOG_H
|
#define UPDATELEDSET3DIALOG_H
|
||||||
|
|
||||||
#include <LoQClass/loqdialog.h>
|
#include <basedlg.h>
|
||||||
#include <QSimpleUpdater.h>
|
#include <QSimpleUpdater.h>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class UpdateLedset3Dialog;
|
class UpdateLedset3Dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class UpdateLedset3Dialog : public LoQDialog
|
class UpdateLedset3Dialog : public BaseDlg
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|