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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,35 +5,6 @@
#include "qqtmsgbox.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,
Qt::CheckState state ) const
@ -187,7 +158,8 @@ void QQtWiFiWidget::clickWIFI()
}
pline() << name << encryt << m_pass->wifiPwd();
} while ( 0 );
}
while ( 0 );
QQtEthenetManager::Instance()->setRefresh();
}

View File

@ -25,50 +25,6 @@
#include <QDebug>
#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
{

View File

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

View File

@ -3,6 +3,36 @@
#include "qqtcore.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 ( QObject* parent )

View File

@ -8,6 +8,51 @@
#include "qqtcore.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
{
Q_OBJECT

View File

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