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

add QQtChart, open customplot to ios, move all QQT to QQt

This commit is contained in:
tianduanrui 2017-11-21 23:12:29 +08:00
parent df5bc5d0d6
commit 66598fdcad
80 changed files with 1907 additions and 1816 deletions

View File

@ -16,14 +16,14 @@ AnimationManager* AnimationManager::Instance(QObject* parent)
AnimationManager::AnimationManager(QObject* parent) : QObject(parent)
{
//init app's all animation
QPushButton* pushButton = (QPushButton*)QQTObjectFactory::registedObject("pushButton");
QPushButton* pushButton_2 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_2");
QPushButton* pushButton_3 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_3");
QPushButton* pushButton_4 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_4");
QPushButton* pushButton_5 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_5");
QPushButton* pushButton_6 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_6");
QPushButton* pushButton = (QPushButton*)QQtObjectFactory::registedObject("pushButton");
QPushButton* pushButton_2 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_2");
QPushButton* pushButton_3 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_3");
QPushButton* pushButton_4 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_4");
QPushButton* pushButton_5 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_5");
QPushButton* pushButton_6 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_6");
QQTAnimation* ani = new QQTAnimation(this);
QQtAnimation* ani = new QQtAnimation(this);
QSequentialAnimationGroup* sa = new QSequentialAnimationGroup(ani);
QParallelAnimationGroup* pa = new QParallelAnimationGroup(ani);

View File

@ -16,7 +16,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -14,7 +14,7 @@ QQTWindow::QQTWindow(QWidget* parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*
@ -29,15 +29,15 @@ QQTWindow::QQTWindow(QWidget* parent) :
setFixedSize(1024, 600);
moveCenter(this);
QQTObjectFactory::registerObject(ui->pushButton);
QQTObjectFactory::registerObject(ui->pushButton_2);
QQTObjectFactory::registerObject(ui->pushButton_3);
QQTObjectFactory::registerObject(ui->pushButton_4);
QQTObjectFactory::registerObject(ui->pushButton_5);
QQTObjectFactory::registerObject(ui->pushButton_6);
QQtObjectFactory::registerObject(ui->pushButton);
QQtObjectFactory::registerObject(ui->pushButton_2);
QQtObjectFactory::registerObject(ui->pushButton_3);
QQtObjectFactory::registerObject(ui->pushButton_4);
QQtObjectFactory::registerObject(ui->pushButton_5);
QQtObjectFactory::registerObject(ui->pushButton_6);
/**
* @brief QQTAnimationManager::Instance
* @brief QQtAnimationManager::Instance
*
*/
AnimationManager::Instance(this);

View File

@ -16,7 +16,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -16,7 +16,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -16,7 +16,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -17,7 +17,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -100,20 +100,20 @@ QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -140,13 +140,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if(QQTPluginWatcher::E_ADD == status)
if(QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if(file.exists())
if(QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if(QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -17,7 +17,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -25,8 +25,8 @@ AnimationManager::AnimationManager(QObject *parent) : QObject(parent)
* user can't decate qqtwindow
*/
QQTWindow* qqtwindow = (QQTWindow*)
QQTObjectFactory::registedObject("QQTWindow");
QQTAnimation* ani = new QQTAnimation(this);
QQtObjectFactory::registedObject("QQTWindow");
QQtAnimation* ani = new QQtAnimation(this);
QSequentialAnimationGroup* sani = new QSequentialAnimationGroup(ani);
QParallelAnimationGroup* pani = new QParallelAnimationGroup(ani);
QPropertyAnimation* ani1 = new QPropertyAnimation(qqtwindow, "geometry");

View File

@ -15,7 +15,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -98,20 +98,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -138,13 +138,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -22,7 +22,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -3,29 +3,29 @@
#include "qqtcore.h"
#include "qqt-qt.h"
QQTClient* QQTUpgradeClientInstance(QObject* parent)
QQtClient* QQTUpgradeClientInstance(QObject* parent)
{
static QQTClient* cli = NULL;
static QQtClient* cli = NULL;
if (!cli)
{
QStringList ip;
ip << "222.175.114.244" << "124.133.1.54";
//"www.QQToo.com"
cli = new QQTClient(parent);
cli = new QQtClient(parent);
cli->SetServerIPAddress(ip);
cli->SetServerPort(8089);
}
return cli;
}
QQTClient* QQTCloudClientInstance(QObject* parent)
QQtClient* QQTCloudClientInstance(QObject* parent)
{
static QQTClient* cli = NULL;
static QQtClient* cli = NULL;
if (!cli)
{
QStringList ip;
ip << "222.175.114.244" << "124.133.1.54";
cli = new QQTClient(parent);
cli = new QQtClient(parent);
cli->SetServerIPAddress(ip);
cli->SetServerPort(7079);
}

View File

@ -424,10 +424,10 @@ public:
};
QQTClient *QQTUpgradeClientInstance(QObject *parent);
QQtClient *QQTUpgradeClientInstance(QObject *parent);
QQTClient *QQTCloudClientInstance(QObject *parent);
QQtClient *QQTCloudClientInstance(QObject *parent);
#endif // QQTCLOUDPROTOCOL_H

View File

@ -28,9 +28,9 @@ bool QQTLanProtocol::dispatcher(const QByteArray &m)
}
QQTServer *QQTSingleServer(QObject *parent)
QQtServer *QQTSingleServer(QObject *parent)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
return s;
}

View File

@ -17,6 +17,6 @@ public:
bool dispatcher(const QByteArray &m) override;
};
QQTServer *QQTSingleServer(QObject* parent);
QQtServer *QQTSingleServer(QObject* parent);
#endif // QQTLANPROTOCOL_H

View File

@ -17,7 +17,7 @@
*/
void QQTLanServer(QObject* parent = 0)
{
static QQTServer* s = new QQTServer(parent);
static QQtServer* s = new QQtServer(parent);
s->listen(QHostAddress::Any, 8000);
s->installedProtocol();
@ -100,20 +100,20 @@ QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
#endif
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
//QQTClient
//QQtClient
//QQTCloudClientInstance(this);
#ifdef __EMBEDDED_LINUX__
//QQTEthManager
QQTEthenetManager::Instance(this);
QQtEthenetManager::Instance(this);
#endif
//QQTServer
//QQtServer
//QQTPeerPort
//QQTPeerPortInstance(this);
@ -140,13 +140,13 @@ void QQTApp::setLanguage()
void QQTApp::slotUPanAutoRun(int status)
{
if(QQTPluginWatcher::E_ADD == status)
if(QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if(file.exists())
if(QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if(QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
return;
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);

View File

@ -13,7 +13,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
{
ui->setupUi(this);
QQTObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(this);
#ifdef __EMBEDDED_LINUX__
/*

View File

@ -37,7 +37,7 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QQTLineEditWithSearch" name="lineEdit">
<widget class="QQtLineEditWithSearch" name="lineEdit">
<property name="minimumSize">
<size>
<width>0</width>
@ -78,7 +78,7 @@
</widget>
<customwidgets>
<customwidget>
<class>QQTLineEditWithSearch</class>
<class>QQtLineEditWithSearch</class>
<extends>QLineEdit</extends>
<header location="global">qqtlineeditwithsearch.h</header>
</customwidget>

6
src/charts/qqtchart.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "qqtchart.h"
QQtChart::QQtChart(QWidget *parent) : QWidget(parent)
{
}

17
src/charts/qqtchart.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef QQTCHART_H
#define QQTCHART_H
#include <QWidget>
class QQtChart : public QWidget
{
Q_OBJECT
public:
explicit QQtChart(QWidget *parent = nullptr);
signals:
public slots:
};
#endif // QQTCHART_H

View File

@ -0,0 +1,13 @@
#include "qqtchartview.h"
QQtChartView::QQtChartView ( QWidget* parent ) :
QChartView ( parent )
{
}
QQtChartView::QQtChartView ( QChart* chart, QWidget* parent ) :
QChartView ( chart, parent )
{
}

29
src/charts/qqtchartview.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef QQTCHARTVIEW_H
#define QQTCHARTVIEW_H
#include <QWidget>
#include <QtCharts/QChartView>
#include <QtCharts/QBarSeries>
#include <QtCharts/QBarSet>
#include <QtCharts/QLegend>
#include <QtCharts/QBarCategoryAxis>
QT_CHARTS_USE_NAMESPACE
#include "qqtcore.h"
#include "qqt-local.h"
class QQTSHARED_EXPORT QQtChartView : public QChartView
{
Q_OBJECT
public:
explicit QQtChartView ( QWidget* parent = nullptr );
explicit QQtChartView ( QChart* chart, QWidget* parent = nullptr );
virtual ~QQtChartView() {}
signals:
public slots:
};
#endif // QQTCHARTVIEW_H

View File

@ -1,6 +1,6 @@
#include "qqtanimation.h"
QQTAnimation::QQTAnimation(QObject* parent) : QParallelAnimationGroup(parent)
QQtAnimation::QQtAnimation(QObject* parent) : QParallelAnimationGroup(parent)
{
}

View File

@ -9,11 +9,11 @@
#include "qqtcore.h"
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTAnimation : public QParallelAnimationGroup
class QQTSHARED_EXPORT QQtAnimation : public QParallelAnimationGroup
{
Q_OBJECT
public:
explicit QQTAnimation(QObject* parent = nullptr);
explicit QQtAnimation ( QObject* parent = nullptr );
signals:

View File

@ -86,7 +86,7 @@ typedef unsigned char uint8_t;
#define NOTICE "Notice"
QQTSHARED_EXPORT void QQTSleep(int millsecond);
QQTSHARED_EXPORT void QQTSleep ( int millsecond );
#ifdef __cplusplus
}
@ -98,61 +98,61 @@ QQTSHARED_EXPORT void QQTSleep(int millsecond);
#define ptime() pline() << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss zzz")
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const quint8 r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const quint8 r );
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const quint16 r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const quint16 r );
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const quint32 r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const quint32 r );
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const QByteArray& r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const QByteArray& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, quint8& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, quint8& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, quint16& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, quint16& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, quint32& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, quint32& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, QByteArray& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, QByteArray& r );
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const qint16 r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const qint16 r );
QQTSHARED_EXPORT QByteArray& operator<<(QByteArray& l, const qint32 r);
QQTSHARED_EXPORT QByteArray& operator<< ( QByteArray& l, const qint32 r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, qint8& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, qint8& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, qint16& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, qint16& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, qint32& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, qint32& r );
QQTSHARED_EXPORT QByteArray& operator>>(QByteArray& l, QByteArray& r);
QQTSHARED_EXPORT QByteArray& operator>> ( QByteArray& l, QByteArray& r );
/**
* @brief The QQTBlock class
* @brief The QQtBlock class
* QMutexQSemphoreQCondation在gui线程会锁定guigui线程中堵塞但是不要锁定gui
* block应用场合为gui线程内部线
*
*/
class QQTSHARED_EXPORT QQTBlock : public QObject
class QQTSHARED_EXPORT QQtBlock : public QObject
{
public:
explicit QQTBlock(QObject* parent = 0): QObject(parent), m_lock(0) {}
explicit QQtBlock ( QObject* parent = 0 ) : QObject ( parent ), m_lock ( 0 ) {}
//0x7FFFFFFF
bool lock(int millsecond = 0x7FFFFFFF) {
bool lock ( int millsecond = 0x7FFFFFFF ) {
//m_lock++;
m_lock = 1;
timer.restart();
while (timer.elapsed() < millsecond) {
if (m_lock <= 0)
while ( timer.elapsed() < millsecond ) {
if ( m_lock <= 0 )
break;
QApplication::processEvents();
}
if (timer.elapsed() >= millsecond)
if ( timer.elapsed() >= millsecond )
return false;
return true;
@ -164,7 +164,7 @@ public:
}
bool isLocked() {
if (m_lock <= 0)
if ( m_lock <= 0 )
return false;
return true;

View File

@ -11,10 +11,10 @@
#include "qqtcore.h"
/**
* @brief The QQTObjectFactory class
* @brief The QQtObjectFactory class
* QQT
*/
class QQTSHARED_EXPORT QQTObjectFactory
class QQTSHARED_EXPORT QQtObjectFactory
{
public:
/**
@ -23,39 +23,39 @@ public:
* @param parent
* @return
*/
static QObject* createObject(const QByteArray& className, QObject* parent = NULL) {
static QObject* createObject ( const QByteArray& className, QObject* parent = NULL ) {
/*
*
*/
Constructor constructor = constructors().value(className);
Constructor constructor = constructors().value ( className );
if (constructor == NULL)
if ( constructor == NULL )
return NULL;
/*
* ,constructorHelper<className>(parent)
*/
return (*constructor)(parent);
return ( *constructor ) ( parent );
}
/**
* @brief registerObject
* @param w
*/
static void registerObject(const QObject* const& w) {
containers().push_back(w);
static void registerObject ( const QObject* const& w ) {
containers().push_back ( w );
}
/**
* @brief unregisterObject
* @param w
*/
static void unregisterObject(const QObject*& w) {
QListIterator<const QObject*> itor(containers());
static void unregisterObject ( const QObject*& w ) {
QListIterator<const QObject*> itor ( containers() );
while (itor.hasNext()) {
while ( itor.hasNext() ) {
const QObject* ww = itor.next();
if (ww == w) {
containers().removeOne(w);
if ( ww == w ) {
containers().removeOne ( w );
break;
}
}
@ -65,13 +65,13 @@ public:
* @param objName
* @return
*/
static const QObject* registedObject(const QString objName) {
QListIterator<const QObject*> itor(containers());
static const QObject* registedObject ( const QString objName ) {
QListIterator<const QObject*> itor ( containers() );
while (itor.hasNext()) {
while ( itor.hasNext() ) {
const QObject* ww = itor.next();
if (ww->objectName() == objName) {
if ( ww->objectName() == objName ) {
return ww;
}
}
@ -80,11 +80,11 @@ public:
}
private:
typedef QObject* (*Constructor)(QObject* parent);
typedef QObject* ( *Constructor ) ( QObject* parent );
template<typename T>
static QObject* constructorHelper(QObject* parent) {
return new T(parent);
static QObject* constructorHelper ( QObject* parent ) {
return new T ( parent );
}
static QHash<QByteArray, Constructor>& constructors() {
@ -100,7 +100,7 @@ private:
/*
* Hash
*/
constructors().insert(T::staticMetaObject.className(), &constructorHelper<T>);
constructors().insert ( T::staticMetaObject.className(), &constructorHelper<T> );
}
private:

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,7 @@ QT += core gui
#lessThan(QT_MAJOR_VERSION, 5): QT += declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
DEFINES += QZXING_LIBRARY \
ZXING_ICONV_CONST \
DISABLE_LIBRARY_FEATURES
DEFINES += ZXING_ICONV_CONST
greaterThan(QT_MAJOR_VERSION, 4) {
HEADERS += $$PWD/imagehandler.h

View File

@ -5,20 +5,20 @@
#include "qqtsql.h"
#include "qqtframe.h"
QQTInput* QQTInput::_instance = 0;
QQTInput::QQTInput(QWidget* parent) :
QQtInput* QQtInput::_instance = 0;
QQtInput::QQtInput(QWidget* parent) :
QWidget(parent),
ui(new Ui::frmInput)
ui(new Ui::QQtInput)
{
ui->setupUi(this);
}
QQTInput::~QQTInput()
QQtInput::~QQtInput()
{
delete ui;
}
void QQTInput::Init(QString type, QString position, QString style, int btnFontSize, int labFontSize)
void QQtInput::Init(QString type, QString position, QString style, int btnFontSize, int labFontSize)
{
this->currentPosition = position;
this->currentStyle = style;
@ -34,7 +34,7 @@ void QQTInput::Init(QString type, QString position, QString style, int btnFontSi
this->changePosition();
}
void QQTInput::mouseMoveEvent(QMouseEvent* e)
void QQtInput::mouseMoveEvent(QMouseEvent* e)
{
if (mousePressed && (e->buttons() && Qt::LeftButton))
{
@ -43,7 +43,7 @@ void QQTInput::mouseMoveEvent(QMouseEvent* e)
}
}
void QQTInput::mousePressEvent(QMouseEvent* e)
void QQtInput::mousePressEvent(QMouseEvent* e)
{
if (e->button() == Qt::LeftButton)
{
@ -53,12 +53,12 @@ void QQTInput::mousePressEvent(QMouseEvent* e)
}
}
void QQTInput::mouseReleaseEvent(QMouseEvent*)
void QQtInput::mouseReleaseEvent(QMouseEvent*)
{
mousePressed = false;
}
void QQTInput::InitForm()
void QQtInput::InitForm()
{
this->mousePressed = false;
this->setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
@ -191,7 +191,7 @@ void QQTInput::InitForm()
qApp->installEventFilter(this);
}
void QQTInput::InitProperty()
void QQtInput::InitProperty()
{
ui->btnOther1->setProperty("btnOther", true);
ui->btnOther2->setProperty("btnOther", true);
@ -282,12 +282,12 @@ void QQTInput::InitProperty()
}
}
void QQTInput::ShowPanel()
void QQtInput::ShowPanel()
{
this->setVisible(true);
}
bool QQTInput::checkPress()
bool QQtInput::checkPress()
{
/*
*
@ -304,7 +304,7 @@ bool QQTInput::checkPress()
return false;
}
void QQTInput::reClicked()
void QQtInput::reClicked()
{
if (isPress)
{
@ -313,7 +313,7 @@ void QQTInput::reClicked()
}
}
void QQTInput::btn_clicked()
void QQtInput::btn_clicked()
{
/*
* ,
@ -566,7 +566,7 @@ void QQTInput::btn_clicked()
/*
* ,
*/
bool QQTInput::eventFilter(QObject* obj, QEvent* event)
bool QQtInput::eventFilter(QObject* obj, QEvent* event)
{
//pline() << obj->objectName() << currentEditType << event->type();
if (event->type() == QEvent::MouseButtonPress)
@ -774,7 +774,7 @@ bool QQTInput::eventFilter(QObject* obj, QEvent* event)
return QWidget::eventFilter(obj, event);
}
void QQTInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
void QQtInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
{
currentFocusWidget = nowWidget;
@ -878,7 +878,7 @@ void QQTInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
//pline() << currentEditType;
}
void QQTInput::changeType()
void QQtInput::changeType()
{
/*
* ,currentType这个变量即可
@ -920,7 +920,7 @@ void QQTInput::changeType()
ui->labPY->setText("");
}
void QQTInput::changeLetter(bool isUpper)
void QQtInput::changeLetter(bool isUpper)
{
QList<QPushButton*> btn = this->findChildren<QPushButton*>();
@ -940,7 +940,7 @@ void QQTInput::changeLetter(bool isUpper)
}
}
void QQTInput::selectChinese()
void QQtInput::selectChinese()
{
clearChinese();
QSqlQuery query(m_db);
@ -969,7 +969,7 @@ void QQTInput::selectChinese()
showChinese();
}
void QQTInput::showChinese()
void QQtInput::showChinese()
{
/*
* 10
@ -999,7 +999,7 @@ void QQTInput::showChinese()
qDebug() << "currentPY_index:" << currentPY_index << "currentPY_count:" << currentPY_count;
}
void QQTInput::insertValue(QString value)
void QQtInput::insertValue(QString value)
{
if (currentEditType == "QLineEdit")
{
@ -1024,7 +1024,7 @@ void QQTInput::insertValue(QString value)
}
}
void QQTInput::deleteValue()
void QQtInput::deleteValue()
{
if (currentEditType == "QLineEdit")
{
@ -1085,7 +1085,7 @@ void QQTInput::deleteValue()
}
}
void QQTInput::setChinese(int index)
void QQtInput::setChinese(int index)
{
int count = currentPY.count();
@ -1100,7 +1100,7 @@ void QQTInput::setChinese(int index)
}
}
void QQTInput::clearChinese()
void QQtInput::clearChinese()
{
/*
* ,
@ -1116,7 +1116,7 @@ void QQTInput::clearChinese()
currentPY_count = 0;
}
void QQTInput::changeRect()
void QQtInput::changeRect()
{
QRect geo = geometry();
@ -1133,7 +1133,7 @@ void QQTInput::changeRect()
setGeometry(geo);
}
void QQTInput::changePosition()
void QQtInput::changePosition()
{
/*
* ,currentPosition这个变量即可
@ -1230,7 +1230,7 @@ void QQTInput::changePosition()
}
}
void QQTInput::ChangeStyle()
void QQtInput::ChangeStyle()
{
/*
* ,currentStyle这个变量即可
@ -1276,7 +1276,7 @@ void QQTInput::ChangeStyle()
}
}
void QQTInput::ChangeFont()
void QQtInput::ChangeFont()
{
/*
* ,,
@ -1306,11 +1306,11 @@ void QQTInput::ChangeFont()
ui->btnClose->setFont(labFont);
}
void QQTInput::changeStyle(QString topColor, QString bottomColor, QString borderColor, QString textColor)
void QQtInput::changeStyle(QString topColor, QString bottomColor, QString borderColor, QString textColor)
{
QStringList qss;
qss.append(QString("QWidget#frmInput{background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 %1,stop:1 %2);}")
qss.append(QString("QWidget#QQtInput{background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 %1,stop:1 %2);}")
.arg(topColor).arg(bottomColor));
qss.append(
QString("QWidget#widgetTopPinyin{background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 %1,stop:1 %2);}")

View File

@ -2,6 +2,7 @@
#define FRMINPUT_H
/**
* mod引用 LGPLv2.1
* T.D.R (QQ:2657635903) mod 2015122019:44:04
**/
@ -20,23 +21,23 @@
#include <qqt-local.h>
namespace Ui {
class frmInput;
class QQtInput;
}
class QQTSHARED_EXPORT QQTInput : public QWidget
class QQTSHARED_EXPORT QQtInput : public QWidget
{
Q_OBJECT
explicit QQTInput(QWidget* parent = 0);
~QQTInput();
explicit QQtInput ( QWidget* parent = 0 );
~QQtInput();
public:
/*
* ,
*/
static QQTInput* Instance() {
if (!_instance) {
_instance = new QQTInput;
static QQtInput* Instance() {
if ( !_instance ) {
_instance = new QQtInput;
}
return _instance;
@ -45,31 +46,31 @@ public:
/*
* ,
*/
void Init(QString type, QString position, QString style, int btnFontSize, int labFontSize);
void Init ( QString type, QString position, QString style, int btnFontSize, int labFontSize );
protected:
/*
* ,
*/
bool eventFilter(QObject* obj, QEvent* event);
bool eventFilter ( QObject* obj, QEvent* event );
/*
*
*/
void mouseMoveEvent(QMouseEvent* e);
void mouseMoveEvent ( QMouseEvent* e );
/*
*
*/
void mousePressEvent(QMouseEvent* e);
void mousePressEvent ( QMouseEvent* e );
/*
*
*/
void mouseReleaseEvent(QMouseEvent*);
void mouseReleaseEvent ( QMouseEvent* );
private slots:
/*
*
*/
void focusChanged(QWidget* oldWidget, QWidget* nowWidget);
void focusChanged ( QWidget* oldWidget, QWidget* nowWidget );
/*
*
*/
@ -77,16 +78,16 @@ private slots:
/*
*
*/
void changeStyle(QString topColor, QString bottomColor,
QString borderColor, QString textColor);
void changeStyle ( QString topColor, QString bottomColor,
QString borderColor, QString textColor );
/*
* 退
*/
void reClicked();
private:
Ui::frmInput* ui;
static QQTInput* _instance; //实例对象
Ui::QQtInput* ui;
static QQtInput* _instance; //实例对象
int deskWidth; //桌面宽度
int deskHeight; //桌面高度
@ -125,12 +126,12 @@ private:
QString currentStyle; //当前输入法面板样式
int btnFontSize; //当前输入法面板按钮字体大小
int labFontSize; //当前输入法面板标签字体大小
void insertValue(QString value);//插入值到当前焦点控件
void insertValue ( QString value ); //插入值到当前焦点控件
void deleteValue(); //删除当前焦点控件的一个字符
QString currentType; //当前输入法类型
void changeType(); //改变输入法类型
void changeLetter(bool isUpper);//改变字母大小写
void changeLetter ( bool isUpper ); //改变字母大小写
QList<QLabel*>labCh; //汉字标签数组
QStringList allPY; //所有拼音链表
@ -139,7 +140,7 @@ private:
int currentPY_count; //当前拼音数量
void selectChinese(); //查询汉字
void showChinese(); //显示查询到的汉字
void setChinese(int index); //设置当前汉字
void setChinese ( int index ); //设置当前汉字
void clearChinese(); //清空当前汉字信息
void changeRect();
void changePosition();

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>frmInput</class>
<widget class="QWidget" name="frmInput">
<class>QQtInput</class>
<widget class="QWidget" name="QQtInput">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -2,9 +2,9 @@
#include "ui_qqtmsgbox.h"
#include "qqtcore.h"
QQTMsgBox::QQTMsgBox(QWidget* parent) :
QQtMsgBox::QQtMsgBox(QWidget* parent) :
QQtDialog(parent),
ui(new Ui::QQTMsgBox)
ui(new Ui::QQtMsgBox)
{
ui->setupUi(this);
@ -83,41 +83,41 @@ QQTMsgBox::QQTMsgBox(QWidget* parent) :
}
QQTMsgBox::~QQTMsgBox()
QQtMsgBox::~QQtMsgBox()
{
delete ui;
}
int QQTMsgBox::warning(QWidget* parent, QString content)
int QQtMsgBox::warning(QWidget* parent, QString content)
{
QQTMsgBox* msgBox = new QQTMsgBox(parent);
QQtMsgBox* msgBox = new QQtMsgBox(parent);
return msgBox->_warning(content);
}
int QQTMsgBox::question(QWidget* parent, QString content)
int QQtMsgBox::question(QWidget* parent, QString content)
{
QQTMsgBox* msgBox = new QQTMsgBox(parent);
QQtMsgBox* msgBox = new QQtMsgBox(parent);
return msgBox->_question(content);
}
int QQTMsgBox::_warning(QString content)
int QQtMsgBox::_warning(QString content)
{
ui->lbContent->setText(content);
showYes();;
return exec();
}
int QQTMsgBox::_question(QString content)
int QQtMsgBox::_question(QString content)
{
ui->lbContent->setText(content);
showYesAndNo();
return exec();
}
void QQTMsgBox::showYes()
void QQtMsgBox::showYes()
{
ui->btnYes->setHidden(false);
ui->btnNo->setHidden(true);
@ -126,7 +126,7 @@ void QQTMsgBox::showYes()
ui->btnYes->setGeometry(x0, y0, btnW, btnH);
}
void QQTMsgBox::showYesAndNo()
void QQtMsgBox::showYesAndNo()
{
ui->btnYes->setHidden(false);
ui->btnNo->setHidden(false);
@ -136,7 +136,7 @@ void QQTMsgBox::showYesAndNo()
ui->btnNo->setGeometry(x0 + btnW + x0, y0, btnW, btnH);
}
void QQTMsgBox::showNull()
void QQtMsgBox::showNull()
{
ui->btnYes->setHidden(true);
ui->btnNo->setHidden(true);
@ -147,7 +147,7 @@ void QQTMsgBox::showNull()
void QQTMsgBox::warning(QString content)
void QQtMsgBox::warning(QString content)
{
setAttribute(Qt::WA_DeleteOnClose, false);
ui->lbContent->setText(content);
@ -158,7 +158,7 @@ void QQTMsgBox::warning(QString content)
QQTSleep(delayShow);
}
void QQTMsgBox::question(QString content)
void QQtMsgBox::question(QString content)
{
setAttribute(Qt::WA_DeleteOnClose, false);
ui->lbContent->setText(content);
@ -169,7 +169,7 @@ void QQTMsgBox::question(QString content)
QQTSleep(delayShow);
}
void QQTMsgBox::information(QString content)
void QQtMsgBox::information(QString content)
{
setAttribute(Qt::WA_DeleteOnClose, false);
ui->lbContent->setText(content);
@ -180,7 +180,7 @@ void QQTMsgBox::information(QString content)
QQTSleep(delayShow);
}
void QQTMsgBox::timerEvent(QTimerEvent* e)
void QQtMsgBox::timerEvent(QTimerEvent* e)
{
return;

View File

@ -5,40 +5,40 @@
#include <qqt-local.h>
namespace Ui {
class QQTMsgBox;
class QQtMsgBox;
}
/**
* @brief The QQTMsgBox class
* @brief The QQtMsgBox class
*
*/
class QQTSHARED_EXPORT QQTMsgBox : public QQtDialog
class QQTSHARED_EXPORT QQtMsgBox : public QQtDialog
{
Q_OBJECT
public:
explicit QQTMsgBox(QWidget* parent = 0);
~QQTMsgBox();
explicit QQtMsgBox ( QWidget* parent = 0 );
~QQtMsgBox();
void warning(QString content);
void question(QString content);
void information(QString content);
void warning ( QString content );
void question ( QString content );
void information ( QString content );
/*
*
*/
static int warning(QWidget* parent = 0, QString content = "");
static int warning ( QWidget* parent = 0, QString content = "" );
/*
*
*/
static int question(QWidget* parent = 0, QString content = "");
static int question ( QWidget* parent = 0, QString content = "" );
protected:
int _warning(QString content);
int _question(QString content);
int _warning ( QString content );
int _question ( QString content );
private:
Ui::QQTMsgBox* ui;
Ui::QQtMsgBox* ui;
quint32 m_time;
int delayShow;
@ -58,7 +58,7 @@ private:
// QObject interface
protected:
void timerEvent(QTimerEvent*);
void timerEvent ( QTimerEvent* );
};
#endif // QQTMSGBOX_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QQTMsgBox</class>
<widget class="QQtDialog" name="QQTMsgBox">
<class>QQtMsgBox</class>
<widget class="QQtDialog" name="QQtMsgBox">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -1,9 +1,9 @@
#include "qqtpassworddialog.h"
#include "ui_qqtpassworddialog.h"
QQTPasswordDialog::QQTPasswordDialog(QWidget* parent) :
QQtPasswordDialog::QQtPasswordDialog(QWidget* parent) :
QQtDialog(parent),
ui(new Ui::QQTPasswordDialog)
ui(new Ui::QQtPasswordDialog)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, false);
@ -18,28 +18,28 @@ QQTPasswordDialog::QQTPasswordDialog(QWidget* parent) :
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
QQTPasswordDialog::~QQTPasswordDialog()
QQtPasswordDialog::~QQtPasswordDialog()
{
delete ui;
}
void QQTPasswordDialog::setWifiName(QString name)
void QQtPasswordDialog::setWifiName(QString name)
{
ui->label_ssid_name->setText(name);
}
QString QQTPasswordDialog::wifiPwd()
QString QQtPasswordDialog::wifiPwd()
{
return ui->lineEdit_ssid_password->text();
}
void QQTPasswordDialog::connectClicked()
void QQtPasswordDialog::connectClicked()
{
emit connectClicked(ui->lineEdit_ssid_password->text());
accept();
}
void QQTPasswordDialog::btnEnabled(QString pas)
void QQtPasswordDialog::btnEnabled(QString pas)
{
bool enable = pas.length() < 8 ? false : true;
ui->pushButton_ssid_connect->setEnabled(enable);

View File

@ -5,28 +5,28 @@
#include "qqt-local.h"
namespace Ui {
class QQTPasswordDialog;
class QQtPasswordDialog;
}
class QQTSHARED_EXPORT QQTPasswordDialog : public QQtDialog
class QQTSHARED_EXPORT QQtPasswordDialog : public QQtDialog
{
Q_OBJECT
public:
explicit QQTPasswordDialog(QWidget* parent = 0);
~QQTPasswordDialog();
explicit QQtPasswordDialog ( QWidget* parent = 0 );
~QQtPasswordDialog();
void setWifiName(QString name);
void setWifiName ( QString name );
QString wifiPwd();
signals:
void connectClicked(QString password);
void connectClicked ( QString password );
private slots:
void connectClicked();
void btnEnabled(QString);
void btnEnabled ( QString );
private:
Ui::QQTPasswordDialog* ui;
Ui::QQtPasswordDialog* ui;
};
#endif // QQTPASSWORDDIALOG_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QQTPasswordDialog</class>
<widget class="QQtDialog" name="QQTPasswordDialog">
<class>QQtPasswordDialog</class>
<widget class="QQtDialog" name="QQtPasswordDialog">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -1,9 +1,9 @@
#include "qqtpreviewwidget.h"
#include "ui_qqtpreviewwidget.h"
QQTPreviewWidget::QQTPreviewWidget(QWidget* parent) :
QQtPreviewWidget::QQtPreviewWidget(QWidget* parent) :
QWidget(parent),
ui(new Ui::QQTPreviewWidget)
ui(new Ui::QQtPreviewWidget)
{
ui->setupUi(this);
@ -33,12 +33,12 @@ QQTPreviewWidget::QQTPreviewWidget(QWidget* parent) :
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
}
QQTPreviewWidget::~QQTPreviewWidget()
QQtPreviewWidget::~QQtPreviewWidget()
{
delete ui;
}
int QQTPreviewWidget::play()
int QQtPreviewWidget::play()
{
/*
*
@ -153,7 +153,7 @@ int QQTPreviewWidget::play()
return fd;
}
int QQTPreviewWidget::close()
int QQtPreviewWidget::close()
{
bool ret = false;
@ -190,7 +190,7 @@ int QQTPreviewWidget::close()
}
int QQTPreviewWidget::convert_yuv_to_rgb_pixel(int y, int u, int v)
int QQtPreviewWidget::convert_yuv_to_rgb_pixel(int y, int u, int v)
{
unsigned int pixel32 = 0;
unsigned char* pixel = (unsigned char*)&pixel32;
@ -207,7 +207,7 @@ int QQTPreviewWidget::convert_yuv_to_rgb_pixel(int y, int u, int v)
return pixel32;
}
int QQTPreviewWidget::convert_yuv_to_rgb_buffer(unsigned char* yuv, unsigned char* rgb, unsigned int width,
int QQtPreviewWidget::convert_yuv_to_rgb_buffer(unsigned char* yuv, unsigned char* rgb, unsigned int width,
unsigned int height)
{
unsigned int in, out = 0;
@ -247,7 +247,7 @@ int QQTPreviewWidget::convert_yuv_to_rgb_buffer(unsigned char* yuv, unsigned cha
}
void QQTPreviewWidget::paintEvent(QPaintEvent*)
void QQtPreviewWidget::paintEvent(QPaintEvent*)
{
if (fd <= 0)
return;
@ -287,7 +287,7 @@ void QQTPreviewWidget::paintEvent(QPaintEvent*)
}
void QQTPreviewWidget::mousePressEvent(QMouseEvent* e)
void QQtPreviewWidget::mousePressEvent(QMouseEvent* e)
{
static bool bGInit = false;

View File

@ -21,21 +21,21 @@ extern "C" {
#endif /* __cplusplus */
namespace Ui {
class QQTPreviewWidget;
class QQtPreviewWidget;
}
class QQTSHARED_EXPORT QQTPreviewWidget : public QWidget
class QQTSHARED_EXPORT QQtPreviewWidget : public QWidget
{
Q_OBJECT
public:
explicit QQTPreviewWidget(QWidget* parent = 0);
~QQTPreviewWidget();
explicit QQtPreviewWidget ( QWidget* parent = 0 );
~QQtPreviewWidget();
int play();
int close();
private:
Ui::QQTPreviewWidget* ui;
Ui::QQtPreviewWidget* ui;
struct sensor_info sinfo;
int pre_bpp;
@ -61,13 +61,13 @@ private:
QRect geome;
Qt::WindowFlags flags;
int convert_yuv_to_rgb_pixel(int y, int u, int v);
int convert_yuv_to_rgb_buffer(unsigned char* yuv, unsigned char* rgb, unsigned int width, unsigned int height);
int convert_yuv_to_rgb_pixel ( int y, int u, int v );
int convert_yuv_to_rgb_buffer ( unsigned char* yuv, unsigned char* rgb, unsigned int width, unsigned int height );
// QWidget interface
protected:
void paintEvent(QPaintEvent*);
void mousePressEvent(QMouseEvent* e);
void paintEvent ( QPaintEvent* );
void mousePressEvent ( QMouseEvent* e );
};
#endif // QPREVIEWUI_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QQTPreviewWidget</class>
<widget class="QWidget" name="QQTPreviewWidget">
<class>QQtPreviewWidget</class>
<widget class="QWidget" name="QQtPreviewWidget">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -33,8 +33,8 @@ QQtProgressDialog::QQtProgressDialog(QWidget* parent) :
"./skin/default/bk_progress_chunk.png");
#endif
QQTObjectFactory::registerObject(this);
QQTObjectFactory::registerObject(ui->btnCancel);
QQtObjectFactory::registerObject(this);
QQtObjectFactory::registerObject(ui->btnCancel);
}
QQtProgressDialog::~QQtProgressDialog()

View File

@ -6,7 +6,7 @@
#include "qqtethenetmanager.h"
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
{
#if 0
@ -39,24 +39,24 @@ void QQTWIFIIDTextDelegate::drawCheck(QPainter* painter, const QStyleOptionViewI
#endif
}
void QQTWIFIIDTextDelegate::drawDisplay(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect,
void QQtWiFiIdTextDelegate::drawDisplay(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect,
const QString& text) const
{
if ("COMPLETED" == text)
painter->drawImage(rect, QImage("./skin/default/bk_sel.png"));
}
QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
QQtWiFiWidget::QQtWiFiWidget(QWidget* parent) :
QQTTableView(parent),
ui(new Ui::QQTWIFIWidget)
ui(new Ui::QQtWiFiWidget)
{
ui->setupUi(this);
connect(this, SIGNAL(clicked(QModelIndex)),
this, SLOT(clickWIFI()), Qt::QueuedConnection);
m_pass = new QQTPasswordDialog(this);
m_pass = new QQtPasswordDialog(this);
m_pManager = QQTEthenetManager::Instance(this);
m_pManager = QQtEthenetManager::Instance(this);
connect(m_pManager, SIGNAL(sigRefreshed()), this, SLOT(wifiRefreshed()));
m_model = new QStandardItemModel(this);
@ -75,7 +75,7 @@ QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
#ifdef __EMBEDDED_LINUX__
setFocusPolicy(Qt::NoFocus);
#endif
dg = new QQTWIFIIDTextDelegate(this);
dg = new QQtWiFiIdTextDelegate(this);
setItemDelegateForColumn(ESSID_STATUS, dg);
for (int i = ESSID_TYPE; i < ESSID_MAX; i++)
@ -90,24 +90,24 @@ QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
}
QQTWIFIWidget::~QQTWIFIWidget()
QQtWiFiWidget::~QQtWiFiWidget()
{
delete ui;
}
TWifi QQTWIFIWidget::currentWifi()
TWifi QQtWiFiWidget::currentWifi()
{
return m_pManager->currentWifi();
}
bool QQTWIFIWidget::setCurrentWifi(QString bssid_mac, QString password)
bool QQtWiFiWidget::setCurrentWifi(QString bssid_mac, QString password)
{
return m_pManager->setCurrentWifi(bssid_mac, password);
}
void QQTWIFIWidget::wifiRefreshed()
void QQtWiFiWidget::wifiRefreshed()
{
int row = 0;
m_model->removeRows(row, m_model->rowCount());
@ -128,14 +128,14 @@ void QQTWIFIWidget::wifiRefreshed()
m_model->submit();
}
void QQTWIFIWidget::clickWIFI()
void QQtWiFiWidget::clickWIFI()
{
QString name = m_model->data(m_model->index(currentIndex().row(), ESSID_NAME)).toString();
QString encryt = m_model->data(m_model->index(currentIndex().row(), ESSID_ENCRYP)).toString();
QString type = m_model->data(m_model->index(currentIndex().row(), ESSID_TYPE)).toString();
QString mac = m_model->data(m_model->index(currentIndex().row(), ESSID_BSSID)).toString();
QQTEthenetManager::Instance()->setRefresh(false);
QQtEthenetManager::Instance()->setRefresh(false);
do
{
@ -143,7 +143,7 @@ void QQTWIFIWidget::clickWIFI()
{
m_pass->setWifiName(name);
if (QQTPasswordDialog::Rejected == m_pass->exec())
if (QQtPasswordDialog::Rejected == m_pass->exec())
break;
}
@ -153,13 +153,13 @@ void QQTWIFIWidget::clickWIFI()
if (!ok)
{
QQTMsgBox::warning(this, tr("Password error"));
QQtMsgBox::warning(this, tr("Password error"));
break;
}
pline() << name << encryt << m_pass->wifiPwd();
} while (0);
QQTEthenetManager::Instance()->setRefresh();
QQtEthenetManager::Instance()->setRefresh();
}

View File

@ -10,50 +10,51 @@
#include "qqtcore.h"
#include "qqt-local.h"
class QQTSHARED_EXPORT QQTWIFIIDTextDelegate : public QItemDelegate
class QQTSHARED_EXPORT QQtWiFiIdTextDelegate : public QItemDelegate
{
Q_OBJECT
public:
QQTWIFIIDTextDelegate(QObject* parent = 0): QItemDelegate(parent), parent(parent) { }
QQtWiFiIdTextDelegate ( QObject* parent = 0 ) : QItemDelegate ( parent ), parent ( parent ) { }
private:
QObject* parent;
// QItemDelegate interface
protected:
void drawCheck(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, Qt::CheckState state) const;
void drawCheck ( QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, Qt::CheckState state ) const;
// QItemDelegate interface
protected:
void drawDisplay(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QString& text) const;
void drawDisplay ( QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect,
const QString& text ) const;
};
namespace Ui {
class QQTWIFIWidget;
class QQtWiFiWidget;
}
class QQTWIFIWidget : public QQTTableView
class QQtWiFiWidget : public QQTTableView
{
Q_OBJECT
public:
explicit QQTWIFIWidget(QWidget* parent = 0);
~QQTWIFIWidget();
explicit QQtWiFiWidget ( QWidget* parent = 0 );
~QQtWiFiWidget();
private slots:
void clickWIFI();
void wifiRefreshed();
protected:
TWifi currentWifi();
bool setCurrentWifi(QString bssid_mac, QString password = "");
bool setCurrentWifi ( QString bssid_mac, QString password = "" );
private:
QQTEthenetManager* m_pManager;
QQTWIFIIDTextDelegate* dg;
QQtEthenetManager* m_pManager;
QQtWiFiIdTextDelegate* dg;
private:
Ui::QQTWIFIWidget* ui;
Ui::QQtWiFiWidget* ui;
QStandardItemModel* m_model;
QQTPasswordDialog* m_pass;
QQtPasswordDialog* m_pass;
};
#endif // QQTWIFIWIDGET_H

View File

@ -2,8 +2,8 @@
<author/>
<comment/>
<exportmacro/>
<class>QQTWIFIWidget</class>
<widget name="QQTWIFIWidget" class="QQTTableView">
<class>QQtWiFiWidget</class>
<widget name="QQtWiFiWidget" class="QQTTableView">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -5,16 +5,16 @@
#include "qqtgraphicsitem.h"
#include "qqtword.h"
QQTWord::QQTWord(QObject* parent) :
QQtWord::QQtWord(QObject* parent) :
QObject(parent),
fmt(0), headerFmt(0), titleFmt(0), title2Fmt(0), mainFmt(0)
{
//setup printer
/**
MIPS bug: you must use QQTPrinter(QPrinter::HighResolution)
MIPS bug: you must use QQtPrinter(QPrinter::HighResolution)
Other constructer won't work well
*/
pr = new QQTPrinter(QPrinter::HighResolution);
pr = new QQtPrinter(QPrinter::HighResolution);
pr->setFullPage(true);
pr->setColorMode(QPrinter::Color);
pr->setPaperSize(QPrinter::A4);
@ -97,7 +97,7 @@ QQTWord::QQTWord(QObject* parent) :
initWord();
}
void QQTWord::setMargin(qreal left, qreal right, qreal top, qreal botoom)
void QQtWord::setMargin(qreal left, qreal right, qreal top, qreal botoom)
{
leftMargin = 134.6;
rightMargin = 134.6;
@ -105,21 +105,21 @@ void QQTWord::setMargin(qreal left, qreal right, qreal top, qreal botoom)
bottomMargin = 177.7;
}
QRectF QQTWord::clientRectF()
QRectF QQtWord::clientRectF()
{
return QRectF(leftMargin, topMargin,
sceneRect.width() - leftMargin - rightMargin,
sceneRect.height() - topMargin - bottomMargin);
}
QRectF QQTWord::paperRect()
QRectF QQtWord::paperRect()
{
return QRectF(0, 0,
sceneRect.width(),
sceneRect.height());
}
void QQTWord::setFont(QFont font)
void QQtWord::setFont(QFont font)
{
//normal font 11
m_font = QApplication::font();
@ -130,7 +130,7 @@ void QQTWord::setFont(QFont font)
fmt = new QFontMetrics(m_font);
}
void QQTWord::setLineSpacing(qreal spacing)
void QQtWord::setLineSpacing(qreal spacing)
{
/*
*
@ -146,7 +146,7 @@ void QQTWord::setLineSpacing(qreal spacing)
headerSpacing = headerFmt->height() * 1;
}
void QQTWord::addText(const QString& text, QFont font, Qt::Alignment align, QPointF point)
void QQtWord::addText(const QString& text, QFont font, Qt::Alignment align, QPointF point)
{
QFontMetrics fmt = QFontMetrics(font);
int spacing = fmt.height() * 2;
@ -157,7 +157,7 @@ void QQTWord::addText(const QString& text, QFont font, Qt::Alignment align, QPoi
adjustdy(height + spacing);
QQTGraphicsTextItem* item = pageScene->addText(text, font);
QQtGraphicsTextItem* item = pageScene->addText(text, font);
if (align & Qt::AlignLeft)
item->moveBy(dx, dy + height);
@ -169,7 +169,7 @@ void QQTWord::addText(const QString& text, QFont font, Qt::Alignment align, QPoi
dy += height + spacing;
}
void QQTWord::addSignoffText(const QString& text, QFont font)
void QQtWord::addSignoffText(const QString& text, QFont font)
{
adjustdy(mainHeight + mainSpacing);
@ -182,7 +182,7 @@ void QQTWord::addSignoffText(const QString& text, QFont font)
dy = ddy;
}
void QQTWord::addTable(const QTableView* table, QPointF pos)
void QQtWord::addTable(const QTableView* table, QPointF pos)
{
Q_ASSERT(table);
@ -212,7 +212,7 @@ void QQTWord::addTable(const QTableView* table, QPointF pos)
QString txt = model->headerData(logicalIndex, Qt::Horizontal, Qt::DisplayRole).toString();
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
QQTGraphicsTextItem* item = pageScene->addText(txt, tableFont);
QQtGraphicsTextItem* item = pageScene->addText(txt, tableFont);
item->moveBy(dx, dy);
dx += actColSize;
}
@ -306,7 +306,7 @@ void QQTWord::addTable(const QTableView* table, QPointF pos)
{
QString txt = model->data(model->index(row, logicalIndex)).toString();
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
QQTGraphicsTextItem* item = pageScene->addText(txt, tableFont);
QQtGraphicsTextItem* item = pageScene->addText(txt, tableFont);
item->moveBy(dx, dy);
}
@ -319,9 +319,9 @@ void QQTWord::addTable(const QTableView* table, QPointF pos)
}
}
int QQTWord::pageNum() { return pageSceneVector.size(); }
int QQtWord::pageNum() { return pageSceneVector.size(); }
void QQTWord::exportPdf(const QString& pdf)
void QQtWord::exportPdf(const QString& pdf)
{
// setup printer
pr->setOutputFileName(pdf);
@ -329,7 +329,7 @@ void QQTWord::exportPdf(const QString& pdf)
// print pdf
QPainter p(pr);
QQTGraphicsScene* pageScene = 0;
QQtGraphicsScene* pageScene = 0;
foreach (pageScene, pageSceneVector)
{
@ -341,7 +341,7 @@ void QQTWord::exportPdf(const QString& pdf)
}
}
QQTGraphicsScene* QQTWord::getPage(int num)
QQtGraphicsScene* QQtWord::getPage(int num)
{
if (num < 1 || num > pageSceneVector.size())
return NULL;
@ -349,12 +349,12 @@ QQTGraphicsScene* QQTWord::getPage(int num)
return pageSceneVector.at(num - 1);
}
void QQTWord::print()
void QQtWord::print()
{
pr->print();
}
void QQTWord::setHeaderFont(QFont font)
void QQtWord::setHeaderFont(QFont font)
{
//header font
m_headerFont = QApplication::font();;
@ -366,35 +366,35 @@ void QQTWord::setHeaderFont(QFont font)
headerFmt = new QFontMetrics(m_headerFont);
}
void QQTWord::setHeaderSize(qreal size)
void QQtWord::setHeaderSize(qreal size)
{
headerSize = 70;
}
void QQTWord::setHeaderLine(bool show)
void QQtWord::setHeaderLine(bool show)
{
}
void QQTWord::setHeaderText(const QString& text, QFont font, Qt::Alignment align)
void QQtWord::setHeaderText(const QString& text, QFont font, Qt::Alignment align)
{
headerText = text;
paintPageHeader();
}
void QQTWord::setFooterSize(qreal size)
void QQtWord::setFooterSize(qreal size)
{
footerSize = 70;
}
QFont QQTWord::font() { return m_font; }
QFont QQtWord::font() { return m_font; }
void QQTWord::setFooterLine(bool show)
void QQtWord::setFooterLine(bool show)
{
Q_UNUSED(show)
}
void QQTWord::setFooterText(const QString& text, QFont font, Qt::Alignment align)
void QQtWord::setFooterText(const QString& text, QFont font, Qt::Alignment align)
{
Q_UNUSED(font)
Q_UNUSED(align)
@ -402,11 +402,11 @@ void QQTWord::setFooterText(const QString& text, QFont font, Qt::Alignment align
paintPageFooter();
}
void QQTWord::initWord()
void QQtWord::initWord()
{
while (! pageSceneVector.isEmpty())
{
QQTGraphicsScene* pageScene = pageSceneVector.first();
QQtGraphicsScene* pageScene = pageSceneVector.first();
pageScene->clear();
delete pageScene;
pageSceneVector.remove(0);
@ -417,7 +417,7 @@ void QQTWord::initWord()
createFrame();
}
void QQTWord::adjustdy(qreal dy0)
void QQtWord::adjustdy(qreal dy0)
{
dx = xpos;
@ -428,7 +428,7 @@ void QQTWord::adjustdy(qreal dy0)
}
void QQTWord::createFrame()
void QQtWord::createFrame()
{
xpos = leftMargin;
xpos2 = sceneRect.width() - rightMargin;
@ -437,13 +437,13 @@ void QQTWord::createFrame()
dx = xpos;
dy = ypos;
pageScene = new QQTGraphicsScene(sceneRect);
pageScene = new QQtGraphicsScene(sceneRect);
pageSceneVector.append(pageScene);
paintPageHeader();
paintPageFooter();
}
void QQTWord::paintPageHeader()
void QQtWord::paintPageHeader()
{
// Page header
if (headerText.isEmpty())
@ -454,7 +454,7 @@ void QQTWord::paintPageHeader()
/*
*
*/
QQTGraphicsTextItem* headerItem = pageScene->addText(headerText, m_headerFont);
QQtGraphicsTextItem* headerItem = pageScene->addText(headerText, m_headerFont);
headerItem->moveBy(sx, sy);
//std text
@ -462,7 +462,7 @@ void QQTWord::paintPageHeader()
QString time = QTime::currentTime().toString(QLocale().timeFormat(QLocale::ShortFormat));
QString headerStdText;
headerStdText = date + " " + time;
QQTGraphicsTextItem* item = pageScene->addText(headerStdText, m_headerFont);
QQtGraphicsTextItem* item = pageScene->addText(headerStdText, m_headerFont);
item->moveBy(xpos2 - headerFmt->width(headerStdText), sy);
sy += headerItem->boundingRect().height();
@ -471,7 +471,7 @@ void QQTWord::paintPageHeader()
pageScene->addLine(xpos, sy, xpos2, sy, QPen(Qt::black, 1.0));
}
void QQTWord::paintPageFooter()
void QQtWord::paintPageFooter()
{
if (footerText.isEmpty())
return;
@ -482,18 +482,18 @@ void QQTWord::paintPageFooter()
int sx = xpos;
QString footerStdText = tr("Page") + QString::number(pageSceneVector.size()) + tr(" ");
QQTGraphicsTextItem* item = pageScene->addText(footerStdText, m_headerFont);
QQtGraphicsTextItem* item = pageScene->addText(footerStdText, m_headerFont);
int height = item->boundingRect().height();
int sy = ypos2 + footerSize - height;
item->moveBy(xpos2 - headerFmt->width(footerStdText), sy);
pageScene->addLine(xpos, sy, xpos2, sy, QPen(Qt::black, 1.0));
QQTGraphicsTextItem* footerItem = pageScene->addText(footerText, m_headerFont);
QQtGraphicsTextItem* footerItem = pageScene->addText(footerText, m_headerFont);
footerItem->moveBy(xpos, sy);
}
QHash<int, ESpanFlags> QQTWord::tableSpans(const QTableView* table)
QHash<int, ESpanFlags> QQtWord::tableSpans(const QTableView* table)
{
Q_ASSERT(table);

View File

@ -17,52 +17,52 @@ enum ESpanFlag
ESpanMiddle = 16,
};
Q_DECLARE_FLAGS(ESpanFlags, ESpanFlag)
Q_DECLARE_FLAGS ( ESpanFlags, ESpanFlag )
class QQTSHARED_EXPORT QQTWord : public QObject
class QQTSHARED_EXPORT QQtWord : public QObject
{
Q_OBJECT
public:
explicit QQTWord(QObject* parent = 0);
explicit QQtWord ( QObject* parent = 0 );
void addText(const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter, QPointF point = QPointF(0, 0));
void addSignoffText(const QString& text, QFont m_font = QFont());
void addTable(const QTableView* table, QPointF pos = QPointF(0, 0));
void addText ( const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter, QPointF point = QPointF ( 0, 0 ) );
void addSignoffText ( const QString& text, QFont m_font = QFont() );
void addTable ( const QTableView* table, QPointF pos = QPointF ( 0, 0 ) );
int pageNum();
QQTGraphicsScene* getPage(int num);
void exportPdf(const QString& pdf);
QQtGraphicsScene* getPage ( int num );
void exportPdf ( const QString& pdf );
void print();
QRectF clientRectF();
QRectF paperRect();
void setMargin(qreal left = 0, qreal right = 0,
qreal top = 0, qreal botoom = 0);
void setLineSpacing(qreal mainSpacing = 0);
void setHeaderSize(qreal size = 0);
void setFooterSize(qreal size = 0);
void setMargin ( qreal left = 0, qreal right = 0,
qreal top = 0, qreal botoom = 0 );
void setLineSpacing ( qreal mainSpacing = 0 );
void setHeaderSize ( qreal size = 0 );
void setFooterSize ( qreal size = 0 );
QFont font();
void setFont(QFont m_font = QFont());
void setHeaderFont(QFont m_font = QFont());
void setFont ( QFont m_font = QFont() );
void setHeaderFont ( QFont m_font = QFont() );
QFont mainFont() { return m_mainFont; }
QFont titleFont() { return m_titleFont; }
QFont title2Font() { return m_title2Font; }
QFont headerFont() { return m_headerFont; }
void setHeaderLine(bool show = false);
void setFooterLine(bool show = false);
void setHeaderText(const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter);
void setFooterText(const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter);
void setHeaderLine ( bool show = false );
void setFooterLine ( bool show = false );
void setHeaderText ( const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter );
void setFooterText ( const QString& text, QFont m_font = QFont(),
Qt::Alignment align = Qt::AlignHCenter );
/**
* @brief initWordExpress
*/
void initWord();
protected:
virtual void adjustdy(qreal dy0);
virtual void adjustdy ( qreal dy0 );
virtual void createFrame();
virtual void paintPageHeader();
virtual void paintPageFooter();
@ -75,13 +75,13 @@ private:
/*
*
*/
QQTPrinter* pr;
QQtPrinter* pr;
/*
*
*/
QVector<QQTGraphicsScene*> pageSceneVector;
QQTGraphicsScene* pageScene;
QVector<QQtGraphicsScene*> pageSceneVector;
QQtGraphicsScene* pageScene;
/*
*
@ -147,7 +147,7 @@ private:
QFontMetrics* fmt;
QHash<int, ESpanFlags> tableSpans(const QTableView* table);
QHash<int, ESpanFlags> tableSpans ( const QTableView* table );
};
#endif // QQTWORD_H

View File

@ -52,7 +52,7 @@ bool QQtJsonTreeModel::query ( QString condition )
}
/**
* @brief QQTXmlTreeModel::parseChildElement
* @brief QQtXmlTreeModel::parseChildElement
* @param element
* @param parent
*

View File

@ -3,12 +3,12 @@
#include "qqtcore.h"
#include <QModelIndex>
QQTXmlTreeModel::QQTXmlTreeModel ( QObject* parent ) : QQtTreeModel ( parent )
QQtXmlTreeModel::QQtXmlTreeModel ( QObject* parent ) : QQtTreeModel ( parent )
{
}
void QQTXmlTreeModel::setFilePath ( QString fileName )
void QQtXmlTreeModel::setFilePath ( QString fileName )
{
QFile file ( fileName );
@ -44,7 +44,7 @@ void QQTXmlTreeModel::setFilePath ( QString fileName )
return;
}
bool QQTXmlTreeModel::query ( QString condition )
bool QQtXmlTreeModel::query ( QString condition )
{
Q_UNUSED ( condition )
//TODO:
@ -52,12 +52,12 @@ bool QQTXmlTreeModel::query ( QString condition )
}
/**
* @brief QQTXmlTreeModel::parseChildElement
* @brief QQtXmlTreeModel::parseChildElement
* @param element
* @param parent
*
*/
void QQTXmlTreeModel::parseChildElement ( const QDomElement& element, QStandardItem* itemParent )
void QQtXmlTreeModel::parseChildElement ( const QDomElement& element, QStandardItem* itemParent )
{
/**
* @brief element name

View File

@ -5,11 +5,11 @@
#include <QDomDocument>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTXmlTreeModel : public QQtTreeModel
class QQTSHARED_EXPORT QQtXmlTreeModel : public QQtTreeModel
{
Q_OBJECT
public:
explicit QQTXmlTreeModel ( QObject* parent = 0 );
explicit QQtXmlTreeModel ( QObject* parent = 0 );
signals:

View File

@ -1,13 +1,13 @@
#include "qqtmplayer.h"
#include "qqtcore.h"
QQTPlayer::QQTPlayer(QObject* parent) :
QQtPlayer::QQtPlayer(QObject* parent) :
QObject(parent)
{
app = new QProcess(this);
}
void QQTPlayer::play(QString filename, int wid, int width, int height)
void QQtPlayer::play(QString filename, int wid, int width, int height)
{
QString mppath = "mplayer";
QStringList mpargs;
@ -32,14 +32,14 @@ void QQTPlayer::play(QString filename, int wid, int width, int height)
pline() << "mpp start success :)";
}
void QQTPlayer::pause()
void QQtPlayer::pause()
{
char buf[256] = {0};
sprintf(buf, "pause\n");
app->write(buf);
}
void QQTPlayer::stop()
void QQtPlayer::stop()
{
char buf[256] = {0};
sprintf(buf, "stop\n");
@ -48,7 +48,7 @@ void QQTPlayer::stop()
app->write(buf);
}
double QQTPlayer::timeLength()
double QQtPlayer::timeLength()
{
char buf[256] = {0};
sprintf(buf, "get_time_length\n");
@ -60,7 +60,7 @@ double QQTPlayer::timeLength()
return length;
}
double QQTPlayer::timePos()
double QQtPlayer::timePos()
{
char buf[256] = {0};
sprintf(buf, "get_time_pos\n");
@ -72,7 +72,7 @@ double QQTPlayer::timePos()
return pos;
}
int QQTPlayer::percent()
int QQtPlayer::percent()
{
char buf[256] = {0};
sprintf(buf, "get_percent\n");
@ -84,28 +84,28 @@ int QQTPlayer::percent()
return pos;
}
void QQTPlayer::seekPos(double second)
void QQtPlayer::seekPos(double second)
{
char buf[256] = {0};
sprintf(buf, "seek %lf\n", second);
app->write(buf);
}
void QQTPlayer::setVolume(int v)
void QQtPlayer::setVolume(int v)
{
char buf[256] = {0};
sprintf(buf, "volume %d 1\n", v);
app->write(buf);
}
void QQTPlayer::mute(bool m)
void QQtPlayer::mute(bool m)
{
char buf[256] = {0};
sprintf(buf, "mute %d\n", m);
app->write(buf);
}
void QQTPlayer::setRect(int x, int y, int width, int height)
void QQtPlayer::setRect(int x, int y, int width, int height)
{
char buf[256] = {0};
sprintf(buf, "change_rectangle 0 %d \n", width);

View File

@ -4,22 +4,22 @@
#include <QProcess>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTPlayer : public QObject
class QQTSHARED_EXPORT QQtPlayer : public QObject
{
Q_OBJECT
public:
explicit QQTPlayer(QObject* parent = 0);
explicit QQtPlayer ( QObject* parent = 0 );
void play(QString filename, int wid = 0, int width = 20, int height = 20);
void play ( QString filename, int wid = 0, int width = 20, int height = 20 );
void pause();
void stop();
double timeLength();
double timePos();
int percent();
void seekPos(double second = 0);
void setVolume(int v = 100);
void mute(bool m = false);
void setRect(int x, int y, int width, int height);
void seekPos ( double second = 0 );
void setVolume ( int v = 100 );
void mute ( bool m = false );
void setRect ( int x, int y, int width, int height );
signals:

View File

@ -7,7 +7,7 @@
#include "qqtcore.h"
#include "qqt.h"
QQTClient::QQTClient ( QObject* parent ) :
QQtClient::QQtClient ( QObject* parent ) :
QTcpSocket ( parent )
{
connect ( this, SIGNAL ( stateChanged ( QAbstractSocket::SocketState ) ), this,
@ -44,11 +44,11 @@ QQTClient::QQTClient ( QObject* parent ) :
m_protocol = NULL;
}
QQTClient::~QQTClient()
QQtClient::~QQtClient()
{
}
void QQTClient::installProtocol ( QQtProtocol* stack )
void QQtClient::installProtocol ( QQtProtocol* stack )
{
if ( m_protocol )
return;
@ -58,7 +58,7 @@ void QQTClient::installProtocol ( QQtProtocol* stack )
this, SLOT ( write ( const QByteArray& ) ) );
}
void QQTClient::uninstallProtocol ( QQtProtocol* stack )
void QQtClient::uninstallProtocol ( QQtProtocol* stack )
{
Q_UNUSED ( stack )
@ -70,12 +70,12 @@ void QQTClient::uninstallProtocol ( QQtProtocol* stack )
m_protocol = NULL;
}
QQtProtocol* QQTClient::installedProtocol()
QQtProtocol* QQtClient::installedProtocol()
{
return m_protocol;
}
void QQTClient::SendConnectMessage()
void QQtClient::SendConnectMessage()
{
pline() << isValid() << isOpen() << state();
@ -99,7 +99,7 @@ void QQTClient::SendConnectMessage()
}
int QQTClient::SendDisConnectFromHost()
int QQtClient::SendDisConnectFromHost()
{
pline() << isValid() << isOpen() << state();
@ -119,17 +119,17 @@ int QQTClient::SendDisConnectFromHost()
return true;
}
void QQTClient::domainHostFound()
void QQtClient::domainHostFound()
{
pline();
}
/**
* @brief QQTClient::socketStateChanged
* @brief QQtClient::socketStateChanged
* @param eSocketState
*
*/
void QQTClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
void QQtClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
{
pline() << eSocketState;
@ -155,11 +155,11 @@ void QQTClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
}
/**
* @brief QQTClient::socketErrorOccured
* @brief QQtClient::socketErrorOccured
* @param e
*
*/
void QQTClient::socketErrorOccured ( QAbstractSocket::SocketError e )
void QQtClient::socketErrorOccured ( QAbstractSocket::SocketError e )
{
/*
*
@ -179,10 +179,10 @@ void QQTClient::socketErrorOccured ( QAbstractSocket::SocketError e )
}
/**
* @brief QQTClient::socketConnected
* @brief QQtClient::socketConnected
*
*/
void QQTClient::socketConnected()
void QQtClient::socketConnected()
{
pline() << peerName() << peerAddress().toString() << peerPort();
/*
@ -192,21 +192,21 @@ void QQTClient::socketConnected()
}
/**
* @brief QQTClient::socketDisconnect
* @brief QQtClient::socketDisconnect
*
*/
void QQTClient::socketDisconnect()
void QQtClient::socketDisconnect()
{
pline();
}
void QQTClient::updateProgress ( qint64 bytes )
void QQtClient::updateProgress ( qint64 bytes )
{
Q_UNUSED ( bytes )
//pline() << bytes;
}
void QQTClient::connectToSingelHost()
void QQtClient::connectToSingelHost()
{
int contype = eConType % m_serverIP.size();
QString ip = m_serverIP.at ( contype );
@ -216,7 +216,7 @@ void QQTClient::connectToSingelHost()
}
void QQTClient::readyReadData()
void QQtClient::readyReadData()
{
QByteArray bytes;
bytes = readAll();

View File

@ -1,6 +1,6 @@
/**************************************************
* QQTClient
* QQTClient实现
* QQtClient
* QQtClient实现
**************************************************/
#ifndef QQT_CLIENT_H
#define QQT_CLIENT_H
@ -20,18 +20,18 @@
/**
* @brief ;
*/
class QQTSHARED_EXPORT QQTClient : public QTcpSocket
class QQTSHARED_EXPORT QQtClient : public QTcpSocket
{
Q_OBJECT
public:
explicit QQTClient(QObject* parent = 0);
virtual ~QQTClient();
explicit QQtClient ( QObject* parent = 0 );
virtual ~QQtClient();
void SetServerIPAddress(QStringList ip) { m_serverIP = ip; }
void SetServerPort(quint32 p = 7079) { m_PORT = p; }
void SetServerIPAddress ( QStringList ip ) { m_serverIP = ip; }
void SetServerPort ( quint32 p = 7079 ) { m_PORT = p; }
void installProtocol(QQtProtocol* stack);
void uninstallProtocol(QQtProtocol* stack);
void installProtocol ( QQtProtocol* stack );
void uninstallProtocol ( QQtProtocol* stack );
QQtProtocol* installedProtocol();
void SendConnectMessage();
@ -43,16 +43,16 @@ signals:
void signalConnectFail();//
void signalDisConnectSucc();//maybe
void signalDisConnectFail();//
void signalUpdateProgress(qint64 value);
void signalUpdateProgress ( qint64 value );
private slots:
void domainHostFound();
void socketStateChanged(QAbstractSocket::SocketState);
void socketErrorOccured(QAbstractSocket::SocketError);
void socketStateChanged ( QAbstractSocket::SocketState );
void socketErrorOccured ( QAbstractSocket::SocketError );
void socketConnected();
void socketDisconnect();
void updateProgress(qint64);
void updateProgress ( qint64 );
protected slots:
void readyReadData();

View File

@ -3,18 +3,18 @@
#include "qqtcore.h"
#include "qqt-qt.h"
QQTEthenetManager* QQTEthenetManager::_instance = NULL;
QQtEthenetManager* QQtEthenetManager::_instance = NULL;
QQTEthenetManager* QQTEthenetManager::Instance(QObject* parent)
QQtEthenetManager* QQtEthenetManager::Instance(QObject* parent)
{
if (_instance)
return _instance;
_instance = new QQTEthenetManager(parent);
_instance = new QQtEthenetManager(parent);
return _instance;
}
bool QQTEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
bool QQtEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
{
for (QList<TWifi>::Iterator it = m_wifiList.begin();
it != m_wifiList.end(); it++)
@ -38,13 +38,13 @@ bool QQTEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
return true;
}
void QQTEthenetManager::ipconfig()
void QQtEthenetManager::ipconfig()
{
saveScript();
config();
}
QString QQTEthenetManager::currentNetName()
QString QQtEthenetManager::currentNetName()
{
if ("eth0" == m_netName)
return "Wired Lan";
@ -56,7 +56,7 @@ QString QQTEthenetManager::currentNetName()
return "";
}
void QQTEthenetManager::readStatus()
void QQtEthenetManager::readStatus()
{
/*
* status
@ -99,7 +99,7 @@ void QQTEthenetManager::readStatus()
return;
}
void QQTEthenetManager::refreshWifiList()
void QQtEthenetManager::refreshWifiList()
{
static int scanid = 0;
@ -162,7 +162,7 @@ void QQTEthenetManager::refreshWifiList()
emit sigRefreshed();
}
void QQTEthenetManager::refreshWifiStatus()
void QQtEthenetManager::refreshWifiStatus()
{
readStatus();
@ -188,7 +188,7 @@ void QQTEthenetManager::refreshWifiStatus()
emit sigDisConnected();
}
void QQTEthenetManager::checkLanConnection()
void QQtEthenetManager::checkLanConnection()
{
char cmdbuf[MAX_PATH];
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
@ -219,7 +219,7 @@ void QQTEthenetManager::checkLanConnection()
return;
}
void QQTEthenetManager::DhcpPassed(QString netname)
void QQtEthenetManager::DhcpPassed(QString netname)
{
int sockfd;
struct ifreq ifr;
@ -291,20 +291,20 @@ void QQTEthenetManager::DhcpPassed(QString netname)
saveScript();
}
void QQTEthenetManager::checkNetworkClear()
void QQtEthenetManager::checkNetworkClear()
{
return;
m_clearThread->start();
}
QQTEthenetManager::QQTEthenetManager(QObject* parent) :
QQtEthenetManager::QQtEthenetManager(QObject* parent) :
QObject(parent)
{
m_bUseDHCP = false;
m_clearThread = new QQTNetworkClearThread(this);
m_clearThread = new QQtNetWorkClearThread(this);
connect(m_clearThread, SIGNAL(cleared()), this, SIGNAL(sigNetworkClear()));
connect(m_clearThread, SIGNAL(notcleared()), this, SIGNAL(sigNetworkNotClear()));
m_thread = new QQTDhcpThread(this);
m_thread = new QQtDHCPThread(this);
connect(m_thread, SIGNAL(passed(QString)), this, SLOT(DhcpPassed(QString)));
/*
* 线
@ -326,7 +326,7 @@ QQTEthenetManager::QQTEthenetManager(QObject* parent) :
#endif
}
void QQTEthenetManager::restoreWifi()
void QQtEthenetManager::restoreWifi()
{
QString name = m_curWifi[ESSID_NAME];
QString password = m_curWifi[ESSID_PASS];
@ -380,7 +380,7 @@ void QQTEthenetManager::restoreWifi()
fclose(fp);
}
bool QQTEthenetManager::restartWifi()
bool QQtEthenetManager::restartWifi()
{
char cmdbuf[MAX_PATH];
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
@ -397,7 +397,7 @@ bool QQTEthenetManager::restartWifi()
return true;
}
void QQTEthenetManager::saveScript()
void QQtEthenetManager::saveScript()
{
QString ip, mask, gw, dns;
getAddr(ip, mask, gw, dns);
@ -445,7 +445,7 @@ void QQTEthenetManager::saveScript()
system(cmdbuf);
}
void QQTEthenetManager::config()
void QQtEthenetManager::config()
{
char cmdbuf[MAX_PATH];
bzero(cmdbuf, MAX_PATH);
@ -507,7 +507,7 @@ void QQTEthenetManager::config()
system(cmdbuf);
}
void QQTEthenetManager::setAddr(QString ip, QString mask, QString gw, QString dns)
void QQtEthenetManager::setAddr(QString ip, QString mask, QString gw, QString dns)
{
QSettings netSet;
netSet.setValue("/Network/IP", ip);
@ -517,7 +517,7 @@ void QQTEthenetManager::setAddr(QString ip, QString mask, QString gw, QString dn
netSet.sync();
}
void QQTEthenetManager::getAddr(QString& ip, QString& mask, QString& gw, QString& dns)
void QQtEthenetManager::getAddr(QString& ip, QString& mask, QString& gw, QString& dns)
{
QSettings netSet;
ip = netSet.value("/Network/IP").toString();
@ -526,7 +526,7 @@ void QQTEthenetManager::getAddr(QString& ip, QString& mask, QString& gw, QString
dns = netSet.value("/Network/DNS").toString();
}
void QQTDhcpThread::run()
void QQtDHCPThread::run()
{
char cmdbuf[MAX_PATH];
bzero(cmdbuf, MAX_PATH);
@ -536,7 +536,7 @@ void QQTDhcpThread::run()
}
void QQTNetworkClearThread::run()
void QQtNetWorkClearThread::run()
{
static bool _bclear = false;
bool bclear = false;

View File

@ -8,11 +8,11 @@
#include "qqtcore.h"
#include "qqt-local.h"
class QQTSHARED_EXPORT QQTNetworkClearThread : public QThread
class QQTSHARED_EXPORT QQtNetWorkClearThread : public QThread
{
Q_OBJECT
public:
QQTNetworkClearThread(QObject* parent = 0) : QThread(parent) {
QQtNetWorkClearThread ( QObject* parent = 0 ) : QThread ( parent ) {
}
signals:
void cleared();
@ -23,15 +23,15 @@ protected:
void run();
};
class QQTSHARED_EXPORT QQTDhcpThread : public QThread
class QQTSHARED_EXPORT QQtDHCPThread : public QThread
{
Q_OBJECT
public:
QQTDhcpThread(QObject* parent = 0) : QThread(parent) {
QQtDHCPThread ( QObject* parent = 0 ) : QThread ( parent ) {
}
void setnet(QString eth = "eth0") {net = eth;}
void setnet ( QString eth = "eth0" ) {net = eth;}
signals:
void passed(QString);
void passed ( QString );
// QThread interface
protected:
void run();
@ -40,19 +40,19 @@ private:
};
// thread unsafe
class QQTSHARED_EXPORT QQTEthenetManager : public QObject
class QQTSHARED_EXPORT QQtEthenetManager : public QObject
{
Q_OBJECT
public:
static QQTEthenetManager* Instance(QObject* parent = 0);
static QQtEthenetManager* Instance ( QObject* parent = 0 );
QList<TWifi>& wifiList() { return m_wifiList; }
inline TWifi currentWifi() { return m_curWifi; }
bool setCurrentWifi(QString bssid_mac, QString password = "");
void setRefresh(bool ref = true) { ref ? m_workTimer->start(5000) : m_workTimer->stop(); }
void setDHCP(bool bUse = false) { m_bUseDHCP = bUse; }
void setAddr(QString ip, QString mask, QString gw, QString dns);
void getAddr(QString& ip, QString& mask, QString& gw, QString& dns);
bool setCurrentWifi ( QString bssid_mac, QString password = "" );
void setRefresh ( bool ref = true ) { ref ? m_workTimer->start ( 5000 ) : m_workTimer->stop(); }
void setDHCP ( bool bUse = false ) { m_bUseDHCP = bUse; }
void setAddr ( QString ip, QString mask, QString gw, QString dns );
void getAddr ( QString& ip, QString& mask, QString& gw, QString& dns );
/**
* @brief configIPAddress
* wpa_suplicant.conf
@ -87,7 +87,7 @@ signals:
/*
* Wifi状态改变
*/
void sigStatusChanged(QString status);
void sigStatusChanged ( QString status );
/*
* 线
*/
@ -109,11 +109,11 @@ private slots:
void refreshWifiList();
void refreshWifiStatus();
void checkLanConnection();
void DhcpPassed(QString netname);
void DhcpPassed ( QString netname );
void checkNetworkClear();
private:
explicit QQTEthenetManager(QObject* parent = 0);
explicit QQtEthenetManager ( QObject* parent = 0 );
void readStatus();
void restoreWifi();
bool restartWifi();
@ -124,14 +124,14 @@ signals:
public slots:
private:
static QQTEthenetManager* _instance;
static QQtEthenetManager* _instance;
QTimer* m_workTimer;
QList<TWifi> m_wifiList;
TWifi m_curWifi;
bool m_bUseDHCP;
QString m_netName;
QQTDhcpThread* m_thread;
QQTNetworkClearThread* m_clearThread;
QQtDHCPThread* m_thread;
QQtNetWorkClearThread* m_clearThread;
QString m_status;
};

View File

@ -2,25 +2,25 @@
#include "qqtnetwork.h"
QQTServer::QQTServer(QObject* parent) :
QQtServer::QQtServer(QObject* parent) :
QTcpServer(parent)
{
}
QQTServer::~QQTServer()
QQtServer::~QQtServer()
{
close();
}
void QQTServer::incomingConnection(qintptr handle)
void QQtServer::incomingConnection(qintptr handle)
{
QQTClient* clientSocket = new QQTClient(this);
QQtClient* clientSocket = new QQtClient(this);
clientSocket->setSocketDescriptor(handle);
connect(clientSocket, SIGNAL(disconnected()), clientSocket, SLOT(deleteLater()));
clientSocket->installProtocol(m_protocol);
}
void QQTServer::installProtocol(QQtProtocol* stack)
void QQtServer::installProtocol(QQtProtocol* stack)
{
if (m_protocol)
return;
@ -28,7 +28,7 @@ void QQTServer::installProtocol(QQtProtocol* stack)
m_protocol = stack;
}
void QQTServer::uninstallProtocol(QQtProtocol* stack)
void QQtServer::uninstallProtocol(QQtProtocol* stack)
{
Q_UNUSED(stack)
@ -38,7 +38,7 @@ void QQTServer::uninstallProtocol(QQtProtocol* stack)
m_protocol = NULL;
}
QQtProtocol* QQTServer::installedProtocol()
QQtProtocol* QQtServer::installedProtocol()
{
return m_protocol;
}

View File

@ -7,21 +7,21 @@
#include "qqt-local.h"
#include "qqtcore.h"
class QQTSHARED_EXPORT QQTServer : public QTcpServer
class QQTSHARED_EXPORT QQtServer : public QTcpServer
{
Q_OBJECT
public:
explicit QQTServer(QObject* parent = 0);
~QQTServer();
explicit QQtServer ( QObject* parent = 0 );
~QQtServer();
void installProtocol(QQtProtocol* stack);
void uninstallProtocol(QQtProtocol* stack);
void installProtocol ( QQtProtocol* stack );
void uninstallProtocol ( QQtProtocol* stack );
QQtProtocol* installedProtocol();
signals:
// QTcpServer interface
protected:
virtual void incomingConnection(qintptr handle) override;
virtual void incomingConnection ( qintptr handle ) override;
private:
QQtProtocol* m_protocol;
};

View File

@ -6,8 +6,8 @@
#include <QMouseDriverFactory>
#endif
QQTPluginWatcher* QQTPluginWatcher::_instance = NULL;
QQTPluginWatcher::QQTPluginWatcher(QObject* parent) :
QQtPluginWatcher* QQtPluginWatcher::_instance = NULL;
QQtPluginWatcher::QQtPluginWatcher(QObject* parent) :
QThread(parent)
{
m_devType = E_NULLDEV;
@ -31,16 +31,16 @@ QQTPluginWatcher::QQTPluginWatcher(QObject* parent) :
watcher->start();
}
QQTPluginWatcher* QQTPluginWatcher::Instance()
QQtPluginWatcher* QQtPluginWatcher::Instance()
{
if (_instance)
return _instance;
_instance = new QQTPluginWatcher();
_instance = new QQtPluginWatcher();
return _instance;
}
void QQTPluginWatcher::slotDeviceAdded(const QString& dev)
void QQtPluginWatcher::slotDeviceAdded(const QString& dev)
{
qDebug("tid=%#llx %s: add %s", (quintptr)QThread::currentThreadId(), __PRETTY_FUNCTION__, qPrintable(dev));
@ -55,19 +55,19 @@ void QQTPluginWatcher::slotDeviceAdded(const QString& dev)
timer->start(1000);
}
void QQTPluginWatcher::slotDeviceRemoved(const QString& dev)
void QQtPluginWatcher::slotDeviceRemoved(const QString& dev)
{
qDebug("tid=%#llx %s: remove %s", (quintptr)QThread::currentThreadId(), __PRETTY_FUNCTION__, qPrintable(dev));
m_devStat = E_RM;
timer->start(1000);
}
void QQTPluginWatcher::slotDeviceChanged(const QString& dev)
void QQtPluginWatcher::slotDeviceChanged(const QString& dev)
{
qDebug("tid=%#llx %s: change %s", (quintptr)QThread::currentThreadId(), __PRETTY_FUNCTION__, qPrintable(dev));
}
void QQTPluginWatcher::slotDeviceDriver()
void QQtPluginWatcher::slotDeviceDriver()
{
#ifdef __EMBEDDED_LINUX__
@ -91,7 +91,7 @@ void QQTPluginWatcher::slotDeviceDriver()
return;
}
bool QQTPluginWatcher::event(QEvent* e)
bool QQtPluginWatcher::event(QEvent* e)
{
if (e->type() == QDeviceChangeEvent::registeredType())
{

View File

@ -30,11 +30,11 @@
#define __PRETTY_FUNCTION__ __FUNCTION__
#endif
class QQTSHARED_EXPORT QQTPluginWatcher : public QThread
class QQTSHARED_EXPORT QQtPluginWatcher : public QThread
{
Q_OBJECT
public:
static QQTPluginWatcher* Instance();
static QQtPluginWatcher* Instance();
enum
{
@ -60,23 +60,23 @@ public:
QString printerFile() { return "/dev/usb/lp0"; }
signals:
void storageChanged(int stat);
void storageChanged ( int stat );
public slots:
void slotDeviceAdded(const QString& dev);
void slotDeviceRemoved(const QString& dev);
void slotDeviceChanged(const QString& dev);
void slotDeviceAdded ( const QString& dev );
void slotDeviceRemoved ( const QString& dev );
void slotDeviceChanged ( const QString& dev );
void slotDeviceDriver();
protected:
virtual bool event(QEvent* e);
virtual bool event ( QEvent* e );
private:
private:
QDeviceWatcher* watcher;
explicit QQTPluginWatcher(QObject* parent = 0);
static QQTPluginWatcher* _instance;
explicit QQtPluginWatcher ( QObject* parent = 0 );
static QQtPluginWatcher* _instance;
quint32 m_devType;
quint32 m_devStat;
QString m_storage;

View File

@ -1,19 +1,19 @@
#include "qqtprinter.h"
#include "stdlib.h"
QQTPrinter::QQTPrinter(QPrinter::PrinterMode mode) :
QQtPrinter::QQtPrinter(QPrinter::PrinterMode mode) :
QPrinter(mode)
{
}
void QQTPrinter::setOutputFileName(const QString& name)
void QQtPrinter::setOutputFileName(const QString& name)
{
m_outputname = name;
QPrinter::setOutputFileName(m_outputname);
}
void QQTPrinter::print()
void QQtPrinter::print()
{
/*
*

View File

@ -4,12 +4,12 @@
#include <QPrinter>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTPrinter : public QPrinter
class QQTSHARED_EXPORT QQtPrinter : public QPrinter
{
public:
QQTPrinter(PrinterMode mode = HighResolution);
QQtPrinter ( PrinterMode mode = HighResolution );
void setOutputFileName(const QString&);
void setOutputFileName ( const QString& );
void print();
private:

View File

@ -16,6 +16,7 @@ contains (DEFINES, __EXQUISITE__) {
#DEFINES += __QRDECODE__
contains (DEFINES, __QRDECODE__) {
contains(QKIT_PRIVATE, WIN32|WIN64) {
#ignore: QZXing has no need to export
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QZXING_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {

View File

@ -143,16 +143,13 @@ equals(QT_VERSION, 5.9.1) {
}
}
#Qt 5.9.2, android support this feature
#Qt 5.9.2, ios can't use printsupport, but Qt Charts work well, it don't use QPrinter.
#Qt 5.9.2, ios can't use printsupport
contains(QKIT_PRIVATE, iOS||iOSSimulator) {
DEFINES -= __PRINTSUPPORT__
}
contains (DEFINES, __PRINTSUPPORT__) {
#qtHaveModule(printsupport) : message(qqt use module printsupport)
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
#if you use qcustomplot, open this annotation
#qcustomplot use QPrinter to export png file.
DEFINES += __CUSTOMPLOT__
}
##################Exquisite Module###############################
@ -181,7 +178,7 @@ contains (DEFINES, __EXQUISITE__) {
##################WebSocket Module###############################
#don't close this macro ...
DEFINES += __TCPUDPSOCKET__
#if you use Qt Service Spoort ( QtSoap ), open this annotation
#if you use Qt Service Support ( QtSoap ), open this annotation
DEFINES += __WEBSERVICESUPPORT__
#One Ftp Http 单工...
#Multi 半双工(客户端并发,服务器序列) QNetworkAccessManager
@ -203,6 +200,18 @@ contains (DEFINES, __WEBSOCKETSUPPORT__) {
#TODO: QT += webkit
}
##################Charts Module###############################
#if you use QQtCharts, open this annotation
DEFINES += __QQTCHARTS__
#based on QtCharts, need charts module
contains(DEFINES, __QQTCHARTS__) {
QT += charts
}
#if you use qcustomplot, open this annotation
#qcustomplot use QPrinter to export pdf file, QChart haven't use it, but compiler ok.
#in ios qcustomplot can't call savePdf now, no result but a log no printer error.
DEFINES += __CUSTOMPLOT__
##################################################################
##library
##################################################################
@ -245,6 +254,7 @@ INCLUDEPATH += $$PWD/pluginwatcher
INCLUDEPATH += $$PWD/printsupport
INCLUDEPATH += $$PWD/sql
INCLUDEPATH += $$PWD/widgets
INCLUDEPATH += $$PWD/charts
#exquisite widget
INCLUDEPATH += $$PWD/exquisite

View File

@ -14,7 +14,32 @@
#-------------------------------------------------
SOURCES +=
HEADERS +=
contains(DEFINES, __QQTCHARTS__) {
SOURCES += \
$$PWD/charts/qqtchart.cpp \
$$PWD/charts/qqtchartview.cpp
HEADERS += \
$$PWD/charts/qqtchart.h \
$$PWD/charts/qqtchartview.h
}
#customplot
#DEFINES += __CUSTOMPLOT__
contains (DEFINES, __CUSTOMPLOT__) {
#message (qcustomplot is used in $${TARGET})
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
#build static library - customplot
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
}
}
SOURCES += $$PWD/customplot/qcpdocumentobject.cpp \
$$PWD/customplot/qcustomplot.cpp
HEADERS += $$PWD/customplot/qcpdocumentobject.h \
$$PWD/customplot/qcustomplot.h
}
#root dir
HEADERS += $$PWD/qqt.h \
@ -169,24 +194,6 @@ contains (DEFINES, __PRINTSUPPORT__) {
HEADERS += \
$$PWD/frame/qqtword.h
#customplot
#need print support
#DEFINES += __CUSTOMPLOT__
contains (DEFINES, __CUSTOMPLOT__) {
#message (qcustomplot is used in $${TARGET})
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
#build static library - customplot
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
}
}
SOURCES += $$PWD/customplot/qcpdocumentobject.cpp \
$$PWD/customplot/qcustomplot.cpp
HEADERS += $$PWD/customplot/qcpdocumentobject.h \
$$PWD/customplot/qcustomplot.h
}
}
#network

View File

@ -57,11 +57,11 @@ QQtApplication::QQtApplication(int& argc, char** argv) :
#ifdef __EMBEDDED_LINUX__
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
#ifdef __PLUGINWATCHER__
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
#endif
}
@ -99,15 +99,15 @@ void QQtApplication::slotUPanAutoRun(int status)
#ifdef __PLUGINWATCHER__
if (QQTPluginWatcher::E_ADD == status)
if (QQtPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
QString mP = QQtPluginWatcher::Instance()->upanMountPath();
QString app = QString("%1/autorun.sh").arg(mP);
QFile file(app);
if (file.exists())
{
if (QDialog::Rejected == QQTMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
if (QDialog::Rejected == QQtMsgBox::question(0, tr("Some app want to run in u disk!accepted?")))
{
return;
}

View File

@ -3,40 +3,40 @@
#include <QStyleOptionGraphicsItem>
#include "qqtcore.h"
QQTGraphicsItem::QQTGraphicsItem(QQTGraphicsItem* parent) : QGraphicsItem(parent) {}
QQtGraphicsItem::QQtGraphicsItem(QQtGraphicsItem* parent) : QGraphicsItem(parent) {}
QQTGraphicsTextItem::QQTGraphicsTextItem(QQTGraphicsItem* parent) : QGraphicsTextItem(parent) {}
QQtGraphicsTextItem::QQtGraphicsTextItem(QQtGraphicsItem* parent) : QGraphicsTextItem(parent) {}
QQTGraphicsRectItem::QQTGraphicsRectItem(QQTGraphicsItem* parent) : QGraphicsRectItem(parent) {}
QQtGraphicsRectItem::QQtGraphicsRectItem(QQtGraphicsItem* parent) : QGraphicsRectItem(parent) {}
QQTGraphicsSimpleTextItem::QQTGraphicsSimpleTextItem(QQTGraphicsItem* parent) : QGraphicsSimpleTextItem(parent) {}
QQtGraphicsSimpleTextItem::QQtGraphicsSimpleTextItem(QQtGraphicsItem* parent) : QGraphicsSimpleTextItem(parent) {}
QQTGraphicsLineItem::QQTGraphicsLineItem(QQTGraphicsItem* parent) : QGraphicsLineItem(parent) {}
QQtGraphicsLineItem::QQtGraphicsLineItem(QQtGraphicsItem* parent) : QGraphicsLineItem(parent) {}
QQTGraphicsPixmapItem::QQTGraphicsPixmapItem(QQTGraphicsItem* parent) : QGraphicsPixmapItem(parent) {}
QQtGraphicsPixmapItem::QQtGraphicsPixmapItem(QQtGraphicsItem* parent) : QGraphicsPixmapItem(parent) {}
QQTGraphicsPathItem::QQTGraphicsPathItem(QQTGraphicsItem* parent) : QGraphicsPathItem(parent) {}
QQtGraphicsPathItem::QQtGraphicsPathItem(QQtGraphicsItem* parent) : QGraphicsPathItem(parent) {}
QQTGraphicsEllipseItem::QQTGraphicsEllipseItem(QQTGraphicsItem* parent) : QGraphicsEllipseItem(parent) {}
QQtGraphicsEllipseItem::QQtGraphicsEllipseItem(QQtGraphicsItem* parent) : QGraphicsEllipseItem(parent) {}
QQTGraphicsPolygonItem::QQTGraphicsPolygonItem(QQTGraphicsItem* parent) : QGraphicsPolygonItem(parent) {}
QQtGraphicsPolygonItem::QQtGraphicsPolygonItem(QQtGraphicsItem* parent) : QGraphicsPolygonItem(parent) {}
QQTGraphicsItemGroup::QQTGraphicsItemGroup(QQTGraphicsItem* parent) : QGraphicsItemGroup(parent) {}
QQtGraphicsItemGroup::QQtGraphicsItemGroup(QQtGraphicsItem* parent) : QGraphicsItemGroup(parent) {}
QQTGraphicsProxyWidget::QQTGraphicsProxyWidget(QQTGraphicsItem* parent) : QGraphicsProxyWidget(parent) {}
QQtGraphicsProxyWidget::QQtGraphicsProxyWidget(QQtGraphicsItem* parent) : QGraphicsProxyWidget(parent) {}
void QQTGraphicsTextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
void QQtGraphicsTextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
Q_UNUSED(widget)
QFont oldFont(painter->font());
@ -59,7 +59,7 @@ void QQTGraphicsTextItem::paint(QPainter* painter, const QStyleOptionGraphicsIte
}
void QQTGraphicsLineItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
void QQtGraphicsLineItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
Q_UNUSED(widget)
QPen oldPen(painter->pen());
@ -88,7 +88,7 @@ void QQTGraphicsLineItem::paint(QPainter* painter, const QStyleOptionGraphicsIte
}
void QQTGraphicsRectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
void QQtGraphicsRectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
Q_UNUSED(widget)
QPen oldPen(painter->pen());

View File

@ -5,100 +5,100 @@
#include <QGraphicsProxyWidget>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTGraphicsItem : public QGraphicsItem
class QQTSHARED_EXPORT QQtGraphicsItem : public QGraphicsItem
{
public:
explicit QQTGraphicsItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsTextItem : public QGraphicsTextItem
class QQTSHARED_EXPORT QQtGraphicsTextItem : public QGraphicsTextItem
{
public:
explicit QQTGraphicsTextItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsTextItem ( QQtGraphicsItem* parent = 0 );
// QGraphicsItem interface
public:
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
void paint ( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget );
};
class QQTSHARED_EXPORT QQTGraphicsSimpleTextItem : public QGraphicsSimpleTextItem
class QQTSHARED_EXPORT QQtGraphicsSimpleTextItem : public QGraphicsSimpleTextItem
{
public:
explicit QQTGraphicsSimpleTextItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsSimpleTextItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsPixmapItem : public QGraphicsPixmapItem
class QQTSHARED_EXPORT QQtGraphicsPixmapItem : public QGraphicsPixmapItem
{
public:
explicit QQTGraphicsPixmapItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsPixmapItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsRectItem : public QGraphicsRectItem
class QQTSHARED_EXPORT QQtGraphicsRectItem : public QGraphicsRectItem
{
public:
explicit QQTGraphicsRectItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsRectItem ( QQtGraphicsItem* parent = 0 );
// QGraphicsItem interface
public:
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
void paint ( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget );
};
class QQTSHARED_EXPORT QQTGraphicsLineItem : public QGraphicsLineItem
class QQTSHARED_EXPORT QQtGraphicsLineItem : public QGraphicsLineItem
{
public:
explicit QQTGraphicsLineItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsLineItem ( QQtGraphicsItem* parent = 0 );
// QGraphicsItem interface
public:
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
void paint ( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget );
};
class QQTSHARED_EXPORT QQTGraphicsPathItem : public QGraphicsPathItem
class QQTSHARED_EXPORT QQtGraphicsPathItem : public QGraphicsPathItem
{
public:
explicit QQTGraphicsPathItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsPathItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsEllipseItem : public QGraphicsEllipseItem
class QQTSHARED_EXPORT QQtGraphicsEllipseItem : public QGraphicsEllipseItem
{
public:
explicit QQTGraphicsEllipseItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsEllipseItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsPolygonItem : public QGraphicsPolygonItem
class QQTSHARED_EXPORT QQtGraphicsPolygonItem : public QGraphicsPolygonItem
{
public:
explicit QQTGraphicsPolygonItem(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsPolygonItem ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsItemGroup : public QGraphicsItemGroup
class QQTSHARED_EXPORT QQtGraphicsItemGroup : public QGraphicsItemGroup
{
public:
explicit QQTGraphicsItemGroup(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsItemGroup ( QQtGraphicsItem* parent = 0 );
};
class QQTSHARED_EXPORT QQTGraphicsProxyWidget : public QGraphicsProxyWidget
class QQTSHARED_EXPORT QQtGraphicsProxyWidget : public QGraphicsProxyWidget
{
public:
explicit QQTGraphicsProxyWidget(QQTGraphicsItem* parent = 0);
explicit QQtGraphicsProxyWidget ( QQtGraphicsItem* parent = 0 );
};

View File

@ -3,25 +3,25 @@
#include <QPainter>
#include "qqtcore.h"
#include "qqt-qt.h"
QQTGraphicsScene::QQTGraphicsScene(QObject* parent) :
QQtGraphicsScene::QQtGraphicsScene(QObject* parent) :
QGraphicsScene(parent)
{
}
QQTGraphicsScene::QQTGraphicsScene(const QRectF& sceneRect, QObject* parent) :
QQtGraphicsScene::QQtGraphicsScene(const QRectF& sceneRect, QObject* parent) :
QGraphicsScene(sceneRect, parent)
{
}
QQTGraphicsScene::QQTGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent) :
QQtGraphicsScene::QQtGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent) :
QGraphicsScene(x, y, width, height, parent)
{
}
/**
* @brief QQTGraphicsScene::render
* @brief QQtGraphicsScene::render
* render放缩QPainter和drawItems里面的itemPaint共同导致失真
* Qpainter不允许改变
* itemPaint函数
@ -30,7 +30,7 @@ QQTGraphicsScene::QQTGraphicsScene(qreal x, qreal y, qreal width, qreal height,
* @param source
* @param aspectRatioMode
*/
void QQTGraphicsScene::render(QPainter* painter, const QRectF& target, const QRectF& source,
void QQtGraphicsScene::render(QPainter* painter, const QRectF& target, const QRectF& source,
Qt::AspectRatioMode aspectRatioMode)
{
Q_UNUSED(aspectRatioMode)
@ -101,18 +101,18 @@ void QQTGraphicsScene::render(QPainter* painter, const QRectF& target, const QRe
painter->restore();
}
QQTGraphicsTextItem* QQTGraphicsScene::addText(const QString& text, const QFont& font)
QQtGraphicsTextItem* QQtGraphicsScene::addText(const QString& text, const QFont& font)
{
QQTGraphicsTextItem* item = new QQTGraphicsTextItem;
QQtGraphicsTextItem* item = new QQtGraphicsTextItem;
item->setFont(font);
item->setPlainText(text);
addItem(item);
return item;
}
QQTGraphicsRectItem* QQTGraphicsScene::addRect(const QRectF& rect, const QPen& pen, const QBrush& brush)
QQtGraphicsRectItem* QQtGraphicsScene::addRect(const QRectF& rect, const QPen& pen, const QBrush& brush)
{
QQTGraphicsRectItem* item = new QQTGraphicsRectItem;
QQtGraphicsRectItem* item = new QQtGraphicsRectItem;
item->setRect(rect);
item->setPen(pen);
item->setBrush(brush);
@ -121,9 +121,9 @@ QQTGraphicsRectItem* QQTGraphicsScene::addRect(const QRectF& rect, const QPen& p
return item;
}
QQTGraphicsLineItem* QQTGraphicsScene::addLine(const QLineF& line, const QPen& pen)
QQtGraphicsLineItem* QQtGraphicsScene::addLine(const QLineF& line, const QPen& pen)
{
QQTGraphicsLineItem* item = new QQTGraphicsLineItem;
QQtGraphicsLineItem* item = new QQtGraphicsLineItem;
item->setLine(line);
item->setPen(pen);
item->moveBy(line.x1(), line.y1());
@ -133,13 +133,13 @@ QQTGraphicsLineItem* QQTGraphicsScene::addLine(const QLineF& line, const QPen& p
}
void QQTGraphicsScene::drawItems(QPainter* painter, int numItems, QGraphicsItem* items[],
void QQtGraphicsScene::drawItems(QPainter* painter, int numItems, QGraphicsItem* items[],
const QStyleOptionGraphicsItem options[], QWidget* widget)
{
for (int i = 0; i < numItems; ++i)
{
QQTGraphicsItem* item = (QQTGraphicsItem*)items[i];
QQtGraphicsItem* item = (QQtGraphicsItem*)items[i];
if (item->flags() & QGraphicsItem::ItemClipsToShape)
{

View File

@ -5,36 +5,37 @@
#include "qqtgraphicsitem.h"
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTGraphicsScene : public QGraphicsScene
class QQTSHARED_EXPORT QQtGraphicsScene : public QGraphicsScene
{
Q_OBJECT
public:
QQTGraphicsScene(QObject* parent = 0);
QQTGraphicsScene(const QRectF& sceneRect, QObject* parent = 0);
QQTGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent = 0);
virtual ~QQTGraphicsScene() {}
QQtGraphicsScene ( QObject* parent = 0 );
QQtGraphicsScene ( const QRectF& sceneRect, QObject* parent = 0 );
QQtGraphicsScene ( qreal x, qreal y, qreal width, qreal height, QObject* parent = 0 );
virtual ~QQtGraphicsScene() {}
void render(QPainter* painter,
void render ( QPainter* painter,
const QRectF& target = QRectF(), const QRectF& source = QRectF(),
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio);
QQTGraphicsEllipseItem* addEllipse(const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush());
inline QGraphicsEllipseItem* addEllipse(qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
const QBrush& brush = QBrush())
{ return addEllipse(QRectF(x, y, w, h), pen, brush); }
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio );
QQtGraphicsEllipseItem* addEllipse ( const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush() );
inline QGraphicsEllipseItem* addEllipse ( qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
const QBrush& brush = QBrush() )
{ return addEllipse ( QRectF ( x, y, w, h ), pen, brush ); }
QQTGraphicsPathItem* addPath(const QPainterPath& path, const QPen& pen = QPen(), const QBrush& brush = QBrush());
QQTGraphicsPixmapItem* addPixmap(const QPixmap& pixmap);
QQTGraphicsPolygonItem* addPolygon(const QPolygonF& polygon, const QPen& pen = QPen(), const QBrush& brush = QBrush());
QQTGraphicsTextItem* addText(const QString& text, const QFont& font = QFont());
QQTGraphicsSimpleTextItem* addSimpleText(const QString& text, const QFont& font = QFont());
QQTGraphicsProxyWidget* addWidget(QWidget* widget, Qt::WindowFlags wFlags = 0);
QQTGraphicsLineItem* addLine(const QLineF& line, const QPen& pen = QPen());
inline QQTGraphicsLineItem* addLine(qreal x1, qreal y1, qreal x2, qreal y2, const QPen& pen = QPen())
{ return addLine(QLineF(x1, y1, x2, y2), pen); }
QQTGraphicsRectItem* addRect(const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush());
inline QQTGraphicsRectItem* addRect(qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
const QBrush& brush = QBrush())
{ return addRect(QRectF(x, y, w, h), pen, brush); }
QQtGraphicsPathItem* addPath ( const QPainterPath& path, const QPen& pen = QPen(), const QBrush& brush = QBrush() );
QQtGraphicsPixmapItem* addPixmap ( const QPixmap& pixmap );
QQtGraphicsPolygonItem* addPolygon ( const QPolygonF& polygon, const QPen& pen = QPen(),
const QBrush& brush = QBrush() );
QQtGraphicsTextItem* addText ( const QString& text, const QFont& font = QFont() );
QQtGraphicsSimpleTextItem* addSimpleText ( const QString& text, const QFont& font = QFont() );
QQtGraphicsProxyWidget* addWidget ( QWidget* widget, Qt::WindowFlags wFlags = 0 );
QQtGraphicsLineItem* addLine ( const QLineF& line, const QPen& pen = QPen() );
inline QQtGraphicsLineItem* addLine ( qreal x1, qreal y1, qreal x2, qreal y2, const QPen& pen = QPen() )
{ return addLine ( QLineF ( x1, y1, x2, y2 ), pen ); }
QQtGraphicsRectItem* addRect ( const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush() );
inline QQtGraphicsRectItem* addRect ( qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
const QBrush& brush = QBrush() )
{ return addRect ( QRectF ( x, y, w, h ), pen, brush ); }
signals:
@ -43,8 +44,8 @@ public slots:
// QGraphicsScene interface
protected:
void drawItems(QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[],
QWidget* widget = 0);
void drawItems ( QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[],
QWidget* widget = 0 );
private:
};

View File

@ -5,13 +5,13 @@
#include "qqtgraphicsscene.h"
#include "qqt-qt.h"
QQTGraphicsView::QQTGraphicsView(QWidget* parent) :
QQtGraphicsView::QQtGraphicsView(QWidget* parent) :
QGraphicsView(parent)
{
}
void QQTGraphicsView::paintEvent(QPaintEvent* e)
void QQtGraphicsView::paintEvent(QPaintEvent* e)
{
#if 1
//已经确认在PC和板子上这同一套计算代码都存在问题
@ -30,7 +30,7 @@ void QQTGraphicsView::paintEvent(QPaintEvent* e)
// pline() << logicalDpiX() << logicalDpiY();
//pc 96 0.81,0.46 743,593 778628
//p.scale(1.5/1, 1.5/1);
QQTGraphicsScene* sn = (QQTGraphicsScene*)scene();
QQtGraphicsScene* sn = (QQtGraphicsScene*)scene();
sn->render(&p, rf, rt);
}
@ -251,13 +251,13 @@ void QQTGraphicsView::paintEvent(QPaintEvent* e)
}
void QQTGraphicsView::drawItems(QPainter* painter, int numItems, QGraphicsItem* items[],
void QQtGraphicsView::drawItems(QPainter* painter, int numItems, QGraphicsItem* items[],
const QStyleOptionGraphicsItem options[])
{
for (int i = 0; i < numItems; ++i)
{
// Save painter
QQTGraphicsItem* item = (QQTGraphicsItem*)items[i];
QQtGraphicsItem* item = (QQtGraphicsItem*)items[i];
if (item->flags() & QGraphicsItem::ItemClipsToShape)
{

View File

@ -4,11 +4,11 @@
#include <QGraphicsView>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTGraphicsView : public QGraphicsView
class QQTSHARED_EXPORT QQtGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
explicit QQTGraphicsView(QWidget* parent = 0);
explicit QQtGraphicsView ( QWidget* parent = 0 );
signals:
@ -17,11 +17,11 @@ public slots:
// QWidget interface
protected:
void paintEvent(QPaintEvent*);
void paintEvent ( QPaintEvent* );
// QGraphicsView interface
protected:
void drawItems(QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[]);
void drawItems ( QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[] );
};
#endif // QQTGRAPHICSVIEW_H

View File

@ -6,19 +6,19 @@
#include <QStandardItemModel>
#include <QStringListModel>
QQTHeaderView::QQTHeaderView(Qt::Orientation orientation, QWidget* parent) :
QQtHeaderView::QQtHeaderView(Qt::Orientation orientation, QWidget* parent) :
QHeaderView(orientation, parent), ori(orientation)
{
setFocusPolicy(Qt::NoFocus);
setStyleSheet("QHeaderView, QHeaderView::section{background:transparent;}");
}
void QQTHeaderView::paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const
void QQtHeaderView::paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const
{
painter->drawText(rect, Qt::AlignCenter, model()->headerData(logicalIndex, ori).toString());
}
QSize QQTHeaderView::sectionSizeFromContents(int logicalIndex) const
QSize QQtHeaderView::sectionSizeFromContents(int logicalIndex) const
{
/*
* section宽度
@ -26,7 +26,7 @@ QSize QQTHeaderView::sectionSizeFromContents(int logicalIndex) const
return QHeaderView::sectionSizeFromContents(logicalIndex);
}
void QQTHeaderView::paintEvent(QPaintEvent* e)
void QQtHeaderView::paintEvent(QPaintEvent* e)
{
Q_UNUSED(e)
QStylePainter p(this->viewport());

View File

@ -4,14 +4,14 @@
#include <QHeaderView>
#include <qqt-local.h>
/**
* @brief The QQTHeaderView class
* @brief The QQtHeaderView class
* Qt4.8.7 HeaderView背景全部透明
*/
class QQTSHARED_EXPORT QQTHeaderView : public QHeaderView
class QQTSHARED_EXPORT QQtHeaderView : public QHeaderView
{
Q_OBJECT
public:
explicit QQTHeaderView ( Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0 );
explicit QQtHeaderView ( Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0 );
signals:

View File

@ -2,7 +2,7 @@
#include <QHBoxLayout>
#include "qqtwidgets.h"
QQTLineEditWithSearch::QQTLineEditWithSearch(QWidget* parent) :
QQtLineEditWithSearch::QQtLineEditWithSearch(QWidget* parent) :
QLineEdit(parent)
{
m_btnBrower = new QPushButton(this);
@ -28,12 +28,12 @@ QQTLineEditWithSearch::QQTLineEditWithSearch(QWidget* parent) :
connect(m_btnBrower, SIGNAL(clicked()), this, SIGNAL(btnClicked()));
}
void QQTLineEditWithSearch::setButtonText(QString text)
void QQtLineEditWithSearch::setButtonText(QString text)
{
m_btnBrower->setText(text);
}
void QQTLineEditWithSearch::setObjectName(const QString& name)
void QQtLineEditWithSearch::setObjectName(const QString& name)
{
QLineEdit::setObjectName(name);
m_btnBrower->setObjectName(QString("%1_button").arg(name));

View File

@ -5,13 +5,13 @@
#include <QPushButton>
#include <qqt-local.h>
class QQTSHARED_EXPORT QQTLineEditWithSearch : public QLineEdit
class QQTSHARED_EXPORT QQtLineEditWithSearch : public QLineEdit
{
Q_OBJECT
public:
explicit QQTLineEditWithSearch(QWidget* parent = 0);
void setButtonText(QString text);
void setObjectName(const QString& name);
explicit QQtLineEditWithSearch ( QWidget* parent = 0 );
void setButtonText ( QString text );
void setObjectName ( const QString& name );
signals:
void btnClicked();

View File

@ -6,8 +6,8 @@
QQtTableView::QQtTableView(QWidget* parent) :
QTableView(parent)
{
m_header = new QQTHeaderView(Qt::Horizontal, this);
m_vheader = new QQTHeaderView(Qt::Vertical, this);
m_header = new QQtHeaderView(Qt::Horizontal, this);
m_vheader = new QQtHeaderView(Qt::Vertical, this);
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);

View File

@ -13,15 +13,15 @@ public:
explicit QQtTableView(QWidget* parent = 0);
virtual ~QQtTableView();
QQTHeaderView* QQTHHeader() { return m_header; }
QQTHeaderView* QQTVHeader() { return m_vheader; }
QQtHeaderView* QQTHHeader() { return m_header; }
QQtHeaderView* QQTVHeader() { return m_vheader; }
void setQQTHeader();
void setQQTVHeader();
void setObjectName(const QString& name);
private:
QQTHeaderView* m_vheader;
QQTHeaderView* m_header;
QQtHeaderView* m_vheader;
QQtHeaderView* m_header;
};
#endif // QQTTABLEVIEW_H