更新代码

master
feiyangqingyun 2021-08-12 11:19:48 +08:00
parent bf6c0a95dd
commit 388361f4e8
16 changed files with 86 additions and 8 deletions

View File

@ -20,12 +20,12 @@ void EmailAddress::setAddress(const QString &address)
this->address = address; this->address = address;
} }
const QString &EmailAddress::getName() const const QString EmailAddress::getName() const
{ {
return name; return name;
} }
const QString &EmailAddress::getAddress() const const QString EmailAddress::getAddress() const
{ {
return address; return address;
} }

View File

@ -8,7 +8,7 @@ class EmailAddress : public QObject
Q_OBJECT Q_OBJECT
public: public:
EmailAddress(); explicit EmailAddress();
EmailAddress(const QString &address, const QString &name = ""); EmailAddress(const QString &address, const QString &name = "");
~EmailAddress(); ~EmailAddress();
@ -16,8 +16,8 @@ public:
void setName(const QString &name); void setName(const QString &name);
void setAddress(const QString &address); void setAddress(const QString &address);
const QString &getName() const; const QString getName() const;
const QString &getAddress() const; const QString getAddress() const;
private: private:
QString name; QString name;

41
core_common/base64.cpp Normal file
View File

@ -0,0 +1,41 @@
#include "base64.h"
#include "qbuffer.h"
#include "qdebug.h"
QString Base64::imageToBase64(const QImage &image)
{
return QString(imageToBase64x(image));
}
QByteArray Base64::imageToBase64x(const QImage &image)
{
//这个转换可能比较耗时建议在线程中执行
QByteArray data;
QBuffer buffer(&data);
image.save(&buffer, "JPG");
data = data.toBase64();
return data;
}
QImage Base64::base64ToImage(const QString &data)
{
return base64ToImagex(data.toUtf8());
}
QImage Base64::base64ToImagex(const QByteArray &data)
{
//这个转换可能比较耗时建议在线程中执行
QImage image;
image.loadFromData(QByteArray::fromBase64(data));
return image;
}
QString Base64::textToBase64(const QString &text)
{
return QString(text.toLocal8Bit().toBase64());
}
QString Base64::base64ToText(const QString &text)
{
return QString(QByteArray::fromBase64(text.toLocal8Bit()));
}

37
core_common/base64.h Normal file
View File

@ -0,0 +1,37 @@
#ifndef BASE64_H
#define BASE64_H
/**
* base64 :feiyangqingyun(QQ:517216493) 2016-12-16
* 1. base64
* 2. base64
* 3. base64
* 4. base64
* 5.
* 6. Qt6base64200%
*/
#include <QImage>
#ifdef quc
class Q_DECL_EXPORT Base64
#else
class Base64
#endif
{
public:
//图片转base64字符串
static QString imageToBase64(const QImage &image);
static QByteArray imageToBase64x(const QImage &image);
//base64字符串转图片
static QImage base64ToImage(const QString &data);
static QImage base64ToImagex(const QByteArray &data);
//字符串与base64互转
static QString textToBase64(const QString &text);
static QString base64ToText(const QString &text);
};
#endif // BASE64_H

View File

@ -22,11 +22,13 @@ include ($$PWD/h3.pri)
HEADERS += \ HEADERS += \
$$PWD/appinit.h \ $$PWD/appinit.h \
$$PWD/base64.h \
$$PWD/iconhelper.h \ $$PWD/iconhelper.h \
$$PWD/quihelper.h $$PWD/quihelper.h
SOURCES += \ SOURCES += \
$$PWD/appinit.cpp \ $$PWD/appinit.cpp \
$$PWD/base64.cpp \
$$PWD/iconhelper.cpp \ $$PWD/iconhelper.cpp \
$$PWD/quihelper.cpp $$PWD/quihelper.cpp

View File

@ -171,10 +171,8 @@ void QUIHelper::setFont(int fontSize)
#endif #endif
#ifndef rk3399 #ifndef rk3399
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
qApp->setFont(font); qApp->setFont(font);
#endif #endif
#endif
} }
void QUIHelper::setCode(bool utf8) void QUIHelper::setCode(bool utf8)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 94 KiB