mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
Support Qt4, compiled
This commit is contained in:
parent
e44361e6b7
commit
763ec1027c
@ -3,9 +3,9 @@ CONFIG += ordered
|
||||
|
||||
SUBDIRS =
|
||||
SUBDIRS += src/qqt.pro
|
||||
SUBDIRS += examples/framelesshelperwidget
|
||||
#SUBDIRS += examples/framelesshelperwidget
|
||||
#SUBDIRS += examples/qqtframe
|
||||
#SUBDIRS += examples/qqtframe2
|
||||
SUBDIRS += examples/qqtframe2
|
||||
#SUBDIRS += examples/animationframe
|
||||
#SUBDIRS += examples/cmdwidget
|
||||
#SUBDIRS += examples/qqtbluetoothfiletransferserver
|
||||
|
@ -25,7 +25,7 @@ class QQTSHARED_EXPORT QQtCustomVerificationCode : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QQtCustomVerificationCode(QWidget* parent = nullptr, quint16 width = 180, quint16 height = 50, quint8 count = 6);
|
||||
explicit QQtCustomVerificationCode(QWidget* parent = 0, quint16 width = 180, quint16 height = 50, quint8 count = 6);
|
||||
|
||||
/**
|
||||
* @brief generateOneCaptcha 生成一个验证码
|
||||
|
@ -58,8 +58,11 @@ void QQtFramelessHelperPrivate::addDragWidget(QWidget* widget)
|
||||
void QQtFramelessHelperPrivate::checkPos()
|
||||
{
|
||||
QRect rectMustIn = parent->frameGeometry();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
QRect rectMustNotIn = rectMustIn.marginsRemoved(margins);
|
||||
|
||||
#else
|
||||
QRect rectMustNotIn = rectMustIn.adjusted(margins.left(), margins.top(), margins.right(), margins.bottom());
|
||||
#endif
|
||||
QPoint cursorPos = QCursor::pos();
|
||||
|
||||
if (isMaximized ||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <QLabel>
|
||||
#include <QUrl>
|
||||
#include <QResizeEvent>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
#include <QDesktopServices>
|
||||
#include "qqt-local.h"
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
#include "qqtwebclient.h"
|
||||
#include "qqtcore.h"
|
||||
|
||||
QQtWebClient::QQtWebClient(QObject *parent) : QNetworkAccessManager(parent)
|
||||
QQtWebClient::QQtWebClient(QObject* parent) : QNetworkAccessManager(parent)
|
||||
{
|
||||
connect(this, SIGNAL(finished(QNetworkReply*)),
|
||||
this, SLOT(finished(QNetworkReply*)));
|
||||
|
||||
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
|
||||
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
|
||||
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
|
||||
this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
|
||||
|
||||
connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
|
||||
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
|
||||
connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*)),
|
||||
this, SLOT(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*)));
|
||||
|
||||
connect(this, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
connect(this, SIGNAL(sslErrors(QNetworkReply*, QList<QSslError>)),
|
||||
this, SLOT(sslErrors(QNetworkReply*, QList<QSslError>)));
|
||||
|
||||
connect(this, SIGNAL(networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility)),
|
||||
this, SLOT(networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility)));
|
||||
@ -22,22 +22,22 @@ QQtWebClient::QQtWebClient(QObject *parent) : QNetworkAccessManager(parent)
|
||||
this, SLOT(networkSessionConnected()));
|
||||
}
|
||||
|
||||
void QQtWebClient::finished(QNetworkReply *reply)
|
||||
void QQtWebClient::finished(QNetworkReply* reply)
|
||||
{
|
||||
pline() << reply;
|
||||
}
|
||||
|
||||
void QQtWebClient::authenticationRequired(QNetworkReply *r, QAuthenticator * a)
|
||||
void QQtWebClient::authenticationRequired(QNetworkReply* r, QAuthenticator* a)
|
||||
{
|
||||
pline() << r << a;
|
||||
}
|
||||
|
||||
void QQtWebClient::proxyAuthenticationRequired(QNetworkProxy p, QAuthenticator * a)
|
||||
void QQtWebClient::proxyAuthenticationRequired(QNetworkProxy p, QAuthenticator* a)
|
||||
{
|
||||
pline() << p << a;
|
||||
pline() << p.hostName() << a;
|
||||
}
|
||||
|
||||
void QQtWebClient::sslErrors(QNetworkReply *r, QList<QSslError> e)
|
||||
void QQtWebClient::sslErrors(QNetworkReply* r, QList<QSslError> e)
|
||||
{
|
||||
pline() << r << e;
|
||||
}
|
||||
|
@ -4,13 +4,14 @@
|
||||
#include <QNetworkAccessManager>
|
||||
//import this struct will not build fail
|
||||
#include <QNetworkProxy>
|
||||
#include <qqt-qt.h>
|
||||
#include <qqt-local.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtWebClient : public QNetworkAccessManager
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QQtWebClient(QObject *parent = 0);
|
||||
explicit QQtWebClient(QObject* parent = 0);
|
||||
|
||||
//void installProtocol();
|
||||
//void uninstallProtocol();
|
||||
@ -20,10 +21,10 @@ signals:
|
||||
public slots:
|
||||
|
||||
private slots:
|
||||
void finished(QNetworkReply *reply);
|
||||
void authenticationRequired(QNetworkReply*,QAuthenticator*);
|
||||
void proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*);
|
||||
void sslErrors(QNetworkReply*,QList<QSslError>);
|
||||
void finished(QNetworkReply* reply);
|
||||
void authenticationRequired(QNetworkReply*, QAuthenticator*);
|
||||
void proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*);
|
||||
void sslErrors(QNetworkReply*, QList<QSslError>);
|
||||
void networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility);
|
||||
void networkSessionConnected();
|
||||
};
|
||||
|
11
src/qqt.pro
11
src/qqt.pro
@ -21,11 +21,16 @@ equals(QKIT_, macOS) {
|
||||
}
|
||||
CONFIG += debug_and_release
|
||||
CONFIG += build_all
|
||||
for (cc, CONFIG) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): {
|
||||
for (cc, CONFIG) {
|
||||
message($${TARGET} configed $${cc})
|
||||
}
|
||||
for (cc, DEFINES) {
|
||||
}
|
||||
for (cc, DEFINES) {
|
||||
message($${TARGET} defined $${cc})
|
||||
}
|
||||
} else {
|
||||
message ($${TARGET} configed $${CONFIG})
|
||||
message ($${TARGET} defined $${DEFINES})
|
||||
}
|
||||
############
|
||||
##install
|
||||
|
@ -78,6 +78,8 @@ greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
|
||||
#if you use qextserialport, open the annotation
|
||||
#suggest: Qt5 use factory-packed, Qt4 use forming Qt5, extra use this.
|
||||
#DEFINES += __QEXTSERIALPORT__
|
||||
#if compiler QtSerialPort module manual, note this line is a good idea.
|
||||
lessThan(QT_MAJOR_VERSION, 5): DEFINES += __QEXTSERIALPORT__
|
||||
contains (DEFINES, __QEXTSERIALPORT__) {
|
||||
#include ( $$PWD/network/qextserialport/qextserialport.pri )
|
||||
CONFIG += thread
|
||||
@ -97,6 +99,8 @@ contains (DEFINES, __QEXTSERIALPORT__) {
|
||||
DEFINES += __CUSTOMPLOT__
|
||||
#if you use qtbluetooth, open this annotation
|
||||
DEFINES += __BLUETOOTH__
|
||||
#if compiler QtBluetooth module manual, note this line is a good idea.
|
||||
lessThan(QT_MAJOR_VERSION, 5): DEFINES -= __BLUETOOTH__
|
||||
contains (DEFINES, __BLUETOOTH__) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += bluetooth
|
||||
lessThan(QT_MAJOR_VERSION, 5): CONFIG += bluetooth
|
||||
|
Loading…
x
Reference in New Issue
Block a user