1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

fix arm build

This commit is contained in:
AbelTian 2018-05-08 19:44:31 +08:00
parent dcc80ae9e7
commit 06e40a38af
12 changed files with 144 additions and 101 deletions

View File

@ -1,4 +1,4 @@
#include "qqtosdform.h" #include "qqtosdform.h"
#include "ui_qqtosdform.h" #include "ui_qqtosdform.h"
#include <QPainter> #include <QPainter>
#include <QBitmap> #include <QBitmap>
@ -11,7 +11,7 @@ QQtOsdForm::QQtOsdForm ( QWidget* parent ) :
ui->setupUi ( this ); ui->setupUi ( this );
//setStyleSheet ( "QQtOsdForm{ background-color: rgb(222, 222, 222, 0);}" ); //setStyleSheet ( "QQtOsdForm{ background-color: rgb(222, 222, 222, 0);}" );
//setWindowFlag ( Qt::FramelessWindowHint, true ); //setWindowFlag ( Qt::FramelessWindowHint, true );
setWindowFlag ( Qt::WindowStaysOnTopHint, true ); //setWindowFlag ( Qt::WindowStaysOnTopHint, true );
//setWindowFlag ( Qt::Tool, true ); //setWindowFlag ( Qt::Tool, true );
setAttribute ( Qt::WA_TranslucentBackground, true ); setAttribute ( Qt::WA_TranslucentBackground, true );
//setAttribute ( Qt::WA_TransparentForMouseEvents, true ); //setAttribute ( Qt::WA_TransparentForMouseEvents, true );
@ -32,8 +32,7 @@ QQtOsdForm::QQtOsdForm ( QWidget* parent ) :
//setWindowFlag ( Qt::FramelessWindowHint, true ); //setWindowFlag ( Qt::FramelessWindowHint, true );
//setWindowFlag ( Qt::CustomizeWindowHint, true ); //setWindowFlag ( Qt::CustomizeWindowHint, true );
//setWindowFlag ( Qt::SubWindow, true ); //setWindowFlag ( Qt::SubWindow, true );
setWindowFlag ( Qt::WindowSystemMenuHint, true ); //setWindowFlag ( Qt::WindowSystemMenuHint, true );
} }
QQtOsdForm::~QQtOsdForm() QQtOsdForm::~QQtOsdForm()

View File

@ -2,6 +2,7 @@
#define TESTWIDGET_H #define TESTWIDGET_H
#include <QWidget> #include <QWidget>
#include <qqtcore.h>
class TestWidget : public QWidget class TestWidget : public QWidget
{ {

View File

@ -155,8 +155,35 @@ bool QQtDictionary::isNull() const
bool QQtDictionary::isValid() const bool QQtDictionary::isValid() const
{ {
return isNull(); bool isValid = false;
switch ( m_type )
{
case DictValue:
if ( !m_value.isValid() )
isValid = true;
break;
case DictList:
if ( !m_list.isEmpty() )
isValid = true;
break;
case DictMap:
if ( !m_map.isEmpty() )
isValid = true;
break;
default:
break;
}
return isValid;
} }
bool QQtDictionary::isEmpty() const bool QQtDictionary::isEmpty() const
{ {
bool isEmpty = true; bool isEmpty = true;
@ -302,12 +329,12 @@ QQtDictionary& QQtDictionary::operator [] ( int index )
//list size = 4, 最大index = 3。新 index = 4, 添加新index才可以使用否则out of range。 //list size = 4, 最大index = 3。新 index = 4, 添加新index才可以使用否则out of range。
if ( m_list.size() < index + 1 ) if ( m_list.size() < index + 1 )
{ {
int cnt = m_list.count(); int cnt = m_list.size();
/*相差的数量*///count -> index+1 = index+1 - count /*相差的数量*///count -> index+1 = index+1 - count
for ( int i = 0; i < index + 1 - cnt; i++ ) for ( int i = 0; i < index + 1 - cnt; i++ )
m_list.append ( QQtDictionary() ); m_list.push_back ( QQtDictionary() );
} }
return ( QQtDictionary& ) m_list.operator [] ( index ); return ( QQtDictionary& ) m_list.operator [] ( index );
@ -389,11 +416,16 @@ QList<QQtDictionary>& QQtDictionary::getList() const
return ( QList<QQtDictionary>& ) m_list; return ( QList<QQtDictionary>& ) m_list;
} }
QVariant& QQtDictionary::getValue() const QVariant& QQtDictionary::getValue()
{ {
return ( QVariant& ) m_value; return ( QVariant& ) m_value;
} }
const QVariant& QQtDictionary::getValue() const
{
return ( const QVariant& ) m_value;
}
QQtDictionary& QQtDictionary::getChild ( int index ) QQtDictionary& QQtDictionary::getChild ( int index )
{ {
return m_list[index]; return m_list[index];

View File

@ -78,7 +78,8 @@ public:
/*获取单个数据*/ /*获取单个数据*/
/*保存为value的*/ /*保存为value的*/
QVariant& getValue() const; QVariant& getValue();
const QVariant& getValue() const;
QQtDictionary& getChild ( int index ); QQtDictionary& getChild ( int index );
QQtDictionary& getChild ( const QString& key ); QQtDictionary& getChild ( const QString& key );
/*获取一个个孩子*/ /*获取一个个孩子*/

View File

@ -39,15 +39,17 @@ public:
/* /*
* x方向y方向的layout间距 * x方向y方向的layout间距
* setContentsMargins(left, top, right, bottom); is a gool idea.
*/ */
void setLayoutSpacing ( int spacing = 0 ) { this->spacing = spacing; } void setLayoutSpacing ( int spacing = 0 ) { this->spacing = spacing; }
//setContentsMargins(left, top, right, bottom); is a gool idea.
/*TabBar的风格*/ /*TabBar的风格*/
IconStyle getIconStyle() const { return iconStyle; } IconStyle getIconStyle() const { return iconStyle; }
void setIconStyle ( IconStyle iconStyle ); void setIconStyle ( IconStyle iconStyle );
/*背景部分这里设置的是Tab的背景图*/ /**
* Tab的背景图
*/
/*使用颜色*/ /*使用颜色*/
QColor getBackgroundColor() const { return backgroundColor; } QColor getBackgroundColor() const { return backgroundColor; }
void setBackgroundColor ( QColor backgroundColor );//effected by drawbase void setBackgroundColor ( QColor backgroundColor );//effected by drawbase
@ -56,7 +58,10 @@ public:
void setTabPixmap ( int index, const QString& img = QString(), void setTabPixmap ( int index, const QString& img = QString(),
const QString& imgSel = QString() ); const QString& imgSel = QString() );
/*Icon部分这里设置的是Tab里的Icon*/ /**
* Icon部分Tab里的Icon
* icon
*/
void tabIcon ( int index, QImage& icon, QImage& iconSel ); void tabIcon ( int index, QImage& icon, QImage& iconSel );
void setTabIcon ( int index, const QString& icon = QString(), void setTabIcon ( int index, const QString& icon = QString(),
const QString& iconSel = QString() ); const QString& iconSel = QString() );

View File

@ -1,4 +1,4 @@
#ifndef QQTFRAMEDEFINE_H #ifndef QQTFRAMEDEFINE_H
#define QQTFRAMEDEFINE_H #define QQTFRAMEDEFINE_H
@ -114,6 +114,7 @@ enum
}; };
#define CONFIG_ROOT "."
#define CONFIG_PATH "./conf" #define CONFIG_PATH "./conf"
#define LOG_PATH "./log" #define LOG_PATH "./log"
#define AV_PATH "./res" #define AV_PATH "./res"
@ -128,9 +129,9 @@ enum
#define res(file) QString("%1/%2").arg("://res").arg(file) #define res(file) QString("%1/%2").arg("://res").arg(file)
#define skin(file) QString("%1/%2").arg("://skin").arg(file) #define skin(file) QString("%1/%2").arg("://skin").arg(file)
#else #else
#define qrc(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("./%1").arg(file)) #define qrc(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("%1/%2").arg(CONFIG_ROOT).arg(file))
#define res(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("./res/%1").arg(file)) #define res(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("%1/%2").arg(AV_PATH).arg(file))
#define skin(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("./skin/%1").arg(file)) #define skin(file) QDir(qApp->applicationDirPath()).relativeFilePath(QString("%1/%2").arg(SKIN_PATH).arg(file))
#endif #endif

View File

@ -5,35 +5,6 @@
#include "qqtmsgbox.h" #include "qqtmsgbox.h"
#include "qqtethenetmanager.h" #include "qqtethenetmanager.h"
bool tagWifi::isValid()
{
return wifi[ESSID_BSSID].isEmpty() ? false : true;
}
#ifdef __MIPS_LINUX__
tagWifi& tagWifi::operator= ( tagWifi& w )
#else
tagWifi& tagWifi::operator= ( const tagWifi& w )
#endif
{
for ( int i = ESSID_STATUS; i < ESSID_MAX; i++ )
wifi[i] = w[i];
return *this;
}
QString& tagWifi::operator[] ( int index )
{
if ( index < ESSID_STATUS || index >= ESSID_MAX )
return wifi[0];
return wifi[index];
}
const QString& tagWifi::operator[] ( int index ) const
{
return operator [] ( index );
}
void QQtWiFiIdTextDelegate::drawCheck ( QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, void QQtWiFiIdTextDelegate::drawCheck ( QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect,
Qt::CheckState state ) const Qt::CheckState state ) const
@ -187,7 +158,8 @@ void QQtWiFiWidget::clickWIFI()
} }
pline() << name << encryt << m_pass->wifiPwd(); pline() << name << encryt << m_pass->wifiPwd();
} while ( 0 ); }
while ( 0 );
QQtEthenetManager::Instance()->setRefresh(); QQtEthenetManager::Instance()->setRefresh();
} }

View File

@ -25,50 +25,6 @@
#include <QDebug> #include <QDebug>
#include <qqt-local.h> #include <qqt-local.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
enum
{
ESSID_STATUS = 0,
ESSID_NAME,//SSID
ESSID_TYPE,
ESSID_ENCRYP,
ESSID_PASS,
ESSID_BSSID,
ESSID_FREQ,
ESSID_SIGNAL,
ESSID_FLAG,
ESSID_MAX,
};
#ifdef __cplusplus
}
#endif /* __cplusplus */
typedef struct QQTSHARED_EXPORT tagWifi
{
QString wifi[ESSID_MAX];
bool isValid();
/* only mips32 no use const, arm used
* MIPS32不使用constARM32使用了
*/
#ifdef __MIPS_LINUX__
tagWifi& operator= ( tagWifi& w );
#else
tagWifi& operator= ( const tagWifi& w );
#endif
const QString& operator[] ( int index ) const;
QString& operator[] ( int index );
} TWifi;
class QQTSHARED_EXPORT QQtWiFiIdTextDelegate : public QItemDelegate class QQTSHARED_EXPORT QQtWiFiIdTextDelegate : public QItemDelegate
{ {

View File

@ -12,53 +12,53 @@
#include <qbluetoothdevicediscoveryagent.h> #include <qbluetoothdevicediscoveryagent.h>
#include <qbluetoothservicediscoveryagent.h> #include <qbluetoothservicediscoveryagent.h>
#include "qqt-local.h"
#include <QMap> #include <QMap>
#include <QList> #include <QList>
#include <qqtcore.h> #include <qqtcore.h>
#include "qqt-local.h"
class QQTSHARED_EXPORT QQtBluetoothManager : public QBluetoothLocalDevice class QQTSHARED_EXPORT QQtBluetoothManager : public QBluetoothLocalDevice
{ {
Q_OBJECT Q_OBJECT
public: public:
static QQtBluetoothManager* Instance(QObject* parent = 0); static QQtBluetoothManager* Instance ( QObject* parent = 0 );
/** /**
* @brief changeAdapter * @brief changeAdapter
* @param adapterAddress * @param adapterAddress
* local device * local device
*/ */
void changeAdapter(QBluetoothAddress& adapterAddress); void changeAdapter ( QBluetoothAddress& adapterAddress );
void powerOff(); void powerOff();
bool isPowerOn(); bool isPowerOn();
bool isDiscoverable(); bool isDiscoverable();
void setAutoScan(bool scan = true); void setAutoScan ( bool scan = true );
void setDiscoverable(bool able = true); void setDiscoverable ( bool able = true );
void refresh(); void refresh();
/** /**
* @brief getDeviceList * @brief getDeviceList
* remote device * remote device
*/ */
QList<QBluetoothDeviceInfo> getDeviceList(); QList<QBluetoothDeviceInfo> getDeviceList();
QList<QBluetoothServiceInfo> getServiceList(QBluetoothAddress& address); QList<QBluetoothServiceInfo> getServiceList ( QBluetoothAddress& address );
signals: signals:
/** /**
* @brief addDevice * @brief addDevice
* working signals * working signals
*/ */
void addDevice(QBluetoothDeviceInfo); void addDevice ( QBluetoothDeviceInfo );
void deviceScanFinished(); void deviceScanFinished();
void addService(QBluetoothServiceInfo); void addService ( QBluetoothServiceInfo );
void serviceScanFinished(); void serviceScanFinished();
public slots: public slots:
private slots: private slots:
void slot_addDevice(QBluetoothDeviceInfo); void slot_addDevice ( QBluetoothDeviceInfo );
void slot_addService(QBluetoothServiceInfo); void slot_addService ( QBluetoothServiceInfo );
protected: protected:
private: private:
explicit QQtBluetoothManager(QObject* parent = nullptr); explicit QQtBluetoothManager ( QObject* parent = nullptr );
static QQtBluetoothManager* _instance; static QQtBluetoothManager* _instance;
QBluetoothDeviceDiscoveryAgent* deviceDiscoveryAgent; QBluetoothDeviceDiscoveryAgent* deviceDiscoveryAgent;

View File

@ -3,6 +3,36 @@
#include "qqtcore.h" #include "qqtcore.h"
#include "qqt-qt.h" #include "qqt-qt.h"
bool tagWifi::isValid()
{
return wifi[ESSID_BSSID].isEmpty() ? false : true;
}
#ifdef __MIPS_LINUX__
tagWifi& tagWifi::operator= ( tagWifi& w )
#else
tagWifi& tagWifi::operator= ( const tagWifi& w )
#endif
{
for ( int i = ESSID_STATUS; i < ESSID_MAX; i++ )
wifi[i] = w[i];
return *this;
}
QString& tagWifi::operator[] ( int index )
{
if ( index < ESSID_STATUS || index >= ESSID_MAX )
return wifi[0];
return wifi[index];
}
const QString& tagWifi::operator[] ( int index ) const
{
return operator [] ( index );
}
QQtEthenetManager* QQtEthenetManager::_instance = NULL; QQtEthenetManager* QQtEthenetManager::_instance = NULL;
QQtEthenetManager* QQtEthenetManager::Instance ( QObject* parent ) QQtEthenetManager* QQtEthenetManager::Instance ( QObject* parent )

View File

@ -8,6 +8,51 @@
#include "qqtcore.h" #include "qqtcore.h"
#include "qqt-local.h" #include "qqt-local.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
enum
{
ESSID_STATUS = 0,
ESSID_NAME,//SSID
ESSID_TYPE,
ESSID_ENCRYP,
ESSID_PASS,
ESSID_BSSID,
ESSID_FREQ,
ESSID_SIGNAL,
ESSID_FLAG,
ESSID_MAX,
};
#ifdef __cplusplus
}
#endif /* __cplusplus */
typedef struct QQTSHARED_EXPORT tagWifi
{
QString wifi[ESSID_MAX];
bool isValid();
/* only mips32 no use const, arm used
* MIPS32不使用constARM32使用了
*/
#ifdef __MIPS_LINUX__
tagWifi& operator= ( tagWifi& w );
#else
tagWifi& operator= ( const tagWifi& w );
#endif
const QString& operator[] ( int index ) const;
QString& operator[] ( int index );
} TWifi;
class QQTSHARED_EXPORT QQtNetWorkClearThread : public QThread class QQTSHARED_EXPORT QQtNetWorkClearThread : public QThread
{ {
Q_OBJECT Q_OBJECT

View File

@ -319,6 +319,7 @@ contains (DEFINES, __EXQUISITE__) {
#opengl module #opengl module
DEFINES += __OPENGLWIDGETS__ DEFINES += __OPENGLWIDGETS__
contains(QKIT_PRIVATE, MIPS32||ARM32||EMBEDDED):DEFINES-=__OPENGLWIDGETS__
contains (DEFINES, __OPENGLWIDGETS__) { contains (DEFINES, __OPENGLWIDGETS__) {
QT += opengl QT += opengl
} }