From 66598fdcad9efeda9d0e7cce1888e18de035f926 Mon Sep 17 00:00:00 2001 From: tianduanrui <2407223896@qq.com> Date: Tue, 21 Nov 2017 23:12:29 +0800 Subject: [PATCH] add QQtChart, open customplot to ios, move all QQT to QQt --- examples/animationframe/animationmanager.cpp | 14 +- examples/animationframe/qqtapp.cpp | 18 +- examples/animationframe/qqtwindow.cpp | 16 +- examples/qqtffmpegplayer/qqtapp.cpp | 18 +- examples/qqtffmpegplayer/qqtwindow.cpp | 2 +- examples/qqtframe/qqtapp.cpp | 18 +- examples/qqtframe/qqtwindow.cpp | 2 +- examples/qqtftpclient/qqtapp.cpp | 18 +- examples/qqtftpclient/qqtwindow.cpp | 2 +- examples/qqthttpclient/qqtapp.cpp | 18 +- examples/qqthttpclient/qqtwindow.cpp | 2 +- examples/qqtliveplayer/animationmanager.cpp | 4 +- examples/qqtliveplayer/qqtapp.cpp | 18 +- examples/qqtliveplayer/qqtwindow.cpp | 2 +- .../qqtnetworkexample/qqtcloudprotocol.cpp | 12 +- examples/qqtnetworkexample/qqtcloudprotocol.h | 4 +- examples/qqtnetworkexample/qqtlanprotocol.cpp | 4 +- examples/qqtnetworkexample/qqtlanprotocol.h | 2 +- examples/qqtwebkit/qqtapp.cpp | 18 +- examples/qqtwebkit/qqtwindow.cpp | 2 +- examples/qqtwebkit/qqtwindow.ui | 4 +- src/charts/qqtchart.cpp | 6 + src/charts/qqtchart.h | 17 + src/charts/qqtchartview.cpp | 13 + src/charts/qqtchartview.h | 29 + src/core/qqtanimation.cpp | 2 +- src/core/qqtanimation.h | 4 +- src/core/qqtcore.h | 46 +- src/core/qqtobjectfactory.h | 42 +- src/customplot/qcustomplot.h | 2355 +++++++++-------- src/exquisite/qrcode/qrdecode/qrdecode.pri | 4 +- src/frame/qqtinput.cpp | 60 +- src/frame/qqtinput.h | 41 +- src/frame/qqtinput.ui | 4 +- src/frame/qqtmsgbox.cpp | 32 +- src/frame/qqtmsgbox.h | 28 +- src/frame/qqtmsgbox.ui | 4 +- src/frame/qqtpassworddialog.cpp | 14 +- src/frame/qqtpassworddialog.h | 16 +- src/frame/qqtpassworddialog.ui | 4 +- src/frame/qqtpreviewwidget.cpp | 18 +- src/frame/qqtpreviewwidget.h | 18 +- src/frame/qqtpreviewwidget.ui | 4 +- src/frame/qqtprogressdialog.cpp | 4 +- src/frame/qqtwifiwidget.cpp | 32 +- src/frame/qqtwifiwidget.h | 27 +- src/frame/qqtwifiwidget.ui | 4 +- src/frame/qqtword.cpp | 78 +- src/frame/qqtword.h | 54 +- src/gui/qqtjsontreemodel.cpp | 2 +- src/gui/qqtxmltreemodel.cpp | 10 +- src/gui/qqtxmltreemodel.h | 4 +- src/multimedia/qqtmplayer.cpp | 22 +- src/multimedia/qqtmplayer.h | 14 +- src/network/qqtclient.cpp | 38 +- src/network/qqtclient.h | 26 +- src/network/qqtethenetmanager.cpp | 46 +- src/network/qqtethenetmanager.h | 38 +- src/network/qqtserver.cpp | 14 +- src/network/qqtserver.h | 12 +- src/pluginwatcher/qqtpluginwatcher.cpp | 18 +- src/pluginwatcher/qqtpluginwatcher.h | 18 +- src/printsupport/qqtprinter.cpp | 6 +- src/printsupport/qqtprinter.h | 6 +- src/qqt_3rdparty.pri | 1 + src/qqt_header.pri | 20 +- src/qqt_source.pri | 43 +- src/widgets/qqtapplication.cpp | 10 +- src/widgets/qqtgraphicsitem.cpp | 28 +- src/widgets/qqtgraphicsitem.h | 50 +- src/widgets/qqtgraphicsscene.cpp | 26 +- src/widgets/qqtgraphicsscene.h | 55 +- src/widgets/qqtgraphicsview.cpp | 10 +- src/widgets/qqtgraphicsview.h | 8 +- src/widgets/qqtheaderview.cpp | 8 +- src/widgets/qqtheaderview.h | 6 +- src/widgets/qqtlineeditwithsearch.cpp | 6 +- src/widgets/qqtlineeditwithsearch.h | 8 +- src/widgets/qqttableview.cpp | 4 +- src/widgets/qqttableview.h | 8 +- 80 files changed, 1907 insertions(+), 1816 deletions(-) create mode 100644 src/charts/qqtchart.cpp create mode 100644 src/charts/qqtchart.h create mode 100644 src/charts/qqtchartview.cpp create mode 100644 src/charts/qqtchartview.h diff --git a/examples/animationframe/animationmanager.cpp b/examples/animationframe/animationmanager.cpp index 2ed34e1d..b69d675c 100644 --- a/examples/animationframe/animationmanager.cpp +++ b/examples/animationframe/animationmanager.cpp @@ -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); diff --git a/examples/animationframe/qqtapp.cpp b/examples/animationframe/qqtapp.cpp index daff233f..5993997c 100644 --- a/examples/animationframe/qqtapp.cpp +++ b/examples/animationframe/qqtapp.cpp @@ -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); diff --git a/examples/animationframe/qqtwindow.cpp b/examples/animationframe/qqtwindow.cpp index 00b21348..a23f1cfa 100644 --- a/examples/animationframe/qqtwindow.cpp +++ b/examples/animationframe/qqtwindow.cpp @@ -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); diff --git a/examples/qqtffmpegplayer/qqtapp.cpp b/examples/qqtffmpegplayer/qqtapp.cpp index a1cd45a4..21fdf9c4 100644 --- a/examples/qqtffmpegplayer/qqtapp.cpp +++ b/examples/qqtffmpegplayer/qqtapp.cpp @@ -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); diff --git a/examples/qqtffmpegplayer/qqtwindow.cpp b/examples/qqtffmpegplayer/qqtwindow.cpp index 1f2d0beb..75b9e0d8 100644 --- a/examples/qqtffmpegplayer/qqtwindow.cpp +++ b/examples/qqtffmpegplayer/qqtwindow.cpp @@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqtframe/qqtapp.cpp b/examples/qqtframe/qqtapp.cpp index 3b4f2e2a..e62c3977 100644 --- a/examples/qqtframe/qqtapp.cpp +++ b/examples/qqtframe/qqtapp.cpp @@ -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); diff --git a/examples/qqtframe/qqtwindow.cpp b/examples/qqtframe/qqtwindow.cpp index 1f2d0beb..75b9e0d8 100644 --- a/examples/qqtframe/qqtwindow.cpp +++ b/examples/qqtframe/qqtwindow.cpp @@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqtftpclient/qqtapp.cpp b/examples/qqtftpclient/qqtapp.cpp index a1cd45a4..21fdf9c4 100644 --- a/examples/qqtftpclient/qqtapp.cpp +++ b/examples/qqtftpclient/qqtapp.cpp @@ -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); diff --git a/examples/qqtftpclient/qqtwindow.cpp b/examples/qqtftpclient/qqtwindow.cpp index 1f2d0beb..75b9e0d8 100644 --- a/examples/qqtftpclient/qqtwindow.cpp +++ b/examples/qqtftpclient/qqtwindow.cpp @@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqthttpclient/qqtapp.cpp b/examples/qqthttpclient/qqtapp.cpp index 6fdbb853..f5b6cd9d 100644 --- a/examples/qqthttpclient/qqtapp.cpp +++ b/examples/qqthttpclient/qqtapp.cpp @@ -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); diff --git a/examples/qqthttpclient/qqtwindow.cpp b/examples/qqthttpclient/qqtwindow.cpp index ca86918c..4267f465 100644 --- a/examples/qqthttpclient/qqtwindow.cpp +++ b/examples/qqthttpclient/qqtwindow.cpp @@ -17,7 +17,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqtliveplayer/animationmanager.cpp b/examples/qqtliveplayer/animationmanager.cpp index e6de406f..e014bfd1 100644 --- a/examples/qqtliveplayer/animationmanager.cpp +++ b/examples/qqtliveplayer/animationmanager.cpp @@ -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"); diff --git a/examples/qqtliveplayer/qqtapp.cpp b/examples/qqtliveplayer/qqtapp.cpp index 2847b8ab..db5a76f2 100644 --- a/examples/qqtliveplayer/qqtapp.cpp +++ b/examples/qqtliveplayer/qqtapp.cpp @@ -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); diff --git a/examples/qqtliveplayer/qqtwindow.cpp b/examples/qqtliveplayer/qqtwindow.cpp index d482f546..6fa89f32 100644 --- a/examples/qqtliveplayer/qqtwindow.cpp +++ b/examples/qqtliveplayer/qqtwindow.cpp @@ -22,7 +22,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqtnetworkexample/qqtcloudprotocol.cpp b/examples/qqtnetworkexample/qqtcloudprotocol.cpp index 67242909..87313fbd 100644 --- a/examples/qqtnetworkexample/qqtcloudprotocol.cpp +++ b/examples/qqtnetworkexample/qqtcloudprotocol.cpp @@ -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); } diff --git a/examples/qqtnetworkexample/qqtcloudprotocol.h b/examples/qqtnetworkexample/qqtcloudprotocol.h index 651d7cfd..3b32fcf4 100644 --- a/examples/qqtnetworkexample/qqtcloudprotocol.h +++ b/examples/qqtnetworkexample/qqtcloudprotocol.h @@ -424,10 +424,10 @@ public: }; -QQTClient *QQTUpgradeClientInstance(QObject *parent); +QQtClient *QQTUpgradeClientInstance(QObject *parent); -QQTClient *QQTCloudClientInstance(QObject *parent); +QQtClient *QQTCloudClientInstance(QObject *parent); #endif // QQTCLOUDPROTOCOL_H diff --git a/examples/qqtnetworkexample/qqtlanprotocol.cpp b/examples/qqtnetworkexample/qqtlanprotocol.cpp index ca3d7645..4f3497ab 100644 --- a/examples/qqtnetworkexample/qqtlanprotocol.cpp +++ b/examples/qqtnetworkexample/qqtlanprotocol.cpp @@ -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; } diff --git a/examples/qqtnetworkexample/qqtlanprotocol.h b/examples/qqtnetworkexample/qqtlanprotocol.h index 2c2715da..d3983220 100644 --- a/examples/qqtnetworkexample/qqtlanprotocol.h +++ b/examples/qqtnetworkexample/qqtlanprotocol.h @@ -17,6 +17,6 @@ public: bool dispatcher(const QByteArray &m) override; }; -QQTServer *QQTSingleServer(QObject* parent); +QQtServer *QQTSingleServer(QObject* parent); #endif // QQTLANPROTOCOL_H diff --git a/examples/qqtwebkit/qqtapp.cpp b/examples/qqtwebkit/qqtapp.cpp index 6fdbb853..f5b6cd9d 100644 --- a/examples/qqtwebkit/qqtapp.cpp +++ b/examples/qqtwebkit/qqtapp.cpp @@ -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); diff --git a/examples/qqtwebkit/qqtwindow.cpp b/examples/qqtwebkit/qqtwindow.cpp index 9c7137a8..b73be60e 100644 --- a/examples/qqtwebkit/qqtwindow.cpp +++ b/examples/qqtwebkit/qqtwindow.cpp @@ -13,7 +13,7 @@ QQTWindow::QQTWindow(QWidget *parent) : { ui->setupUi(this); - QQTObjectFactory::registerObject(this); + QQtObjectFactory::registerObject(this); #ifdef __EMBEDDED_LINUX__ /* diff --git a/examples/qqtwebkit/qqtwindow.ui b/examples/qqtwebkit/qqtwindow.ui index 4626b627..de4b987b 100644 --- a/examples/qqtwebkit/qqtwindow.ui +++ b/examples/qqtwebkit/qqtwindow.ui @@ -37,7 +37,7 @@ - + 0 @@ -78,7 +78,7 @@ - QQTLineEditWithSearch + QQtLineEditWithSearch QLineEdit
qqtlineeditwithsearch.h
diff --git a/src/charts/qqtchart.cpp b/src/charts/qqtchart.cpp new file mode 100644 index 00000000..67edd239 --- /dev/null +++ b/src/charts/qqtchart.cpp @@ -0,0 +1,6 @@ +#include "qqtchart.h" + +QQtChart::QQtChart(QWidget *parent) : QWidget(parent) +{ + +} diff --git a/src/charts/qqtchart.h b/src/charts/qqtchart.h new file mode 100644 index 00000000..11be9f65 --- /dev/null +++ b/src/charts/qqtchart.h @@ -0,0 +1,17 @@ +#ifndef QQTCHART_H +#define QQTCHART_H + +#include + +class QQtChart : public QWidget +{ + Q_OBJECT +public: + explicit QQtChart(QWidget *parent = nullptr); + +signals: + +public slots: +}; + +#endif // QQTCHART_H \ No newline at end of file diff --git a/src/charts/qqtchartview.cpp b/src/charts/qqtchartview.cpp new file mode 100644 index 00000000..9945626f --- /dev/null +++ b/src/charts/qqtchartview.cpp @@ -0,0 +1,13 @@ +#include "qqtchartview.h" + +QQtChartView::QQtChartView ( QWidget* parent ) : + QChartView ( parent ) +{ + +} + +QQtChartView::QQtChartView ( QChart* chart, QWidget* parent ) : + QChartView ( chart, parent ) +{ + +} diff --git a/src/charts/qqtchartview.h b/src/charts/qqtchartview.h new file mode 100644 index 00000000..4fe51a5a --- /dev/null +++ b/src/charts/qqtchartview.h @@ -0,0 +1,29 @@ +#ifndef QQTCHARTVIEW_H +#define QQTCHARTVIEW_H + +#include +#include +#include +#include +#include +#include + +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 diff --git a/src/core/qqtanimation.cpp b/src/core/qqtanimation.cpp index c56c6560..a135ece5 100644 --- a/src/core/qqtanimation.cpp +++ b/src/core/qqtanimation.cpp @@ -1,6 +1,6 @@ #include "qqtanimation.h" -QQTAnimation::QQTAnimation(QObject* parent) : QParallelAnimationGroup(parent) +QQtAnimation::QQtAnimation(QObject* parent) : QParallelAnimationGroup(parent) { } diff --git a/src/core/qqtanimation.h b/src/core/qqtanimation.h index ec1fc78d..9dea65f2 100644 --- a/src/core/qqtanimation.h +++ b/src/core/qqtanimation.h @@ -9,11 +9,11 @@ #include "qqtcore.h" #include -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: diff --git a/src/core/qqtcore.h b/src/core/qqtcore.h index f3ba29ba..974f9743 100644 --- a/src/core/qqtcore.h +++ b/src/core/qqtcore.h @@ -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 * QMutex,QSemphore,QCondation在gui线程会锁定gui,而我希望在gui线程中堵塞但是不要锁定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; diff --git a/src/core/qqtobjectfactory.h b/src/core/qqtobjectfactory.h index f5293d30..6040085a 100644 --- a/src/core/qqtobjectfactory.h +++ b/src/core/qqtobjectfactory.h @@ -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(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 itor(containers()); + static void unregisterObject ( const QObject*& w ) { + QListIterator 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 itor(containers()); + static const QObject* registedObject ( const QString objName ) { + QListIterator 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 - static QObject* constructorHelper(QObject* parent) { - return new T(parent); + static QObject* constructorHelper ( QObject* parent ) { + return new T ( parent ); } static QHash& constructors() { @@ -100,7 +100,7 @@ private: /* * 将生成此类对象的具体(非模板)函数注册进Hash */ - constructors().insert(T::staticMetaObject.className(), &constructorHelper); + constructors().insert ( T::staticMetaObject.className(), &constructorHelper ); } private: diff --git a/src/customplot/qcustomplot.h b/src/customplot/qcustomplot.h index dd877e0f..ab5b662a 100644 --- a/src/customplot/qcustomplot.h +++ b/src/customplot/qcustomplot.h @@ -45,6 +45,8 @@ #include #include #include +#include +#ifndef QT_NO_PRINTER #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) # include # include @@ -53,6 +55,7 @@ # include # include #endif +#endif class QCPPainter; class QCustomPlot; @@ -110,7 +113,7 @@ enum MarginSide { msLeft = 0x01 ///< 0x01 left margin , msAll = 0xFF ///< 0xFF all margins , msNone = 0x00 ///< 0x00 no margin }; -Q_DECLARE_FLAGS(MarginSides, MarginSide) +Q_DECLARE_FLAGS ( MarginSides, MarginSide ) /*! Defines what objects of a plot can be forcibly drawn antialiased/not antialiased. If an object is @@ -135,7 +138,7 @@ enum AntialiasedElement { aeAxes = 0x0001 ///< 0x0001 Axis ba , aeAll = 0xFFFF ///< 0xFFFF All elements , aeNone = 0x0000 ///< 0x0000 No elements }; -Q_DECLARE_FLAGS(AntialiasedElements, AntialiasedElement) +Q_DECLARE_FLAGS ( AntialiasedElements, AntialiasedElement ) /*! Defines plotting hints that control various aspects of the quality and speed of plotting. @@ -149,7 +152,7 @@ enum PlottingHint { phNone = 0x000 ///< 0x000 No hints are s ///< This is set by default to prevent the plot from freezing on fast consecutive replots (e.g. user drags ranges with mouse). , phCacheLabels = 0x004 ///< 0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance. }; -Q_DECLARE_FLAGS(PlottingHints, PlottingHint) +Q_DECLARE_FLAGS ( PlottingHints, PlottingHint ) /*! Defines the mouse interactions possible with QCustomPlot. @@ -167,7 +170,7 @@ enum Interaction { iRangeDrag = 0x001 ///< 0x001 Axis ranges ar , iSelectItems = 0x040 ///< 0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see \ref QCPAbstractItem) , iSelectOther = 0x080 ///< 0x080 All other objects are selectable (e.g. your own derived layerables, the plot title,...) }; -Q_DECLARE_FLAGS(Interactions, Interaction) +Q_DECLARE_FLAGS ( Interactions, Interaction ) /*! \internal @@ -175,9 +178,9 @@ Q_DECLARE_FLAGS(Interactions, Interaction) is \e nan or \e +/-inf). This function is used to check data validity upon replots, when the compiler flag \c QCUSTOMPLOT_CHECK_DATA is set. */ -inline bool isInvalidData(double value) +inline bool isInvalidData ( double value ) { - return qIsNaN(value) || qIsInf(value); + return qIsNaN ( value ) || qIsInf ( value ); } /*! \internal @@ -185,9 +188,9 @@ inline bool isInvalidData(double value) Checks two arguments instead of one. */ -inline bool isInvalidData(double value1, double value2) +inline bool isInvalidData ( double value1, double value2 ) { - return isInvalidData(value1) || isInvalidData(value2); + return isInvalidData ( value1 ) || isInvalidData ( value2 ); } /*! \internal @@ -196,19 +199,19 @@ inline bool isInvalidData(double value1, double value2) \see getMarginValue */ -inline void setMarginValue(QMargins& margins, QCP::MarginSide side, int value) +inline void setMarginValue ( QMargins& margins, QCP::MarginSide side, int value ) { - switch (side) + switch ( side ) { - case QCP::msLeft: margins.setLeft(value); break; + case QCP::msLeft: margins.setLeft ( value ); break; - case QCP::msRight: margins.setRight(value); break; + case QCP::msRight: margins.setRight ( value ); break; - case QCP::msTop: margins.setTop(value); break; + case QCP::msTop: margins.setTop ( value ); break; - case QCP::msBottom: margins.setBottom(value); break; + case QCP::msBottom: margins.setBottom ( value ); break; - case QCP::msAll: margins = QMargins(value, value, value, value); break; + case QCP::msAll: margins = QMargins ( value, value, value, value ); break; default: break; } @@ -221,9 +224,9 @@ inline void setMarginValue(QMargins& margins, QCP::MarginSide side, int value) \see setMarginValue */ -inline int getMarginValue(const QMargins& margins, QCP::MarginSide side) +inline int getMarginValue ( const QMargins& margins, QCP::MarginSide side ) { - switch (side) + switch ( side ) { case QCP::msLeft: return margins.left(); @@ -241,10 +244,10 @@ inline int getMarginValue(const QMargins& margins, QCP::MarginSide side) } // end of namespace QCP -Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements) -Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints) -Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides) -Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCP::AntialiasedElements ) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCP::PlottingHints ) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCP::MarginSides ) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCP::Interactions ) class QCP_LIB_DECL QCPScatterStyle @@ -258,7 +261,7 @@ public: \ref ssDot and \ref ssPixmap) can be controlled with the \ref setSize function. Scatters are drawn with the pen and brush specified with \ref setPen and \ref setBrush. */ - Q_ENUMS(ScatterShape) + Q_ENUMS ( ScatterShape ) enum ScatterShape { ssNone ///< no scatter symbols are drawn (e.g. in QCPGraph, data only represented with lines) , ssDot ///< \enumimage{ssDot.png} a single pixel (use \ref ssDisc or \ref ssCircle if you want a round shape with a certain radius) , ssCross ///< \enumimage{ssCross.png} a cross @@ -280,12 +283,12 @@ public: }; QCPScatterStyle(); - QCPScatterStyle(ScatterShape shape, double size = 6); - QCPScatterStyle(ScatterShape shape, const QColor& color, double size); - QCPScatterStyle(ScatterShape shape, const QColor& color, const QColor& fill, double size); - QCPScatterStyle(ScatterShape shape, const QPen& pen, const QBrush& brush, double size); - QCPScatterStyle(const QPixmap& pixmap); - QCPScatterStyle(const QPainterPath& customPath, const QPen& pen, const QBrush& brush = Qt::NoBrush, double size = 6); + QCPScatterStyle ( ScatterShape shape, double size = 6 ); + QCPScatterStyle ( ScatterShape shape, const QColor& color, double size ); + QCPScatterStyle ( ScatterShape shape, const QColor& color, const QColor& fill, double size ); + QCPScatterStyle ( ScatterShape shape, const QPen& pen, const QBrush& brush, double size ); + QCPScatterStyle ( const QPixmap& pixmap ); + QCPScatterStyle ( const QPainterPath& customPath, const QPen& pen, const QBrush& brush = Qt::NoBrush, double size = 6 ); // getters: double size() const { return mSize; } @@ -296,19 +299,19 @@ public: QPainterPath customPath() const { return mCustomPath; } // setters: - void setSize(double size); - void setShape(ScatterShape shape); - void setPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setPixmap(const QPixmap& pixmap); - void setCustomPath(const QPainterPath& customPath); + void setSize ( double size ); + void setShape ( ScatterShape shape ); + void setPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setPixmap ( const QPixmap& pixmap ); + void setCustomPath ( const QPainterPath& customPath ); // non-property methods: bool isNone() const { return mShape == ssNone; } bool isPenDefined() const { return mPenDefined; } - void applyTo(QCPPainter* painter, const QPen& defaultPen) const; - void drawShape(QCPPainter* painter, QPointF pos) const; - void drawShape(QCPPainter* painter, double x, double y) const; + void applyTo ( QCPPainter* painter, const QPen& defaultPen ) const; + void drawShape ( QCPPainter* painter, QPointF pos ) const; + void drawShape ( QCPPainter* painter, double x, double y ) const; protected: // property members: @@ -322,7 +325,7 @@ protected: // non-property members: bool mPenDefined; }; -Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPScatterStyle, Q_MOVABLE_TYPE ); class QCP_LIB_DECL QCPPainter : public QPainter @@ -338,29 +341,29 @@ public: , pmNoCaching = 0x02 ///< 0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixmap labels , pmNonCosmetic = 0x04 ///< 0x04 Turns pen widths 0 to 1, i.e. disables cosmetic pens. (A cosmetic pen is always drawn with width 1 pixel in the vector image/pdf viewer, independent of zoom.) }; - Q_FLAGS(PainterMode PainterModes) - Q_DECLARE_FLAGS(PainterModes, PainterMode) + Q_FLAGS ( PainterMode PainterModes ) + Q_DECLARE_FLAGS ( PainterModes, PainterMode ) QCPPainter(); - QCPPainter(QPaintDevice* device); + QCPPainter ( QPaintDevice* device ); ~QCPPainter(); // getters: - bool antialiasing() const { return testRenderHint(QPainter::Antialiasing); } + bool antialiasing() const { return testRenderHint ( QPainter::Antialiasing ); } PainterModes modes() const { return mModes; } // setters: - void setAntialiasing(bool enabled); - void setMode(PainterMode mode, bool enabled = true); - void setModes(PainterModes modes); + void setAntialiasing ( bool enabled ); + void setMode ( PainterMode mode, bool enabled = true ); + void setModes ( PainterModes modes ); // methods hiding non-virtual base class functions (QPainter bug workarounds): - bool begin(QPaintDevice* device); - void setPen(const QPen& pen); - void setPen(const QColor& color); - void setPen(Qt::PenStyle penStyle); - void drawLine(const QLineF& line); - void drawLine(const QPointF& p1, const QPointF& p2) {drawLine(QLineF(p1, p2));} + bool begin ( QPaintDevice* device ); + void setPen ( const QPen& pen ); + void setPen ( const QColor& color ); + void setPen ( Qt::PenStyle penStyle ); + void drawLine ( const QLineF& line ); + void drawLine ( const QPointF& p1, const QPointF& p2 ) {drawLine ( QLineF ( p1, p2 ) );} void save(); void restore(); @@ -375,21 +378,21 @@ protected: // non-property members: QStack mAntialiasingStack; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCPPainter::PainterModes ) class QCP_LIB_DECL QCPLayer : public QObject { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot) - Q_PROPERTY(QString name READ name) - Q_PROPERTY(int index READ index) - Q_PROPERTY(QList children READ children) - Q_PROPERTY(bool visible READ visible WRITE setVisible) + Q_PROPERTY ( QCustomPlot* parentPlot READ parentPlot ) + Q_PROPERTY ( QString name READ name ) + Q_PROPERTY ( int index READ index ) + Q_PROPERTY ( QList children READ children ) + Q_PROPERTY ( bool visible READ visible WRITE setVisible ) /// \endcond public: - QCPLayer(QCustomPlot* parentPlot, const QString& layerName); + QCPLayer ( QCustomPlot* parentPlot, const QString& layerName ); ~QCPLayer(); // getters: @@ -400,7 +403,7 @@ public: bool visible() const { return mVisible; } // setters: - void setVisible(bool visible); + void setVisible ( bool visible ); protected: // property members: @@ -411,11 +414,11 @@ protected: bool mVisible; // non-virtual methods: - void addChild(QCPLayerable* layerable, bool prepend); - void removeChild(QCPLayerable* layerable); + void addChild ( QCPLayerable* layerable, bool prepend ); + void removeChild ( QCPLayerable* layerable ); private: - Q_DISABLE_COPY(QCPLayer) + Q_DISABLE_COPY ( QCPLayer ) friend class QCustomPlot; friend class QCPLayerable; @@ -425,14 +428,14 @@ class QCP_LIB_DECL QCPLayerable : public QObject { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(bool visible READ visible WRITE setVisible) - Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot) - Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable) - Q_PROPERTY(QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged) - Q_PROPERTY(bool antialiased READ antialiased WRITE setAntialiased) + Q_PROPERTY ( bool visible READ visible WRITE setVisible ) + Q_PROPERTY ( QCustomPlot* parentPlot READ parentPlot ) + Q_PROPERTY ( QCPLayerable* parentLayerable READ parentLayerable ) + Q_PROPERTY ( QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged ) + Q_PROPERTY ( bool antialiased READ antialiased WRITE setAntialiased ) /// \endcond public: - QCPLayerable(QCustomPlot* plot, QString targetLayer = QString(), QCPLayerable* parentLayerable = 0); + QCPLayerable ( QCustomPlot* plot, QString targetLayer = QString(), QCPLayerable* parentLayerable = 0 ); ~QCPLayerable(); // getters: @@ -443,19 +446,19 @@ public: bool antialiased() const { return mAntialiased; } // setters: - void setVisible(bool on); - Q_SLOT bool setLayer(QCPLayer* layer); - bool setLayer(const QString& layerName); - void setAntialiased(bool enabled); + void setVisible ( bool on ); + Q_SLOT bool setLayer ( QCPLayer* layer ); + bool setLayer ( const QString& layerName ); + void setAntialiased ( bool enabled ); // introduced virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // non-property methods: bool realVisibility() const; signals: - void layerChanged(QCPLayer* newLayer); + void layerChanged ( QCPLayer* newLayer ); protected: // property members: @@ -466,23 +469,24 @@ protected: bool mAntialiased; // introduced virtual methods: - virtual void parentPlotInitialized(QCustomPlot* parentPlot); + virtual void parentPlotInitialized ( QCustomPlot* parentPlot ); virtual QCP::Interaction selectionCategory() const; virtual QRect clipRect() const; - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const = 0; - virtual void draw(QCPPainter* painter) = 0; + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const = 0; + virtual void draw ( QCPPainter* painter ) = 0; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // non-property methods: - void initializeParentPlot(QCustomPlot* parentPlot); - void setParentLayerable(QCPLayerable* parentLayerable); - bool moveToLayer(QCPLayer* layer, bool prepend); - void applyAntialiasingHint(QCPPainter* painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const; + void initializeParentPlot ( QCustomPlot* parentPlot ); + void setParentLayerable ( QCPLayerable* parentLayerable ); + bool moveToLayer ( QCPLayer* layer, bool prepend ); + void applyAntialiasingHint ( QCPPainter* painter, bool localAntialiased, + QCP::AntialiasedElement overrideElement ) const; private: - Q_DISABLE_COPY(QCPLayerable) + Q_DISABLE_COPY ( QCPLayerable ) friend class QCustomPlot; friend class QCPAxisRect; @@ -495,38 +499,38 @@ public: double lower, upper; QCPRange(); - QCPRange(double lower, double upper); + QCPRange ( double lower, double upper ); - bool operator==(const QCPRange& other) const { return lower == other.lower && upper == other.upper; } - bool operator!=(const QCPRange& other) const { return !(*this == other); } + bool operator== ( const QCPRange& other ) const { return lower == other.lower && upper == other.upper; } + bool operator!= ( const QCPRange& other ) const { return ! ( *this == other ); } - QCPRange& operator+=(const double& value) { lower += value; upper += value; return *this; } - QCPRange& operator-=(const double& value) { lower -= value; upper -= value; return *this; } - QCPRange& operator*=(const double& value) { lower *= value; upper *= value; return *this; } - QCPRange& operator/=(const double& value) { lower /= value; upper /= value; return *this; } - friend inline const QCPRange operator+(const QCPRange&, double); - friend inline const QCPRange operator+(double, const QCPRange&); - friend inline const QCPRange operator-(const QCPRange& range, double value); - friend inline const QCPRange operator*(const QCPRange& range, double value); - friend inline const QCPRange operator*(double value, const QCPRange& range); - friend inline const QCPRange operator/(const QCPRange& range, double value); + QCPRange& operator+= ( const double& value ) { lower += value; upper += value; return *this; } + QCPRange& operator-= ( const double& value ) { lower -= value; upper -= value; return *this; } + QCPRange& operator*= ( const double& value ) { lower *= value; upper *= value; return *this; } + QCPRange& operator/= ( const double& value ) { lower /= value; upper /= value; return *this; } + friend inline const QCPRange operator+ ( const QCPRange&, double ); + friend inline const QCPRange operator+ ( double, const QCPRange& ); + friend inline const QCPRange operator- ( const QCPRange& range, double value ); + friend inline const QCPRange operator* ( const QCPRange& range, double value ); + friend inline const QCPRange operator* ( double value, const QCPRange& range ); + friend inline const QCPRange operator/ ( const QCPRange& range, double value ); double size() const; double center() const; void normalize(); - void expand(const QCPRange& otherRange); - QCPRange expanded(const QCPRange& otherRange) const; + void expand ( const QCPRange& otherRange ); + QCPRange expanded ( const QCPRange& otherRange ) const; QCPRange sanitizedForLogScale() const; QCPRange sanitizedForLinScale() const; - bool contains(double value) const; + bool contains ( double value ) const; - static bool validRange(double lower, double upper); - static bool validRange(const QCPRange& range); + static bool validRange ( double lower, double upper ); + static bool validRange ( const QCPRange& range ); static const double minRange; //1e-280; static const double maxRange; //1e280; }; -Q_DECLARE_TYPEINFO(QCPRange, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPRange, Q_MOVABLE_TYPE ); /* documentation of inline functions */ @@ -555,9 +559,9 @@ Q_DECLARE_TYPEINFO(QCPRange, Q_MOVABLE_TYPE); /*! Adds \a value to both boundaries of the range. */ -inline const QCPRange operator+(const QCPRange& range, double value) +inline const QCPRange operator+ ( const QCPRange& range, double value ) { - QCPRange result(range); + QCPRange result ( range ); result += value; return result; } @@ -565,9 +569,9 @@ inline const QCPRange operator+(const QCPRange& range, double value) /*! Adds \a value to both boundaries of the range. */ -inline const QCPRange operator+(double value, const QCPRange& range) +inline const QCPRange operator+ ( double value, const QCPRange& range ) { - QCPRange result(range); + QCPRange result ( range ); result += value; return result; } @@ -575,9 +579,9 @@ inline const QCPRange operator+(double value, const QCPRange& range) /*! Subtracts \a value from both boundaries of the range. */ -inline const QCPRange operator-(const QCPRange& range, double value) +inline const QCPRange operator- ( const QCPRange& range, double value ) { - QCPRange result(range); + QCPRange result ( range ); result -= value; return result; } @@ -585,9 +589,9 @@ inline const QCPRange operator-(const QCPRange& range, double value) /*! Multiplies both boundaries of the range by \a value. */ -inline const QCPRange operator*(const QCPRange& range, double value) +inline const QCPRange operator* ( const QCPRange& range, double value ) { - QCPRange result(range); + QCPRange result ( range ); result *= value; return result; } @@ -595,9 +599,9 @@ inline const QCPRange operator*(const QCPRange& range, double value) /*! Multiplies both boundaries of the range by \a value. */ -inline const QCPRange operator*(double value, const QCPRange& range) +inline const QCPRange operator* ( double value, const QCPRange& range ) { - QCPRange result(range); + QCPRange result ( range ); result *= value; return result; } @@ -605,9 +609,9 @@ inline const QCPRange operator*(double value, const QCPRange& range) /*! Divides both boundaries of the range by \a value. */ -inline const QCPRange operator/(const QCPRange& range, double value) +inline const QCPRange operator/ ( const QCPRange& range, double value ) { - QCPRange result(range); + QCPRange result ( range ); result /= value; return result; } @@ -617,11 +621,11 @@ class QCP_LIB_DECL QCPMarginGroup : public QObject { Q_OBJECT public: - QCPMarginGroup(QCustomPlot* parentPlot); + QCPMarginGroup ( QCustomPlot* parentPlot ); ~QCPMarginGroup(); // non-virtual methods: - QList elements(QCP::MarginSide side) const { return mChildren.value(side); } + QList elements ( QCP::MarginSide side ) const { return mChildren.value ( side ); } bool isEmpty() const; void clear(); @@ -631,12 +635,12 @@ protected: QHash > mChildren; // non-virtual methods: - int commonMargin(QCP::MarginSide side) const; - void addChild(QCP::MarginSide side, QCPLayoutElement* element); - void removeChild(QCP::MarginSide side, QCPLayoutElement* element); + int commonMargin ( QCP::MarginSide side ) const; + void addChild ( QCP::MarginSide side, QCPLayoutElement* element ); + void removeChild ( QCP::MarginSide side, QCPLayoutElement* element ); private: - Q_DISABLE_COPY(QCPMarginGroup) + Q_DISABLE_COPY ( QCPMarginGroup ) friend class QCPLayoutElement; }; @@ -646,13 +650,13 @@ class QCP_LIB_DECL QCPLayoutElement : public QCPLayerable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCPLayout* layout READ layout) - Q_PROPERTY(QRect rect READ rect) - Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect) - Q_PROPERTY(QMargins margins READ margins WRITE setMargins) - Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins) - Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize) - Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize) + Q_PROPERTY ( QCPLayout* layout READ layout ) + Q_PROPERTY ( QRect rect READ rect ) + Q_PROPERTY ( QRect outerRect READ outerRect WRITE setOuterRect ) + Q_PROPERTY ( QMargins margins READ margins WRITE setMargins ) + Q_PROPERTY ( QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins ) + Q_PROPERTY ( QSize minimumSize READ minimumSize WRITE setMinimumSize ) + Q_PROPERTY ( QSize maximumSize READ maximumSize WRITE setMaximumSize ) /// \endcond public: /*! @@ -663,9 +667,9 @@ public: , upMargins ///< Phase in which the margins are calculated and set , upLayout ///< Final phase in which the layout system places the rects of the elements }; - Q_ENUMS(UpdatePhase) + Q_ENUMS ( UpdatePhase ) - explicit QCPLayoutElement(QCustomPlot* parentPlot = 0); + explicit QCPLayoutElement ( QCustomPlot* parentPlot = 0 ); virtual ~QCPLayoutElement(); // getters: @@ -677,28 +681,28 @@ public: QCP::MarginSides autoMargins() const { return mAutoMargins; } QSize minimumSize() const { return mMinimumSize; } QSize maximumSize() const { return mMaximumSize; } - QCPMarginGroup* marginGroup(QCP::MarginSide side) const { return mMarginGroups.value(side, (QCPMarginGroup*)0); } + QCPMarginGroup* marginGroup ( QCP::MarginSide side ) const { return mMarginGroups.value ( side, ( QCPMarginGroup* ) 0 ); } QHash marginGroups() const { return mMarginGroups; } // setters: - void setOuterRect(const QRect& rect); - void setMargins(const QMargins& margins); - void setMinimumMargins(const QMargins& margins); - void setAutoMargins(QCP::MarginSides sides); - void setMinimumSize(const QSize& size); - void setMinimumSize(int width, int height); - void setMaximumSize(const QSize& size); - void setMaximumSize(int width, int height); - void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup* group); + void setOuterRect ( const QRect& rect ); + void setMargins ( const QMargins& margins ); + void setMinimumMargins ( const QMargins& margins ); + void setAutoMargins ( QCP::MarginSides sides ); + void setMinimumSize ( const QSize& size ); + void setMinimumSize ( int width, int height ); + void setMaximumSize ( const QSize& size ); + void setMaximumSize ( int width, int height ); + void setMarginGroup ( QCP::MarginSides sides, QCPMarginGroup* group ); // introduced virtual methods: - virtual void update(UpdatePhase phase); + virtual void update ( UpdatePhase phase ); virtual QSize minimumSizeHint() const; virtual QSize maximumSizeHint() const; - virtual QList elements(bool recursive) const; + virtual QList elements ( bool recursive ) const; // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; protected: // property members: @@ -710,21 +714,21 @@ protected: QHash mMarginGroups; // introduced virtual methods: - virtual int calculateAutoMargin(QCP::MarginSide side); + virtual int calculateAutoMargin ( QCP::MarginSide side ); // events: - virtual void mousePressEvent(QMouseEvent* event) {Q_UNUSED(event)} - virtual void mouseMoveEvent(QMouseEvent* event) {Q_UNUSED(event)} - virtual void mouseReleaseEvent(QMouseEvent* event) {Q_UNUSED(event)} - virtual void mouseDoubleClickEvent(QMouseEvent* event) {Q_UNUSED(event)} - virtual void wheelEvent(QWheelEvent* event) {Q_UNUSED(event)} + virtual void mousePressEvent ( QMouseEvent* event ) {Q_UNUSED ( event ) } + virtual void mouseMoveEvent ( QMouseEvent* event ) {Q_UNUSED ( event ) } + virtual void mouseReleaseEvent ( QMouseEvent* event ) {Q_UNUSED ( event ) } + virtual void mouseDoubleClickEvent ( QMouseEvent* event ) {Q_UNUSED ( event ) } + virtual void wheelEvent ( QWheelEvent* event ) {Q_UNUSED ( event ) } // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const { Q_UNUSED(painter) } - virtual void draw(QCPPainter* painter) { Q_UNUSED(painter) } - virtual void parentPlotInitialized(QCustomPlot* parentPlot); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const { Q_UNUSED ( painter ) } + virtual void draw ( QCPPainter* painter ) { Q_UNUSED ( painter ) } + virtual void parentPlotInitialized ( QCustomPlot* parentPlot ); private: - Q_DISABLE_COPY(QCPLayoutElement) + Q_DISABLE_COPY ( QCPLayoutElement ) friend class QCustomPlot; friend class QCPLayout; @@ -739,19 +743,19 @@ public: explicit QCPLayout(); // reimplemented virtual methods: - virtual void update(UpdatePhase phase); - virtual QList elements(bool recursive) const; + virtual void update ( UpdatePhase phase ); + virtual QList elements ( bool recursive ) const; // introduced virtual methods: virtual int elementCount() const = 0; - virtual QCPLayoutElement* elementAt(int index) const = 0; - virtual QCPLayoutElement* takeAt(int index) = 0; - virtual bool take(QCPLayoutElement* element) = 0; + virtual QCPLayoutElement* elementAt ( int index ) const = 0; + virtual QCPLayoutElement* takeAt ( int index ) = 0; + virtual bool take ( QCPLayoutElement* element ) = 0; virtual void simplify(); // non-virtual methods: - bool removeAt(int index); - bool remove(QCPLayoutElement* element); + bool removeAt ( int index ); + bool remove ( QCPLayoutElement* element ); void clear(); protected: @@ -760,13 +764,13 @@ protected: // non-virtual methods: void sizeConstraintsChanged() const; - void adoptElement(QCPLayoutElement* el); - void releaseElement(QCPLayoutElement* el); - QVector getSectionSizes(QVector maxSizes, QVector minSizes, QVector stretchFactors, - int totalSize) const; + void adoptElement ( QCPLayoutElement* el ); + void releaseElement ( QCPLayoutElement* el ); + QVector getSectionSizes ( QVector maxSizes, QVector minSizes, QVector stretchFactors, + int totalSize ) const; private: - Q_DISABLE_COPY(QCPLayout) + Q_DISABLE_COPY ( QCPLayout ) friend class QCPLayoutElement; }; @@ -775,12 +779,12 @@ class QCP_LIB_DECL QCPLayoutGrid : public QCPLayout { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(int rowCount READ rowCount) - Q_PROPERTY(int columnCount READ columnCount) - Q_PROPERTY(QList columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors) - Q_PROPERTY(QList rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors) - Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing) - Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing) + Q_PROPERTY ( int rowCount READ rowCount ) + Q_PROPERTY ( int columnCount READ columnCount ) + Q_PROPERTY ( QList columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors ) + Q_PROPERTY ( QList rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors ) + Q_PROPERTY ( int columnSpacing READ columnSpacing WRITE setColumnSpacing ) + Q_PROPERTY ( int rowSpacing READ rowSpacing WRITE setRowSpacing ) /// \endcond public: explicit QCPLayoutGrid(); @@ -795,31 +799,31 @@ public: int rowSpacing() const { return mRowSpacing; } // setters: - void setColumnStretchFactor(int column, double factor); - void setColumnStretchFactors(const QList& factors); - void setRowStretchFactor(int row, double factor); - void setRowStretchFactors(const QList& factors); - void setColumnSpacing(int pixels); - void setRowSpacing(int pixels); + void setColumnStretchFactor ( int column, double factor ); + void setColumnStretchFactors ( const QList& factors ); + void setRowStretchFactor ( int row, double factor ); + void setRowStretchFactors ( const QList& factors ); + void setColumnSpacing ( int pixels ); + void setRowSpacing ( int pixels ); // reimplemented virtual methods: virtual void updateLayout(); virtual int elementCount() const; - virtual QCPLayoutElement* elementAt(int index) const; - virtual QCPLayoutElement* takeAt(int index); - virtual bool take(QCPLayoutElement* element); - virtual QList elements(bool recursive) const; + virtual QCPLayoutElement* elementAt ( int index ) const; + virtual QCPLayoutElement* takeAt ( int index ); + virtual bool take ( QCPLayoutElement* element ); + virtual QList elements ( bool recursive ) const; virtual void simplify(); virtual QSize minimumSizeHint() const; virtual QSize maximumSizeHint() const; // non-virtual methods: - QCPLayoutElement* element(int row, int column) const; - bool addElement(int row, int column, QCPLayoutElement* element); - bool hasElement(int row, int column); - void expandTo(int newRowCount, int newColumnCount); - void insertRow(int newIndex); - void insertColumn(int newIndex); + QCPLayoutElement* element ( int row, int column ) const; + bool addElement ( int row, int column, QCPLayoutElement* element ); + bool hasElement ( int row, int column ); + void expandTo ( int newRowCount, int newColumnCount ); + void insertRow ( int newIndex ); + void insertColumn ( int newIndex ); protected: // property members: @@ -829,11 +833,11 @@ protected: int mColumnSpacing, mRowSpacing; // non-virtual methods: - void getMinimumRowColSizes(QVector* minColWidths, QVector* minRowHeights) const; - void getMaximumRowColSizes(QVector* maxColWidths, QVector* maxRowHeights) const; + void getMinimumRowColSizes ( QVector* minColWidths, QVector* minRowHeights ) const; + void getMaximumRowColSizes ( QVector* maxColWidths, QVector* maxRowHeights ) const; private: - Q_DISABLE_COPY(QCPLayoutGrid) + Q_DISABLE_COPY ( QCPLayoutGrid ) }; @@ -852,27 +856,27 @@ public: virtual ~QCPLayoutInset(); // getters: - InsetPlacement insetPlacement(int index) const; - Qt::Alignment insetAlignment(int index) const; - QRectF insetRect(int index) const; + InsetPlacement insetPlacement ( int index ) const; + Qt::Alignment insetAlignment ( int index ) const; + QRectF insetRect ( int index ) const; // setters: - void setInsetPlacement(int index, InsetPlacement placement); - void setInsetAlignment(int index, Qt::Alignment alignment); - void setInsetRect(int index, const QRectF& rect); + void setInsetPlacement ( int index, InsetPlacement placement ); + void setInsetAlignment ( int index, Qt::Alignment alignment ); + void setInsetRect ( int index, const QRectF& rect ); // reimplemented virtual methods: virtual void updateLayout(); virtual int elementCount() const; - virtual QCPLayoutElement* elementAt(int index) const; - virtual QCPLayoutElement* takeAt(int index); - virtual bool take(QCPLayoutElement* element); + virtual QCPLayoutElement* elementAt ( int index ) const; + virtual QCPLayoutElement* takeAt ( int index ); + virtual bool take ( QCPLayoutElement* element ); virtual void simplify() {} - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // non-virtual methods: - void addElement(QCPLayoutElement* element, Qt::Alignment alignment); - void addElement(QCPLayoutElement* element, const QRectF& rect); + void addElement ( QCPLayoutElement* element, Qt::Alignment alignment ); + void addElement ( QCPLayoutElement* element, const QRectF& rect ); protected: // property members: @@ -882,7 +886,7 @@ protected: QList mInsetRect; private: - Q_DISABLE_COPY(QCPLayoutInset) + Q_DISABLE_COPY ( QCPLayoutInset ) }; @@ -901,7 +905,7 @@ public: \see QCPItemLine::setHead, QCPItemLine::setTail, QCPItemCurve::setHead, QCPItemCurve::setTail, QCPAxis::setLowerEnding, QCPAxis::setUpperEnding */ - Q_ENUMS(EndingStyle) + Q_ENUMS ( EndingStyle ) enum EndingStyle { esNone ///< No ending decoration , esFlatArrow ///< A filled arrow head with a straight/flat back (a triangle) , esSpikeArrow ///< A filled arrow head with an indented back @@ -915,7 +919,7 @@ public: }; QCPLineEnding(); - QCPLineEnding(EndingStyle style, double width = 8, double length = 10, bool inverted = false); + QCPLineEnding ( EndingStyle style, double width = 8, double length = 10, bool inverted = false ); // getters: EndingStyle style() const { return mStyle; } @@ -924,16 +928,16 @@ public: bool inverted() const { return mInverted; } // setters: - void setStyle(EndingStyle style); - void setWidth(double width); - void setLength(double length); - void setInverted(bool inverted); + void setStyle ( EndingStyle style ); + void setWidth ( double width ); + void setLength ( double length ); + void setInverted ( bool inverted ); // non-property methods: double boundingDistance() const; double realLength() const; - void draw(QCPPainter* painter, const QVector2D& pos, const QVector2D& dir) const; - void draw(QCPPainter* painter, const QVector2D& pos, double angle) const; + void draw ( QCPPainter* painter, const QVector2D& pos, const QVector2D& dir ) const; + void draw ( QCPPainter* painter, const QVector2D& pos, double angle ) const; protected: // property members: @@ -941,22 +945,22 @@ protected: double mWidth, mLength; bool mInverted; }; -Q_DECLARE_TYPEINFO(QCPLineEnding, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPLineEnding, Q_MOVABLE_TYPE ); class QCP_LIB_DECL QCPGrid : public QCPLayerable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(bool subGridVisible READ subGridVisible WRITE setSubGridVisible) - Q_PROPERTY(bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid) - Q_PROPERTY(bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine) - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen) - Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen) + Q_PROPERTY ( bool subGridVisible READ subGridVisible WRITE setSubGridVisible ) + Q_PROPERTY ( bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid ) + Q_PROPERTY ( bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine ) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen subGridPen READ subGridPen WRITE setSubGridPen ) + Q_PROPERTY ( QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen ) /// \endcond public: - QCPGrid(QCPAxis* parentAxis); + QCPGrid ( QCPAxis* parentAxis ); // getters: bool subGridVisible() const { return mSubGridVisible; } @@ -967,12 +971,12 @@ public: QPen zeroLinePen() const { return mZeroLinePen; } // setters: - void setSubGridVisible(bool visible); - void setAntialiasedSubGrid(bool enabled); - void setAntialiasedZeroLine(bool enabled); - void setPen(const QPen& pen); - void setSubGridPen(const QPen& pen); - void setZeroLinePen(const QPen& pen); + void setSubGridVisible ( bool visible ); + void setAntialiasedSubGrid ( bool enabled ); + void setAntialiasedZeroLine ( bool enabled ); + void setPen ( const QPen& pen ); + void setSubGridPen ( const QPen& pen ); + void setZeroLinePen ( const QPen& pen ); protected: // property members: @@ -983,12 +987,12 @@ protected: QCPAxis* mParentAxis; // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ); // non-virtual methods: - void drawGridLines(QCPPainter* painter) const; - void drawSubGridLines(QCPPainter* painter) const; + void drawGridLines ( QCPPainter* painter ) const; + void drawSubGridLines ( QCPPainter* painter ) const; friend class QCPAxis; }; @@ -998,58 +1002,58 @@ class QCP_LIB_DECL QCPAxis : public QCPLayerable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(AxisType axisType READ axisType) - Q_PROPERTY(QCPAxisRect* axisRect READ axisRect) - Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged) - Q_PROPERTY(double scaleLogBase READ scaleLogBase WRITE setScaleLogBase) - Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged) - Q_PROPERTY(bool rangeReversed READ rangeReversed WRITE setRangeReversed) - Q_PROPERTY(bool autoTicks READ autoTicks WRITE setAutoTicks) - Q_PROPERTY(int autoTickCount READ autoTickCount WRITE setAutoTickCount) - Q_PROPERTY(bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels) - Q_PROPERTY(bool autoTickStep READ autoTickStep WRITE setAutoTickStep) - Q_PROPERTY(bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks) - Q_PROPERTY(bool ticks READ ticks WRITE setTicks) - Q_PROPERTY(bool tickLabels READ tickLabels WRITE setTickLabels) - Q_PROPERTY(int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding) - Q_PROPERTY(LabelType tickLabelType READ tickLabelType WRITE setTickLabelType) - Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont) - Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor) - Q_PROPERTY(double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation) - Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide) - Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat) - Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec) - Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat) - Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision) - Q_PROPERTY(double tickStep READ tickStep WRITE setTickStep) - Q_PROPERTY(QVector tickVector READ tickVector WRITE setTickVector) - Q_PROPERTY(QVector tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels) - Q_PROPERTY(int tickLengthIn READ tickLengthIn WRITE setTickLengthIn) - Q_PROPERTY(int tickLengthOut READ tickLengthOut WRITE setTickLengthOut) - Q_PROPERTY(int subTickCount READ subTickCount WRITE setSubTickCount) - Q_PROPERTY(int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn) - Q_PROPERTY(int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut) - Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen) - Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen) - Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen) - Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont) - Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor) - Q_PROPERTY(QString label READ label WRITE setLabel) - Q_PROPERTY(int labelPadding READ labelPadding WRITE setLabelPadding) - Q_PROPERTY(int padding READ padding WRITE setPadding) - Q_PROPERTY(int offset READ offset WRITE setOffset) - Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged) - Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged) - Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont) - Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont) - Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor) - Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor) - Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen) - Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen) - Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen) - Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding) - Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding) - Q_PROPERTY(QCPGrid* grid READ grid) + Q_PROPERTY ( AxisType axisType READ axisType ) + Q_PROPERTY ( QCPAxisRect* axisRect READ axisRect ) + Q_PROPERTY ( ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged ) + Q_PROPERTY ( double scaleLogBase READ scaleLogBase WRITE setScaleLogBase ) + Q_PROPERTY ( QCPRange range READ range WRITE setRange NOTIFY rangeChanged ) + Q_PROPERTY ( bool rangeReversed READ rangeReversed WRITE setRangeReversed ) + Q_PROPERTY ( bool autoTicks READ autoTicks WRITE setAutoTicks ) + Q_PROPERTY ( int autoTickCount READ autoTickCount WRITE setAutoTickCount ) + Q_PROPERTY ( bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels ) + Q_PROPERTY ( bool autoTickStep READ autoTickStep WRITE setAutoTickStep ) + Q_PROPERTY ( bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks ) + Q_PROPERTY ( bool ticks READ ticks WRITE setTicks ) + Q_PROPERTY ( bool tickLabels READ tickLabels WRITE setTickLabels ) + Q_PROPERTY ( int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding ) + Q_PROPERTY ( LabelType tickLabelType READ tickLabelType WRITE setTickLabelType ) + Q_PROPERTY ( QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont ) + Q_PROPERTY ( QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor ) + Q_PROPERTY ( double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation ) + Q_PROPERTY ( LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide ) + Q_PROPERTY ( QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat ) + Q_PROPERTY ( Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec ) + Q_PROPERTY ( QString numberFormat READ numberFormat WRITE setNumberFormat ) + Q_PROPERTY ( int numberPrecision READ numberPrecision WRITE setNumberPrecision ) + Q_PROPERTY ( double tickStep READ tickStep WRITE setTickStep ) + Q_PROPERTY ( QVector tickVector READ tickVector WRITE setTickVector ) + Q_PROPERTY ( QVector tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels ) + Q_PROPERTY ( int tickLengthIn READ tickLengthIn WRITE setTickLengthIn ) + Q_PROPERTY ( int tickLengthOut READ tickLengthOut WRITE setTickLengthOut ) + Q_PROPERTY ( int subTickCount READ subTickCount WRITE setSubTickCount ) + Q_PROPERTY ( int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn ) + Q_PROPERTY ( int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut ) + Q_PROPERTY ( QPen basePen READ basePen WRITE setBasePen ) + Q_PROPERTY ( QPen tickPen READ tickPen WRITE setTickPen ) + Q_PROPERTY ( QPen subTickPen READ subTickPen WRITE setSubTickPen ) + Q_PROPERTY ( QFont labelFont READ labelFont WRITE setLabelFont ) + Q_PROPERTY ( QColor labelColor READ labelColor WRITE setLabelColor ) + Q_PROPERTY ( QString label READ label WRITE setLabel ) + Q_PROPERTY ( int labelPadding READ labelPadding WRITE setLabelPadding ) + Q_PROPERTY ( int padding READ padding WRITE setPadding ) + Q_PROPERTY ( int offset READ offset WRITE setOffset ) + Q_PROPERTY ( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged ) + Q_PROPERTY ( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged ) + Q_PROPERTY ( QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont ) + Q_PROPERTY ( QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont ) + Q_PROPERTY ( QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor ) + Q_PROPERTY ( QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor ) + Q_PROPERTY ( QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen ) + Q_PROPERTY ( QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen ) + Q_PROPERTY ( QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen ) + Q_PROPERTY ( QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding ) + Q_PROPERTY ( QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding ) + Q_PROPERTY ( QCPGrid* grid READ grid ) /// \endcond public: /*! @@ -1061,8 +1065,8 @@ public: , atTop = 0x04 ///< 0x04 Axis is horizontal and on the top side of the axis rect , atBottom = 0x08 ///< 0x08 Axis is horizontal and on the bottom side of the axis rect }; - Q_FLAGS(AxisType AxisTypes) - Q_DECLARE_FLAGS(AxisTypes, AxisType) + Q_FLAGS ( AxisType AxisTypes ) + Q_DECLARE_FLAGS ( AxisTypes, AxisType ) /*! When automatic tick label generation is enabled (\ref setAutoTickLabels), defines how the coordinate of the tick is interpreted, i.e. translated into a string. @@ -1072,7 +1076,7 @@ public: enum LabelType { ltNumber ///< Tick coordinate is regarded as normal number and will be displayed as such. (see \ref setNumberFormat) , ltDateTime ///< Tick coordinate is regarded as a date/time (seconds since 1970-01-01T00:00:00 UTC) and will be displayed and formatted as such. (for details, see \ref setDateTimeFormat) }; - Q_ENUMS(LabelType) + Q_ENUMS ( LabelType ) /*! Defines on which side of the axis the tick labels (numbers) shall appear. @@ -1081,7 +1085,7 @@ public: enum LabelSide { lsInside ///< Tick labels will be displayed inside the axis rect and clipped to the inner axis rect , lsOutside ///< Tick labels will be displayed outside the axis rect }; - Q_ENUMS(LabelSide) + Q_ENUMS ( LabelSide ) /*! Defines the scale of an axis. \see setScaleType @@ -1089,7 +1093,7 @@ public: enum ScaleType { stLinear ///< Linear scaling , stLogarithmic ///< Logarithmic scaling with correspondingly transformed plots and (major) tick marks at every base power (see \ref setScaleLogBase). }; - Q_ENUMS(ScaleType) + Q_ENUMS ( ScaleType ) /*! Defines the selectable parts of an axis. \see setSelectableParts, setSelectedParts @@ -1099,10 +1103,10 @@ public: , spTickLabels = 0x002 ///< Tick labels (numbers) of this axis (as a whole, not individually) , spAxisLabel = 0x004 ///< The axis label }; - Q_FLAGS(SelectablePart SelectableParts) - Q_DECLARE_FLAGS(SelectableParts, SelectablePart) + Q_FLAGS ( SelectablePart SelectableParts ) + Q_DECLARE_FLAGS ( SelectableParts, SelectablePart ) - explicit QCPAxis(QCPAxisRect* parent, AxisType type); + explicit QCPAxis ( QCPAxisRect* parent, AxisType type ); virtual ~QCPAxis(); // getters: @@ -1160,89 +1164,89 @@ public: QCPGrid* grid() const { return mGrid; } // setters: - Q_SLOT void setScaleType(QCPAxis::ScaleType type); - void setScaleLogBase(double base); - Q_SLOT void setRange(const QCPRange& range); - void setRange(double lower, double upper); - void setRange(double position, double size, Qt::AlignmentFlag alignment); - void setRangeLower(double lower); - void setRangeUpper(double upper); - void setRangeReversed(bool reversed); - void setAutoTicks(bool on); - void setAutoTickCount(int approximateCount); - void setAutoTickLabels(bool on); - void setAutoTickStep(bool on); - void setAutoSubTicks(bool on); - void setTicks(bool show); - void setTickLabels(bool show); - void setTickLabelPadding(int padding); - void setTickLabelType(LabelType type); - void setTickLabelFont(const QFont& font); - void setTickLabelColor(const QColor& color); - void setTickLabelRotation(double degrees); - void setTickLabelSide(LabelSide side); - void setDateTimeFormat(const QString& format); - void setDateTimeSpec(const Qt::TimeSpec& timeSpec); - void setNumberFormat(const QString& formatCode); - void setNumberPrecision(int precision); - void setTickStep(double step); - void setTickVector(const QVector& vec); - void setTickVectorLabels(const QVector& vec); - void setTickLength(int inside, int outside = 0); - void setTickLengthIn(int inside); - void setTickLengthOut(int outside); - void setSubTickCount(int count); - void setSubTickLength(int inside, int outside = 0); - void setSubTickLengthIn(int inside); - void setSubTickLengthOut(int outside); - void setBasePen(const QPen& pen); - void setTickPen(const QPen& pen); - void setSubTickPen(const QPen& pen); - void setLabelFont(const QFont& font); - void setLabelColor(const QColor& color); - void setLabel(const QString& str); - void setLabelPadding(int padding); - void setPadding(int padding); - void setOffset(int offset); - void setSelectedTickLabelFont(const QFont& font); - void setSelectedLabelFont(const QFont& font); - void setSelectedTickLabelColor(const QColor& color); - void setSelectedLabelColor(const QColor& color); - void setSelectedBasePen(const QPen& pen); - void setSelectedTickPen(const QPen& pen); - void setSelectedSubTickPen(const QPen& pen); - Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts& selectableParts); - Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts& selectedParts); - void setLowerEnding(const QCPLineEnding& ending); - void setUpperEnding(const QCPLineEnding& ending); + Q_SLOT void setScaleType ( QCPAxis::ScaleType type ); + void setScaleLogBase ( double base ); + Q_SLOT void setRange ( const QCPRange& range ); + void setRange ( double lower, double upper ); + void setRange ( double position, double size, Qt::AlignmentFlag alignment ); + void setRangeLower ( double lower ); + void setRangeUpper ( double upper ); + void setRangeReversed ( bool reversed ); + void setAutoTicks ( bool on ); + void setAutoTickCount ( int approximateCount ); + void setAutoTickLabels ( bool on ); + void setAutoTickStep ( bool on ); + void setAutoSubTicks ( bool on ); + void setTicks ( bool show ); + void setTickLabels ( bool show ); + void setTickLabelPadding ( int padding ); + void setTickLabelType ( LabelType type ); + void setTickLabelFont ( const QFont& font ); + void setTickLabelColor ( const QColor& color ); + void setTickLabelRotation ( double degrees ); + void setTickLabelSide ( LabelSide side ); + void setDateTimeFormat ( const QString& format ); + void setDateTimeSpec ( const Qt::TimeSpec& timeSpec ); + void setNumberFormat ( const QString& formatCode ); + void setNumberPrecision ( int precision ); + void setTickStep ( double step ); + void setTickVector ( const QVector& vec ); + void setTickVectorLabels ( const QVector& vec ); + void setTickLength ( int inside, int outside = 0 ); + void setTickLengthIn ( int inside ); + void setTickLengthOut ( int outside ); + void setSubTickCount ( int count ); + void setSubTickLength ( int inside, int outside = 0 ); + void setSubTickLengthIn ( int inside ); + void setSubTickLengthOut ( int outside ); + void setBasePen ( const QPen& pen ); + void setTickPen ( const QPen& pen ); + void setSubTickPen ( const QPen& pen ); + void setLabelFont ( const QFont& font ); + void setLabelColor ( const QColor& color ); + void setLabel ( const QString& str ); + void setLabelPadding ( int padding ); + void setPadding ( int padding ); + void setOffset ( int offset ); + void setSelectedTickLabelFont ( const QFont& font ); + void setSelectedLabelFont ( const QFont& font ); + void setSelectedTickLabelColor ( const QColor& color ); + void setSelectedLabelColor ( const QColor& color ); + void setSelectedBasePen ( const QPen& pen ); + void setSelectedTickPen ( const QPen& pen ); + void setSelectedSubTickPen ( const QPen& pen ); + Q_SLOT void setSelectableParts ( const QCPAxis::SelectableParts& selectableParts ); + Q_SLOT void setSelectedParts ( const QCPAxis::SelectableParts& selectedParts ); + void setLowerEnding ( const QCPLineEnding& ending ); + void setUpperEnding ( const QCPLineEnding& ending ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // non-property methods: Qt::Orientation orientation() const { return mOrientation; } - void moveRange(double diff); - void scaleRange(double factor, double center); - void setScaleRatio(const QCPAxis* otherAxis, double ratio = 1.0); - void rescale(bool onlyVisiblePlottables = false); - double pixelToCoord(double value) const; - double coordToPixel(double value) const; - SelectablePart getPartAt(const QPointF& pos) const; + void moveRange ( double diff ); + void scaleRange ( double factor, double center ); + void setScaleRatio ( const QCPAxis* otherAxis, double ratio = 1.0 ); + void rescale ( bool onlyVisiblePlottables = false ); + double pixelToCoord ( double value ) const; + double coordToPixel ( double value ) const; + SelectablePart getPartAt ( const QPointF& pos ) const; QList plottables() const; QList graphs() const; QList items() const; - static AxisType marginSideToAxisType(QCP::MarginSide side); - static Qt::Orientation orientation(AxisType type) { return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical; } - static AxisType opposite(AxisType type); + static AxisType marginSideToAxisType ( QCP::MarginSide side ); + static Qt::Orientation orientation ( AxisType type ) { return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical; } + static AxisType opposite ( AxisType type ); signals: void ticksRequest(); - void rangeChanged(const QCPRange& newRange); - void rangeChanged(const QCPRange& newRange, const QCPRange& oldRange); - void scaleTypeChanged(QCPAxis::ScaleType scaleType); - void selectionChanged(const QCPAxis::SelectableParts& parts); - void selectableChanged(const QCPAxis::SelectableParts& parts); + void rangeChanged ( const QCPRange& newRange ); + void rangeChanged ( const QCPRange& newRange, const QCPRange& oldRange ); + void scaleTypeChanged ( QCPAxis::ScaleType scaleType ); + void selectionChanged ( const QCPAxis::SelectableParts& parts ); + void selectableChanged ( const QCPAxis::SelectableParts& parts ); protected: // property members: @@ -1300,21 +1304,21 @@ protected: // introduced virtual methods: virtual void setupTickVectors(); virtual void generateAutoTicks(); - virtual int calculateAutoSubTickCount(double tickStep) const; + virtual int calculateAutoSubTickCount ( double tickStep ) const; virtual int calculateMargin(); // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ); virtual QCP::Interaction selectionCategory() const; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // non-virtual methods: - void visibleTickBounds(int& lowIndex, int& highIndex) const; - double baseLog(double value) const; - double basePow(double value) const; + void visibleTickBounds ( int& lowIndex, int& highIndex ) const; + double baseLog ( double value ) const; + double basePow ( double value ) const; QPen getBasePen() const; QPen getTickPen() const; QPen getSubTickPen() const; @@ -1324,24 +1328,24 @@ protected: QColor getLabelColor() const; private: - Q_DISABLE_COPY(QCPAxis) + Q_DISABLE_COPY ( QCPAxis ) friend class QCustomPlot; friend class QCPGrid; friend class QCPAxisRect; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts) -Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes) -Q_DECLARE_METATYPE(QCPAxis::SelectablePart) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCPAxis::SelectableParts ) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCPAxis::AxisTypes ) +Q_DECLARE_METATYPE ( QCPAxis::SelectablePart ) class QCPAxisPainterPrivate { public: - explicit QCPAxisPainterPrivate(QCustomPlot* parentPlot); + explicit QCPAxisPainterPrivate ( QCustomPlot* parentPlot ); virtual ~QCPAxisPainterPrivate(); - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); virtual int size() const; void clearCache(); @@ -1394,12 +1398,12 @@ protected: virtual QByteArray generateLabelParameterHash() const; - virtual void placeTickLabel(QCPPainter* painter, double position, int distanceToAxis, const QString& text, - QSize* tickLabelsSize); - virtual void drawTickLabel(QCPPainter* painter, double x, double y, const TickLabelData& labelData) const; - virtual TickLabelData getTickLabelData(const QFont& font, const QString& text) const; - virtual QPointF getTickLabelDrawOffset(const TickLabelData& labelData) const; - virtual void getMaxTickLabelSize(const QFont& font, const QString& text, QSize* tickLabelsSize) const; + virtual void placeTickLabel ( QCPPainter* painter, double position, int distanceToAxis, const QString& text, + QSize* tickLabelsSize ); + virtual void drawTickLabel ( QCPPainter* painter, double x, double y, const TickLabelData& labelData ) const; + virtual TickLabelData getTickLabelData ( const QFont& font, const QString& text ) const; + virtual QPointF getTickLabelDrawOffset ( const TickLabelData& labelData ) const; + virtual void getMaxTickLabelSize ( const QFont& font, const QString& text, QSize* tickLabelsSize ) const; }; @@ -1407,21 +1411,21 @@ class QCP_LIB_DECL QCPAbstractPlottable : public QCPLayerable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill) - Q_PROPERTY(bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters) - Q_PROPERTY(bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars) - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) - Q_PROPERTY(QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis) - Q_PROPERTY(QCPAxis* valueAxis READ valueAxis WRITE setValueAxis) - Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged) - Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged) + Q_PROPERTY ( QString name READ name WRITE setName ) + Q_PROPERTY ( bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill ) + Q_PROPERTY ( bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters ) + Q_PROPERTY ( bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars ) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) + Q_PROPERTY ( QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis ) + Q_PROPERTY ( QCPAxis* valueAxis READ valueAxis WRITE setValueAxis ) + Q_PROPERTY ( bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged ) + Q_PROPERTY ( bool selected READ selected WRITE setSelected NOTIFY selectionChanged ) /// \endcond public: - QCPAbstractPlottable(QCPAxis* keyAxis, QCPAxis* valueAxis); + QCPAbstractPlottable ( QCPAxis* keyAxis, QCPAxis* valueAxis ); // getters: QString name() const { return mName; } @@ -1438,33 +1442,33 @@ public: bool selected() const { return mSelected; } // setters: - void setName(const QString& name); - void setAntialiasedFill(bool enabled); - void setAntialiasedScatters(bool enabled); - void setAntialiasedErrorBars(bool enabled); - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setSelectedBrush(const QBrush& brush); - void setKeyAxis(QCPAxis* axis); - void setValueAxis(QCPAxis* axis); - Q_SLOT void setSelectable(bool selectable); - Q_SLOT void setSelected(bool selected); + void setName ( const QString& name ); + void setAntialiasedFill ( bool enabled ); + void setAntialiasedScatters ( bool enabled ); + void setAntialiasedErrorBars ( bool enabled ); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setSelectedBrush ( const QBrush& brush ); + void setKeyAxis ( QCPAxis* axis ); + void setValueAxis ( QCPAxis* axis ); + Q_SLOT void setSelectable ( bool selectable ); + Q_SLOT void setSelected ( bool selected ); // introduced virtual methods: virtual void clearData() = 0; - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const = 0; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const = 0; virtual bool addToLegend(); virtual bool removeFromLegend() const; // non-property methods: - void rescaleAxes(bool onlyEnlarge = false) const; - void rescaleKeyAxis(bool onlyEnlarge = false) const; - void rescaleValueAxis(bool onlyEnlarge = false) const; + void rescaleAxes ( bool onlyEnlarge = false ) const; + void rescaleKeyAxis ( bool onlyEnlarge = false ) const; + void rescaleValueAxis ( bool onlyEnlarge = false ) const; signals: - void selectionChanged(bool selected); - void selectableChanged(bool selectable); + void selectionChanged ( bool selected ); + void selectableChanged ( bool selectable ); protected: /*! @@ -1485,32 +1489,32 @@ protected: // reimplemented virtual methods: virtual QRect clipRect() const; - virtual void draw(QCPPainter* painter) = 0; + virtual void draw ( QCPPainter* painter ) = 0; virtual QCP::Interaction selectionCategory() const; - void applyDefaultAntialiasingHint(QCPPainter* painter) const; + void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // introduced virtual methods: - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const = 0; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const = 0; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const = 0; + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const = 0; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const = 0; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const = 0; // non-virtual methods: - void coordsToPixels(double key, double value, double& x, double& y) const; - const QPointF coordsToPixels(double key, double value) const; - void pixelsToCoords(double x, double y, double& key, double& value) const; - void pixelsToCoords(const QPointF& pixelPos, double& key, double& value) const; + void coordsToPixels ( double key, double value, double& x, double& y ) const; + const QPointF coordsToPixels ( double key, double value ) const; + void pixelsToCoords ( double x, double y, double& key, double& value ) const; + void pixelsToCoords ( const QPointF& pixelPos, double& key, double& value ) const; QPen mainPen() const; QBrush mainBrush() const; - void applyFillAntialiasingHint(QCPPainter* painter) const; - void applyScattersAntialiasingHint(QCPPainter* painter) const; - void applyErrorBarsAntialiasingHint(QCPPainter* painter) const; - double distSqrToLine(const QPointF& start, const QPointF& end, const QPointF& point) const; + void applyFillAntialiasingHint ( QCPPainter* painter ) const; + void applyScattersAntialiasingHint ( QCPPainter* painter ) const; + void applyErrorBarsAntialiasingHint ( QCPPainter* painter ) const; + double distSqrToLine ( const QPointF& start, const QPointF& end, const QPointF& point ) const; private: - Q_DISABLE_COPY(QCPAbstractPlottable) + Q_DISABLE_COPY ( QCPAbstractPlottable ) friend class QCustomPlot; friend class QCPAxis; @@ -1521,7 +1525,7 @@ private: class QCP_LIB_DECL QCPItemAnchor { public: - QCPItemAnchor(QCustomPlot* parentPlot, QCPAbstractItem* parentItem, const QString name, int anchorId = -1); + QCPItemAnchor ( QCustomPlot* parentPlot, QCPAbstractItem* parentItem, const QString name, int anchorId = -1 ); virtual ~QCPItemAnchor(); // getters: @@ -1542,13 +1546,13 @@ protected: virtual QCPItemPosition* toQCPItemPosition() { return 0; } // non-virtual methods: - void addChildX(QCPItemPosition* pos); // called from pos when this anchor is set as parent - void removeChildX(QCPItemPosition* pos); // called from pos when its parent anchor is reset or pos deleted - void addChildY(QCPItemPosition* pos); // called from pos when this anchor is set as parent - void removeChildY(QCPItemPosition* pos); // called from pos when its parent anchor is reset or pos deleted + void addChildX ( QCPItemPosition* pos ); // called from pos when this anchor is set as parent + void removeChildX ( QCPItemPosition* pos ); // called from pos when its parent anchor is reset or pos deleted + void addChildY ( QCPItemPosition* pos ); // called from pos when this anchor is set as parent + void removeChildY ( QCPItemPosition* pos ); // called from pos when its parent anchor is reset or pos deleted private: - Q_DISABLE_COPY(QCPItemAnchor) + Q_DISABLE_COPY ( QCPItemAnchor ) friend class QCPItemPosition; }; @@ -1574,7 +1578,7 @@ public: , ptPlotCoords ///< Dynamic positioning at a plot coordinate defined by two axes (see \ref setAxes). }; - QCPItemPosition(QCustomPlot* parentPlot, QCPAbstractItem* parentItem, const QString name); + QCPItemPosition ( QCustomPlot* parentPlot, QCPAbstractItem* parentItem, const QString name ); virtual ~QCPItemPosition(); // getters: @@ -1586,24 +1590,24 @@ public: QCPItemAnchor* parentAnchorY() const { return mParentAnchorY; } double key() const { return mKey; } double value() const { return mValue; } - QPointF coords() const { return QPointF(mKey, mValue); } + QPointF coords() const { return QPointF ( mKey, mValue ); } QCPAxis* keyAxis() const { return mKeyAxis.data(); } QCPAxis* valueAxis() const { return mValueAxis.data(); } QCPAxisRect* axisRect() const; virtual QPointF pixelPoint() const; // setters: - void setType(PositionType type); - void setTypeX(PositionType type); - void setTypeY(PositionType type); - bool setParentAnchor(QCPItemAnchor* parentAnchor, bool keepPixelPosition = false); - bool setParentAnchorX(QCPItemAnchor* parentAnchor, bool keepPixelPosition = false); - bool setParentAnchorY(QCPItemAnchor* parentAnchor, bool keepPixelPosition = false); - void setCoords(double key, double value); - void setCoords(const QPointF& coords); - void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis); - void setAxisRect(QCPAxisRect* axisRect); - void setPixelPoint(const QPointF& pixelPoint); + void setType ( PositionType type ); + void setTypeX ( PositionType type ); + void setTypeY ( PositionType type ); + bool setParentAnchor ( QCPItemAnchor* parentAnchor, bool keepPixelPosition = false ); + bool setParentAnchorX ( QCPItemAnchor* parentAnchor, bool keepPixelPosition = false ); + bool setParentAnchorY ( QCPItemAnchor* parentAnchor, bool keepPixelPosition = false ); + void setCoords ( double key, double value ); + void setCoords ( const QPointF& coords ); + void setAxes ( QCPAxis* keyAxis, QCPAxis* valueAxis ); + void setAxisRect ( QCPAxisRect* axisRect ); + void setPixelPoint ( const QPointF& pixelPoint ); protected: // property members: @@ -1617,7 +1621,7 @@ protected: virtual QCPItemPosition* toQCPItemPosition() { return this; } private: - Q_DISABLE_COPY(QCPItemPosition) + Q_DISABLE_COPY ( QCPItemPosition ) }; @@ -1626,13 +1630,13 @@ class QCP_LIB_DECL QCPAbstractItem : public QCPLayerable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect) - Q_PROPERTY(QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect) - Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged) - Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged) + Q_PROPERTY ( bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect ) + Q_PROPERTY ( QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect ) + Q_PROPERTY ( bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged ) + Q_PROPERTY ( bool selected READ selected WRITE setSelected NOTIFY selectionChanged ) /// \endcond public: - QCPAbstractItem(QCustomPlot* parentPlot); + QCPAbstractItem ( QCustomPlot* parentPlot ); virtual ~QCPAbstractItem(); // getters: @@ -1642,24 +1646,24 @@ public: bool selected() const { return mSelected; } // setters: - void setClipToAxisRect(bool clip); - void setClipAxisRect(QCPAxisRect* rect); - Q_SLOT void setSelectable(bool selectable); - Q_SLOT void setSelected(bool selected); + void setClipToAxisRect ( bool clip ); + void setClipAxisRect ( QCPAxisRect* rect ); + Q_SLOT void setSelectable ( bool selectable ); + Q_SLOT void setSelected ( bool selected ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const = 0; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const = 0; // non-virtual methods: QList positions() const { return mPositions; } QList anchors() const { return mAnchors; } - QCPItemPosition* position(const QString& name) const; - QCPItemAnchor* anchor(const QString& name) const; - bool hasAnchor(const QString& name) const; + QCPItemPosition* position ( const QString& name ) const; + QCPItemAnchor* anchor ( const QString& name ) const; + bool hasAnchor ( const QString& name ) const; signals: - void selectionChanged(bool selected); - void selectableChanged(bool selectable); + void selectionChanged ( bool selected ); + void selectableChanged ( bool selectable ); protected: // property members: @@ -1672,23 +1676,23 @@ protected: // reimplemented virtual methods: virtual QCP::Interaction selectionCategory() const; virtual QRect clipRect() const; - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter) = 0; + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ) = 0; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // introduced virtual methods: - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: - double distSqrToLine(const QPointF& start, const QPointF& end, const QPointF& point) const; - double rectSelectTest(const QRectF& rect, const QPointF& pos, bool filledRect) const; - QCPItemPosition* createPosition(const QString& name); - QCPItemAnchor* createAnchor(const QString& name, int anchorId); + double distSqrToLine ( const QPointF& start, const QPointF& end, const QPointF& point ) const; + double rectSelectTest ( const QRectF& rect, const QPointF& pos, bool filledRect ) const; + QCPItemPosition* createPosition ( const QString& name ); + QCPItemAnchor* createAnchor ( const QString& name, int anchorId ); private: - Q_DISABLE_COPY(QCPAbstractItem) + Q_DISABLE_COPY ( QCPAbstractItem ) friend class QCustomPlot; friend class QCPItemAnchor; @@ -1699,15 +1703,15 @@ class QCP_LIB_DECL QCustomPlot : public QWidget { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QRect viewport READ viewport WRITE setViewport) - Q_PROPERTY(QPixmap background READ background WRITE setBackground) - Q_PROPERTY(bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled) - Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode) - Q_PROPERTY(QCPLayoutGrid* plotLayout READ plotLayout) - Q_PROPERTY(bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend) - Q_PROPERTY(int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance) - Q_PROPERTY(bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag) - Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier) + Q_PROPERTY ( QRect viewport READ viewport WRITE setViewport ) + Q_PROPERTY ( QPixmap background READ background WRITE setBackground ) + Q_PROPERTY ( bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled ) + Q_PROPERTY ( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode ) + Q_PROPERTY ( QCPLayoutGrid* plotLayout READ plotLayout ) + Q_PROPERTY ( bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend ) + Q_PROPERTY ( int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance ) + Q_PROPERTY ( bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag ) + Q_PROPERTY ( Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier ) /// \endcond public: /*! @@ -1718,7 +1722,7 @@ public: enum LayerInsertMode { limBelow ///< Layer is inserted below other layer , limAbove ///< Layer is inserted above other layer }; - Q_ENUMS(LayerInsertMode) + Q_ENUMS ( LayerInsertMode ) /*! Defines with what timing the QCustomPlot surface is refreshed after a replot. @@ -1730,7 +1734,7 @@ public: , rpHint ///< Whether to use immediate repaint or queued update depends on whether the plotting hint \ref QCP::phForceRepaint is set, see \ref setPlottingHints. }; - explicit QCustomPlot(QWidget* parent = 0); + explicit QCustomPlot ( QWidget* parent = 0 ); virtual ~QCustomPlot(); // getters: @@ -1749,112 +1753,113 @@ public: Qt::KeyboardModifier multiSelectModifier() const { return mMultiSelectModifier; } // setters: - void setViewport(const QRect& rect); - void setBackground(const QPixmap& pm); - void setBackground(const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding); - void setBackground(const QBrush& brush); - void setBackgroundScaled(bool scaled); - void setBackgroundScaledMode(Qt::AspectRatioMode mode); - void setAntialiasedElements(const QCP::AntialiasedElements& antialiasedElements); - void setAntialiasedElement(QCP::AntialiasedElement antialiasedElement, bool enabled = true); - void setNotAntialiasedElements(const QCP::AntialiasedElements& notAntialiasedElements); - void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled = true); - void setAutoAddPlottableToLegend(bool on); - void setInteractions(const QCP::Interactions& interactions); - void setInteraction(const QCP::Interaction& interaction, bool enabled = true); - void setSelectionTolerance(int pixels); - void setNoAntialiasingOnDrag(bool enabled); - void setPlottingHints(const QCP::PlottingHints& hints); - void setPlottingHint(QCP::PlottingHint hint, bool enabled = true); - void setMultiSelectModifier(Qt::KeyboardModifier modifier); + void setViewport ( const QRect& rect ); + void setBackground ( const QPixmap& pm ); + void setBackground ( const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding ); + void setBackground ( const QBrush& brush ); + void setBackgroundScaled ( bool scaled ); + void setBackgroundScaledMode ( Qt::AspectRatioMode mode ); + void setAntialiasedElements ( const QCP::AntialiasedElements& antialiasedElements ); + void setAntialiasedElement ( QCP::AntialiasedElement antialiasedElement, bool enabled = true ); + void setNotAntialiasedElements ( const QCP::AntialiasedElements& notAntialiasedElements ); + void setNotAntialiasedElement ( QCP::AntialiasedElement notAntialiasedElement, bool enabled = true ); + void setAutoAddPlottableToLegend ( bool on ); + void setInteractions ( const QCP::Interactions& interactions ); + void setInteraction ( const QCP::Interaction& interaction, bool enabled = true ); + void setSelectionTolerance ( int pixels ); + void setNoAntialiasingOnDrag ( bool enabled ); + void setPlottingHints ( const QCP::PlottingHints& hints ); + void setPlottingHint ( QCP::PlottingHint hint, bool enabled = true ); + void setMultiSelectModifier ( Qt::KeyboardModifier modifier ); // non-property methods: // plottable interface: - QCPAbstractPlottable* plottable(int index); + QCPAbstractPlottable* plottable ( int index ); QCPAbstractPlottable* plottable(); - bool addPlottable(QCPAbstractPlottable* plottable); - bool removePlottable(QCPAbstractPlottable* plottable); - bool removePlottable(int index); + bool addPlottable ( QCPAbstractPlottable* plottable ); + bool removePlottable ( QCPAbstractPlottable* plottable ); + bool removePlottable ( int index ); int clearPlottables(); int plottableCount() const; QList selectedPlottables() const; - QCPAbstractPlottable* plottableAt(const QPointF& pos, bool onlySelectable = false) const; - bool hasPlottable(QCPAbstractPlottable* plottable) const; + QCPAbstractPlottable* plottableAt ( const QPointF& pos, bool onlySelectable = false ) const; + bool hasPlottable ( QCPAbstractPlottable* plottable ) const; // specialized interface for QCPGraph: - QCPGraph* graph(int index) const; + QCPGraph* graph ( int index ) const; QCPGraph* graph() const; - QCPGraph* addGraph(QCPAxis* keyAxis = 0, QCPAxis* valueAxis = 0); - bool removeGraph(QCPGraph* graph); - bool removeGraph(int index); + QCPGraph* addGraph ( QCPAxis* keyAxis = 0, QCPAxis* valueAxis = 0 ); + bool removeGraph ( QCPGraph* graph ); + bool removeGraph ( int index ); int clearGraphs(); int graphCount() const; QList selectedGraphs() const; // item interface: - QCPAbstractItem* item(int index) const; + QCPAbstractItem* item ( int index ) const; QCPAbstractItem* item() const; - bool addItem(QCPAbstractItem* item); - bool removeItem(QCPAbstractItem* item); - bool removeItem(int index); + bool addItem ( QCPAbstractItem* item ); + bool removeItem ( QCPAbstractItem* item ); + bool removeItem ( int index ); int clearItems(); int itemCount() const; QList selectedItems() const; - QCPAbstractItem* itemAt(const QPointF& pos, bool onlySelectable = false) const; - bool hasItem(QCPAbstractItem* item) const; + QCPAbstractItem* itemAt ( const QPointF& pos, bool onlySelectable = false ) const; + bool hasItem ( QCPAbstractItem* item ) const; // layer interface: - QCPLayer* layer(const QString& name) const; - QCPLayer* layer(int index) const; + QCPLayer* layer ( const QString& name ) const; + QCPLayer* layer ( int index ) const; QCPLayer* currentLayer() const; - bool setCurrentLayer(const QString& name); - bool setCurrentLayer(QCPLayer* layer); + bool setCurrentLayer ( const QString& name ); + bool setCurrentLayer ( QCPLayer* layer ); int layerCount() const; - bool addLayer(const QString& name, QCPLayer* otherLayer = 0, LayerInsertMode insertMode = limAbove); - bool removeLayer(QCPLayer* layer); - bool moveLayer(QCPLayer* layer, QCPLayer* otherLayer, LayerInsertMode insertMode = limAbove); + bool addLayer ( const QString& name, QCPLayer* otherLayer = 0, LayerInsertMode insertMode = limAbove ); + bool removeLayer ( QCPLayer* layer ); + bool moveLayer ( QCPLayer* layer, QCPLayer* otherLayer, LayerInsertMode insertMode = limAbove ); // axis rect/layout interface: int axisRectCount() const; - QCPAxisRect* axisRect(int index = 0) const; + QCPAxisRect* axisRect ( int index = 0 ) const; QList axisRects() const; - QCPLayoutElement* layoutElementAt(const QPointF& pos) const; - Q_SLOT void rescaleAxes(bool onlyVisiblePlottables = false); + QCPLayoutElement* layoutElementAt ( const QPointF& pos ) const; + Q_SLOT void rescaleAxes ( bool onlyVisiblePlottables = false ); QList selectedAxes() const; QList selectedLegends() const; Q_SLOT void deselectAll(); - bool savePdf(const QString& fileName, bool noCosmeticPen = false, int width = 0, int height = 0, - const QString& pdfCreator = QString(), const QString& pdfTitle = QString()); - bool savePng(const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1); - bool saveJpg(const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1); - bool saveBmp(const QString& fileName, int width = 0, int height = 0, double scale = 1.0); - bool saveRastered(const QString& fileName, int width, int height, double scale, const char* format, int quality = -1); - QPixmap toPixmap(int width = 0, int height = 0, double scale = 1.0); - void toPainter(QCPPainter* painter, int width = 0, int height = 0); - Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority = QCustomPlot::rpHint); + bool savePdf ( const QString& fileName, bool noCosmeticPen = false, int width = 0, int height = 0, + const QString& pdfCreator = QString(), const QString& pdfTitle = QString() ); + bool savePng ( const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1 ); + bool saveJpg ( const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1 ); + bool saveBmp ( const QString& fileName, int width = 0, int height = 0, double scale = 1.0 ); + bool saveRastered ( const QString& fileName, int width, int height, double scale, const char* format, + int quality = -1 ); + QPixmap toPixmap ( int width = 0, int height = 0, double scale = 1.0 ); + void toPainter ( QCPPainter* painter, int width = 0, int height = 0 ); + Q_SLOT void replot ( QCustomPlot::RefreshPriority refreshPriority = QCustomPlot::rpHint ); QCPAxis* xAxis, *yAxis, *xAxis2, *yAxis2; QCPLegend* legend; signals: - void mouseDoubleClick(QMouseEvent* event); - void mousePress(QMouseEvent* event); - void mouseMove(QMouseEvent* event); - void mouseRelease(QMouseEvent* event); - void mouseWheel(QWheelEvent* event); + void mouseDoubleClick ( QMouseEvent* event ); + void mousePress ( QMouseEvent* event ); + void mouseMove ( QMouseEvent* event ); + void mouseRelease ( QMouseEvent* event ); + void mouseWheel ( QWheelEvent* event ); - void plottableClick(QCPAbstractPlottable* plottable, QMouseEvent* event); - void plottableDoubleClick(QCPAbstractPlottable* plottable, QMouseEvent* event); - void itemClick(QCPAbstractItem* item, QMouseEvent* event); - void itemDoubleClick(QCPAbstractItem* item, QMouseEvent* event); - void axisClick(QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event); - void axisDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event); - void legendClick(QCPLegend* legend, QCPAbstractLegendItem* item, QMouseEvent* event); - void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item, QMouseEvent* event); - void titleClick(QMouseEvent* event, QCPPlotTitle* title); - void titleDoubleClick(QMouseEvent* event, QCPPlotTitle* title); + void plottableClick ( QCPAbstractPlottable* plottable, QMouseEvent* event ); + void plottableDoubleClick ( QCPAbstractPlottable* plottable, QMouseEvent* event ); + void itemClick ( QCPAbstractItem* item, QMouseEvent* event ); + void itemDoubleClick ( QCPAbstractItem* item, QMouseEvent* event ); + void axisClick ( QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event ); + void axisDoubleClick ( QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event ); + void legendClick ( QCPLegend* legend, QCPAbstractLegendItem* item, QMouseEvent* event ); + void legendDoubleClick ( QCPLegend* legend, QCPAbstractLegendItem* item, QMouseEvent* event ); + void titleClick ( QMouseEvent* event, QCPPlotTitle* title ); + void titleDoubleClick ( QMouseEvent* event, QCPPlotTitle* title ); void selectionChangedByUser(); void beforeReplot(); @@ -1891,23 +1896,23 @@ protected: // reimplemented virtual methods: virtual QSize minimumSizeHint() const; virtual QSize sizeHint() const; - virtual void paintEvent(QPaintEvent* event); - virtual void resizeEvent(QResizeEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* event); - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseMoveEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void wheelEvent(QWheelEvent* event); + virtual void paintEvent ( QPaintEvent* event ); + virtual void resizeEvent ( QResizeEvent* event ); + virtual void mouseDoubleClickEvent ( QMouseEvent* event ); + virtual void mousePressEvent ( QMouseEvent* event ); + virtual void mouseMoveEvent ( QMouseEvent* event ); + virtual void mouseReleaseEvent ( QMouseEvent* event ); + virtual void wheelEvent ( QWheelEvent* event ); // introduced virtual methods: - virtual void draw(QCPPainter* painter); - virtual void axisRemoved(QCPAxis* axis); - virtual void legendRemoved(QCPLegend* legend); + virtual void draw ( QCPPainter* painter ); + virtual void axisRemoved ( QCPAxis* axis ); + virtual void legendRemoved ( QCPLegend* legend ); // non-virtual methods: void updateLayerIndices() const; - QCPLayerable* layerableAt(const QPointF& pos, bool onlySelectable, QVariant* selectionDetails = 0) const; - void drawBackground(QCPPainter* painter); + QCPLayerable* layerableAt ( const QPointF& pos, bool onlySelectable, QVariant* selectionDetails = 0 ) const; + void drawBackground ( QCPPainter* painter ); friend class QCPLegend; friend class QCPAxis; @@ -1928,7 +1933,7 @@ public: enum ColorInterpolation { ciRGB ///< Color channels red, green and blue are linearly interpolated , ciHSV ///< Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the shortest angle distance) }; - Q_ENUMS(ColorInterpolation) + Q_ENUMS ( ColorInterpolation ) /*! Defines the available presets that can be loaded with \ref loadPreset. See the documentation @@ -1947,11 +1952,11 @@ public: , gpJet ///< Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion but allows more precise magnitude estimates) , gpHues ///< Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and phases, see \ref setPeriodic) }; - Q_ENUMS(GradientPreset) + Q_ENUMS ( GradientPreset ) - QCPColorGradient(GradientPreset preset = gpCold); - bool operator==(const QCPColorGradient& other) const; - bool operator!=(const QCPColorGradient& other) const { return !(*this == other); } + QCPColorGradient ( GradientPreset preset = gpCold ); + bool operator== ( const QCPColorGradient& other ) const; + bool operator!= ( const QCPColorGradient& other ) const { return ! ( *this == other ); } // getters: int levelCount() const { return mLevelCount; } @@ -1960,17 +1965,17 @@ public: bool periodic() const { return mPeriodic; } // setters: - void setLevelCount(int n); - void setColorStops(const QMap& colorStops); - void setColorStopAt(double position, const QColor& color); - void setColorInterpolation(ColorInterpolation interpolation); - void setPeriodic(bool enabled); + void setLevelCount ( int n ); + void setColorStops ( const QMap& colorStops ); + void setColorStopAt ( double position, const QColor& color ); + void setColorInterpolation ( ColorInterpolation interpolation ); + void setPeriodic ( bool enabled ); // non-property methods: - void colorize(const double* data, const QCPRange& range, QRgb* scanLine, int n, int dataIndexFactor = 1, - bool logarithmic = false); - QRgb color(double position, const QCPRange& range, bool logarithmic = false); - void loadPreset(GradientPreset preset); + void colorize ( const double* data, const QCPRange& range, QRgb* scanLine, int n, int dataIndexFactor = 1, + bool logarithmic = false ); + QRgb color ( double position, const QCPRange& range, bool logarithmic = false ); + void loadPreset ( GradientPreset preset ); void clearColorStops(); QCPColorGradient inverted() const; @@ -1993,14 +1998,14 @@ class QCP_LIB_DECL QCPAxisRect : public QCPLayoutElement { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPixmap background READ background WRITE setBackground) - Q_PROPERTY(bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled) - Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode) - Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag) - Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom) + Q_PROPERTY ( QPixmap background READ background WRITE setBackground ) + Q_PROPERTY ( bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled ) + Q_PROPERTY ( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode ) + Q_PROPERTY ( Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag ) + Q_PROPERTY ( Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom ) /// \endcond public: - explicit QCPAxisRect(QCustomPlot* parentPlot, bool setupDefaultAxes = true); + explicit QCPAxisRect ( QCustomPlot* parentPlot, bool setupDefaultAxes = true ); virtual ~QCPAxisRect(); // getters: @@ -2009,34 +2014,34 @@ public: Qt::AspectRatioMode backgroundScaledMode() const { return mBackgroundScaledMode; } Qt::Orientations rangeDrag() const { return mRangeDrag; } Qt::Orientations rangeZoom() const { return mRangeZoom; } - QCPAxis* rangeDragAxis(Qt::Orientation orientation); - QCPAxis* rangeZoomAxis(Qt::Orientation orientation); - double rangeZoomFactor(Qt::Orientation orientation); + QCPAxis* rangeDragAxis ( Qt::Orientation orientation ); + QCPAxis* rangeZoomAxis ( Qt::Orientation orientation ); + double rangeZoomFactor ( Qt::Orientation orientation ); // setters: - void setBackground(const QPixmap& pm); - void setBackground(const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding); - void setBackground(const QBrush& brush); - void setBackgroundScaled(bool scaled); - void setBackgroundScaledMode(Qt::AspectRatioMode mode); - void setRangeDrag(Qt::Orientations orientations); - void setRangeZoom(Qt::Orientations orientations); - void setRangeDragAxes(QCPAxis* horizontal, QCPAxis* vertical); - void setRangeZoomAxes(QCPAxis* horizontal, QCPAxis* vertical); - void setRangeZoomFactor(double horizontalFactor, double verticalFactor); - void setRangeZoomFactor(double factor); + void setBackground ( const QPixmap& pm ); + void setBackground ( const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding ); + void setBackground ( const QBrush& brush ); + void setBackgroundScaled ( bool scaled ); + void setBackgroundScaledMode ( Qt::AspectRatioMode mode ); + void setRangeDrag ( Qt::Orientations orientations ); + void setRangeZoom ( Qt::Orientations orientations ); + void setRangeDragAxes ( QCPAxis* horizontal, QCPAxis* vertical ); + void setRangeZoomAxes ( QCPAxis* horizontal, QCPAxis* vertical ); + void setRangeZoomFactor ( double horizontalFactor, double verticalFactor ); + void setRangeZoomFactor ( double factor ); // non-property methods: - int axisCount(QCPAxis::AxisType type) const; - QCPAxis* axis(QCPAxis::AxisType type, int index = 0) const; - QList axes(QCPAxis::AxisTypes types) const; + int axisCount ( QCPAxis::AxisType type ) const; + QCPAxis* axis ( QCPAxis::AxisType type, int index = 0 ) const; + QList axes ( QCPAxis::AxisTypes types ) const; QList axes() const; - QCPAxis* addAxis(QCPAxis::AxisType type, QCPAxis* axis = 0); - QList addAxes(QCPAxis::AxisTypes types); - bool removeAxis(QCPAxis* axis); + QCPAxis* addAxis ( QCPAxis::AxisType type, QCPAxis* axis = 0 ); + QList addAxes ( QCPAxis::AxisTypes types ); + bool removeAxis ( QCPAxis* axis ); QCPLayoutInset* insetLayout() const { return mInsetLayout; } - void setupFullAxesBox(bool connectRanges = false); + void setupFullAxesBox ( bool connectRanges = false ); QList plottables() const; QList graphs() const; QList items() const; @@ -2056,8 +2061,8 @@ public: QPoint center() const { return mRect.center(); } // reimplemented virtual methods: - virtual void update(UpdatePhase phase); - virtual QList elements(bool recursive) const; + virtual void update ( UpdatePhase phase ); + virtual QList elements ( bool recursive ) const; protected: // property members: @@ -2078,21 +2083,21 @@ protected: QHash > mAxes; // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter); - virtual int calculateAutoMargin(QCP::MarginSide side); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ); + virtual int calculateAutoMargin ( QCP::MarginSide side ); // events: - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseMoveEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void wheelEvent(QWheelEvent* event); + virtual void mousePressEvent ( QMouseEvent* event ); + virtual void mouseMoveEvent ( QMouseEvent* event ); + virtual void mouseReleaseEvent ( QMouseEvent* event ); + virtual void wheelEvent ( QWheelEvent* event ); // non-property methods: - void drawBackground(QCPPainter* painter); - void updateAxesOffset(QCPAxis::AxisType type); + void drawBackground ( QCPPainter* painter ); + void updateAxesOffset ( QCPAxis::AxisType type ); private: - Q_DISABLE_COPY(QCPAxisRect) + Q_DISABLE_COPY ( QCPAxisRect ) friend class QCustomPlot; }; @@ -2102,16 +2107,16 @@ class QCP_LIB_DECL QCPAbstractLegendItem : public QCPLayoutElement { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCPLegend* parentLegend READ parentLegend) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) - Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) - Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) - Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged) - Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectableChanged) + Q_PROPERTY ( QCPLegend* parentLegend READ parentLegend ) + Q_PROPERTY ( QFont font READ font WRITE setFont ) + Q_PROPERTY ( QColor textColor READ textColor WRITE setTextColor ) + Q_PROPERTY ( QFont selectedFont READ selectedFont WRITE setSelectedFont ) + Q_PROPERTY ( QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor ) + Q_PROPERTY ( bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged ) + Q_PROPERTY ( bool selected READ selected WRITE setSelected NOTIFY selectableChanged ) /// \endcond public: - explicit QCPAbstractLegendItem(QCPLegend* parent); + explicit QCPAbstractLegendItem ( QCPLegend* parent ); // getters: QCPLegend* parentLegend() const { return mParentLegend; } @@ -2123,19 +2128,19 @@ public: bool selected() const { return mSelected; } // setters: - void setFont(const QFont& font); - void setTextColor(const QColor& color); - void setSelectedFont(const QFont& font); - void setSelectedTextColor(const QColor& color); - Q_SLOT void setSelectable(bool selectable); - Q_SLOT void setSelected(bool selected); + void setFont ( const QFont& font ); + void setTextColor ( const QColor& color ); + void setSelectedFont ( const QFont& font ); + void setSelectedTextColor ( const QColor& color ); + Q_SLOT void setSelectable ( bool selectable ); + Q_SLOT void setSelected ( bool selected ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; signals: - void selectionChanged(bool selected); - void selectableChanged(bool selectable); + void selectionChanged ( bool selected ); + void selectableChanged ( bool selectable ); protected: // property members: @@ -2148,15 +2153,15 @@ protected: // reimplemented virtual methods: virtual QCP::Interaction selectionCategory() const; - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; virtual QRect clipRect() const; - virtual void draw(QCPPainter* painter) = 0; + virtual void draw ( QCPPainter* painter ) = 0; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); private: - Q_DISABLE_COPY(QCPAbstractLegendItem) + Q_DISABLE_COPY ( QCPAbstractLegendItem ) friend class QCPLegend; }; @@ -2166,7 +2171,7 @@ class QCP_LIB_DECL QCPPlottableLegendItem : public QCPAbstractLegendItem { Q_OBJECT public: - QCPPlottableLegendItem(QCPLegend* parent, QCPAbstractPlottable* plottable); + QCPPlottableLegendItem ( QCPLegend* parent, QCPAbstractPlottable* plottable ); // getters: QCPAbstractPlottable* plottable() { return mPlottable; } @@ -2176,7 +2181,7 @@ protected: QCPAbstractPlottable* mPlottable; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); virtual QSize minimumSizeHint() const; // non-virtual methods: @@ -2190,20 +2195,20 @@ class QCP_LIB_DECL QCPLegend : public QCPLayoutGrid { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) - Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) - Q_PROPERTY(int iconTextPadding READ iconTextPadding WRITE setIconTextPadding) - Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen) - Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged) - Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged) - Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen) - Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) - Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) - Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) + Q_PROPERTY ( QPen borderPen READ borderPen WRITE setBorderPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QFont font READ font WRITE setFont ) + Q_PROPERTY ( QColor textColor READ textColor WRITE setTextColor ) + Q_PROPERTY ( QSize iconSize READ iconSize WRITE setIconSize ) + Q_PROPERTY ( int iconTextPadding READ iconTextPadding WRITE setIconTextPadding ) + Q_PROPERTY ( QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen ) + Q_PROPERTY ( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged ) + Q_PROPERTY ( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged ) + Q_PROPERTY ( QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen ) + Q_PROPERTY ( QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) + Q_PROPERTY ( QFont selectedFont READ selectedFont WRITE setSelectedFont ) + Q_PROPERTY ( QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor ) /// \endcond public: /*! @@ -2215,8 +2220,8 @@ public: , spLegendBox = 0x001 ///< 0x001 The legend box (frame) , spItems = 0x002 ///< 0x002 Legend items individually (see \ref selectedItems) }; - Q_FLAGS(SelectablePart SelectableParts) - Q_DECLARE_FLAGS(SelectableParts, SelectablePart) + Q_FLAGS ( SelectablePart SelectableParts ) + Q_DECLARE_FLAGS ( SelectableParts, SelectablePart ) explicit QCPLegend(); virtual ~QCPLegend(); @@ -2238,40 +2243,40 @@ public: QColor selectedTextColor() const { return mSelectedTextColor; } // setters: - void setBorderPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setFont(const QFont& font); - void setTextColor(const QColor& color); - void setIconSize(const QSize& size); - void setIconSize(int width, int height); - void setIconTextPadding(int padding); - void setIconBorderPen(const QPen& pen); - Q_SLOT void setSelectableParts(const SelectableParts& selectableParts); - Q_SLOT void setSelectedParts(const SelectableParts& selectedParts); - void setSelectedBorderPen(const QPen& pen); - void setSelectedIconBorderPen(const QPen& pen); - void setSelectedBrush(const QBrush& brush); - void setSelectedFont(const QFont& font); - void setSelectedTextColor(const QColor& color); + void setBorderPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setFont ( const QFont& font ); + void setTextColor ( const QColor& color ); + void setIconSize ( const QSize& size ); + void setIconSize ( int width, int height ); + void setIconTextPadding ( int padding ); + void setIconBorderPen ( const QPen& pen ); + Q_SLOT void setSelectableParts ( const SelectableParts& selectableParts ); + Q_SLOT void setSelectedParts ( const SelectableParts& selectedParts ); + void setSelectedBorderPen ( const QPen& pen ); + void setSelectedIconBorderPen ( const QPen& pen ); + void setSelectedBrush ( const QBrush& brush ); + void setSelectedFont ( const QFont& font ); + void setSelectedTextColor ( const QColor& color ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // non-virtual methods: - QCPAbstractLegendItem* item(int index) const; - QCPPlottableLegendItem* itemWithPlottable(const QCPAbstractPlottable* plottable) const; + QCPAbstractLegendItem* item ( int index ) const; + QCPPlottableLegendItem* itemWithPlottable ( const QCPAbstractPlottable* plottable ) const; int itemCount() const; - bool hasItem(QCPAbstractLegendItem* item) const; - bool hasItemWithPlottable(const QCPAbstractPlottable* plottable) const; - bool addItem(QCPAbstractLegendItem* item); - bool removeItem(int index); - bool removeItem(QCPAbstractLegendItem* item); + bool hasItem ( QCPAbstractLegendItem* item ) const; + bool hasItemWithPlottable ( const QCPAbstractPlottable* plottable ) const; + bool addItem ( QCPAbstractLegendItem* item ); + bool removeItem ( int index ); + bool removeItem ( QCPAbstractLegendItem* item ); void clearItems(); QList selectedItems() const; signals: - void selectionChanged(QCPLegend::SelectableParts parts); - void selectableChanged(QCPLegend::SelectableParts parts); + void selectionChanged ( QCPLegend::SelectableParts parts ); + void selectableChanged ( QCPLegend::SelectableParts parts ); protected: // property members: @@ -2288,43 +2293,43 @@ protected: QColor mSelectedTextColor; // reimplemented virtual methods: - virtual void parentPlotInitialized(QCustomPlot* parentPlot); + virtual void parentPlotInitialized ( QCustomPlot* parentPlot ); virtual QCP::Interaction selectionCategory() const; - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ); // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // non-virtual methods: QPen getBorderPen() const; QBrush getBrush() const; private: - Q_DISABLE_COPY(QCPLegend) + Q_DISABLE_COPY ( QCPLegend ) friend class QCustomPlot; friend class QCPAbstractLegendItem; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts) -Q_DECLARE_METATYPE(QCPLegend::SelectablePart) +Q_DECLARE_OPERATORS_FOR_FLAGS ( QCPLegend::SelectableParts ) +Q_DECLARE_METATYPE ( QCPLegend::SelectablePart ) class QCP_LIB_DECL QCPPlotTitle : public QCPLayoutElement { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QString text READ text WRITE setText) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) - Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) - Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) - Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged) - Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectionChanged) + Q_PROPERTY ( QString text READ text WRITE setText ) + Q_PROPERTY ( QFont font READ font WRITE setFont ) + Q_PROPERTY ( QColor textColor READ textColor WRITE setTextColor ) + Q_PROPERTY ( QFont selectedFont READ selectedFont WRITE setSelectedFont ) + Q_PROPERTY ( QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor ) + Q_PROPERTY ( bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged ) + Q_PROPERTY ( bool selected READ selected WRITE setSelected NOTIFY selectionChanged ) /// \endcond public: - explicit QCPPlotTitle(QCustomPlot* parentPlot); - explicit QCPPlotTitle(QCustomPlot* parentPlot, const QString& text); + explicit QCPPlotTitle ( QCustomPlot* parentPlot ); + explicit QCPPlotTitle ( QCustomPlot* parentPlot, const QString& text ); // getters: QString text() const { return mText; } @@ -2336,20 +2341,20 @@ public: bool selected() const { return mSelected; } // setters: - void setText(const QString& text); - void setFont(const QFont& font); - void setTextColor(const QColor& color); - void setSelectedFont(const QFont& font); - void setSelectedTextColor(const QColor& color); - Q_SLOT void setSelectable(bool selectable); - Q_SLOT void setSelected(bool selected); + void setText ( const QString& text ); + void setFont ( const QFont& font ); + void setTextColor ( const QColor& color ); + void setSelectedFont ( const QFont& font ); + void setSelectedTextColor ( const QColor& color ); + Q_SLOT void setSelectable ( bool selectable ); + Q_SLOT void setSelected ( bool selected ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; signals: - void selectionChanged(bool selected); - void selectableChanged(bool selectable); + void selectionChanged ( bool selected ); + void selectableChanged ( bool selectable ); protected: // property members: @@ -2362,20 +2367,20 @@ protected: bool mSelectable, mSelected; // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; - virtual void draw(QCPPainter* painter); + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; + virtual void draw ( QCPPainter* painter ); virtual QSize minimumSizeHint() const; virtual QSize maximumSizeHint() const; // events: - virtual void selectEvent(QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged); - virtual void deselectEvent(bool* selectionStateChanged); + virtual void selectEvent ( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged ); + virtual void deselectEvent ( bool* selectionStateChanged ); // non-virtual methods: QFont mainFont() const; QColor mainTextColor() const; private: - Q_DISABLE_COPY(QCPPlotTitle) + Q_DISABLE_COPY ( QCPPlotTitle ) }; @@ -2383,7 +2388,7 @@ class QCPColorScaleAxisRectPrivate : public QCPAxisRect { Q_OBJECT public: - explicit QCPColorScaleAxisRectPrivate(QCPColorScale* parentColorScale); + explicit QCPColorScaleAxisRectPrivate ( QCPColorScale* parentColorScale ); protected: QCPColorScale* mParentColorScale; QImage mGradientImage; @@ -2395,10 +2400,10 @@ protected: using QCPAxisRect::mouseReleaseEvent; using QCPAxisRect::wheelEvent; using QCPAxisRect::update; - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); void updateGradientImage(); - Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts); - Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts); + Q_SLOT void axisSelectionChanged ( QCPAxis::SelectableParts selectedParts ); + Q_SLOT void axisSelectableChanged ( QCPAxis::SelectableParts selectableParts ); friend class QCPColorScale; }; @@ -2407,17 +2412,17 @@ class QCP_LIB_DECL QCPColorScale : public QCPLayoutElement { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCPAxis::AxisType type READ type WRITE setType) - Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged) - Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged) - Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged) - Q_PROPERTY(QString label READ label WRITE setLabel) - Q_PROPERTY(int barWidth READ barWidth WRITE setBarWidth) - Q_PROPERTY(bool rangeDrag READ rangeDrag WRITE setRangeDrag) - Q_PROPERTY(bool rangeZoom READ rangeZoom WRITE setRangeZoom) + Q_PROPERTY ( QCPAxis::AxisType type READ type WRITE setType ) + Q_PROPERTY ( QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged ) + Q_PROPERTY ( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged ) + Q_PROPERTY ( QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged ) + Q_PROPERTY ( QString label READ label WRITE setLabel ) + Q_PROPERTY ( int barWidth READ barWidth WRITE setBarWidth ) + Q_PROPERTY ( bool rangeDrag READ rangeDrag WRITE setRangeDrag ) + Q_PROPERTY ( bool rangeZoom READ rangeZoom WRITE setRangeZoom ) /// \endcond public: - explicit QCPColorScale(QCustomPlot* parentPlot); + explicit QCPColorScale ( QCustomPlot* parentPlot ); virtual ~QCPColorScale(); // getters: @@ -2432,26 +2437,26 @@ public: bool rangeZoom() const; // setters: - void setType(QCPAxis::AxisType type); - Q_SLOT void setDataRange(const QCPRange& dataRange); - Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType); - Q_SLOT void setGradient(const QCPColorGradient& gradient); - void setLabel(const QString& str); - void setBarWidth(int width); - void setRangeDrag(bool enabled); - void setRangeZoom(bool enabled); + void setType ( QCPAxis::AxisType type ); + Q_SLOT void setDataRange ( const QCPRange& dataRange ); + Q_SLOT void setDataScaleType ( QCPAxis::ScaleType scaleType ); + Q_SLOT void setGradient ( const QCPColorGradient& gradient ); + void setLabel ( const QString& str ); + void setBarWidth ( int width ); + void setRangeDrag ( bool enabled ); + void setRangeZoom ( bool enabled ); // non-property methods: QList colorMaps() const; - void rescaleDataRange(bool onlyVisibleMaps); + void rescaleDataRange ( bool onlyVisibleMaps ); // reimplemented virtual methods: - virtual void update(UpdatePhase phase); + virtual void update ( UpdatePhase phase ); signals: - void dataRangeChanged(QCPRange newRange); - void dataScaleTypeChanged(QCPAxis::ScaleType scaleType); - void gradientChanged(QCPColorGradient newGradient); + void dataRangeChanged ( QCPRange newRange ); + void dataScaleTypeChanged ( QCPAxis::ScaleType scaleType ); + void gradientChanged ( QCPColorGradient newGradient ); protected: // property members: @@ -2466,15 +2471,15 @@ protected: QPointer mColorAxis; // reimplemented virtual methods: - virtual void applyDefaultAntialiasingHint(QCPPainter* painter) const; + virtual void applyDefaultAntialiasingHint ( QCPPainter* painter ) const; // events: - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseMoveEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void wheelEvent(QWheelEvent* event); + virtual void mousePressEvent ( QMouseEvent* event ); + virtual void mouseMoveEvent ( QMouseEvent* event ); + virtual void mouseReleaseEvent ( QMouseEvent* event ); + virtual void wheelEvent ( QWheelEvent* event ); private: - Q_DISABLE_COPY(QCPColorScale) + Q_DISABLE_COPY ( QCPColorScale ) friend class QCPColorScaleAxisRectPrivate; }; @@ -2488,12 +2493,12 @@ class QCP_LIB_DECL QCPData { public: QCPData(); - QCPData(double key, double value); + QCPData ( double key, double value ); double key, value; double keyErrorPlus, keyErrorMinus; double valueErrorPlus, valueErrorMinus; }; -Q_DECLARE_TYPEINFO(QCPData, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPData, Q_MOVABLE_TYPE ); /*! \typedef QCPDataMap Container for storing \ref QCPData items in a sorted fashion. The key of the map @@ -2511,14 +2516,14 @@ class QCP_LIB_DECL QCPGraph : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle) - Q_PROPERTY(QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle) - Q_PROPERTY(ErrorType errorType READ errorType WRITE setErrorType) - Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen) - Q_PROPERTY(double errorBarSize READ errorBarSize WRITE setErrorBarSize) - Q_PROPERTY(bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol) - Q_PROPERTY(QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph) - Q_PROPERTY(bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling) + Q_PROPERTY ( LineStyle lineStyle READ lineStyle WRITE setLineStyle ) + Q_PROPERTY ( QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle ) + Q_PROPERTY ( ErrorType errorType READ errorType WRITE setErrorType ) + Q_PROPERTY ( QPen errorPen READ errorPen WRITE setErrorPen ) + Q_PROPERTY ( double errorBarSize READ errorBarSize WRITE setErrorBarSize ) + Q_PROPERTY ( bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol ) + Q_PROPERTY ( QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph ) + Q_PROPERTY ( bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling ) /// \endcond public: /*! @@ -2534,7 +2539,7 @@ public: , lsStepCenter ///< line is drawn as steps where the step is in between two data points , lsImpulse ///< each data point is represented by a line parallel to the value axis, which reaches from the data point to the zero-value-line }; - Q_ENUMS(LineStyle) + Q_ENUMS ( LineStyle ) /*! Defines what kind of error bars are drawn for each data point */ @@ -2543,9 +2548,9 @@ public: , etValue ///< Error bars for the value dimension of the data point are shown , etBoth ///< Error bars for both key and value dimensions of the data point are shown }; - Q_ENUMS(ErrorType) + Q_ENUMS ( ErrorType ) - explicit QCPGraph(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPGraph ( QCPAxis* keyAxis, QCPAxis* valueAxis ); virtual ~QCPGraph(); // getters: @@ -2560,46 +2565,47 @@ public: bool adaptiveSampling() const { return mAdaptiveSampling; } // setters: - void setData(QCPDataMap* data, bool copy = false); - void setData(const QVector& key, const QVector& value); - void setDataKeyError(const QVector& key, const QVector& value, const QVector& keyError); - void setDataKeyError(const QVector& key, const QVector& value, const QVector& keyErrorMinus, - const QVector& keyErrorPlus); - void setDataValueError(const QVector& key, const QVector& value, const QVector& valueError); - void setDataValueError(const QVector& key, const QVector& value, const QVector& valueErrorMinus, - const QVector& valueErrorPlus); - void setDataBothError(const QVector& key, const QVector& value, const QVector& keyError, - const QVector& valueError); - void setDataBothError(const QVector& key, const QVector& value, const QVector& keyErrorMinus, - const QVector& keyErrorPlus, const QVector& valueErrorMinus, const QVector& valueErrorPlus); - void setLineStyle(LineStyle ls); - void setScatterStyle(const QCPScatterStyle& style); - void setErrorType(ErrorType errorType); - void setErrorPen(const QPen& pen); - void setErrorBarSize(double size); - void setErrorBarSkipSymbol(bool enabled); - void setChannelFillGraph(QCPGraph* targetGraph); - void setAdaptiveSampling(bool enabled); + void setData ( QCPDataMap* data, bool copy = false ); + void setData ( const QVector& key, const QVector& value ); + void setDataKeyError ( const QVector& key, const QVector& value, const QVector& keyError ); + void setDataKeyError ( const QVector& key, const QVector& value, const QVector& keyErrorMinus, + const QVector& keyErrorPlus ); + void setDataValueError ( const QVector& key, const QVector& value, const QVector& valueError ); + void setDataValueError ( const QVector& key, const QVector& value, + const QVector& valueErrorMinus, + const QVector& valueErrorPlus ); + void setDataBothError ( const QVector& key, const QVector& value, const QVector& keyError, + const QVector& valueError ); + void setDataBothError ( const QVector& key, const QVector& value, const QVector& keyErrorMinus, + const QVector& keyErrorPlus, const QVector& valueErrorMinus, const QVector& valueErrorPlus ); + void setLineStyle ( LineStyle ls ); + void setScatterStyle ( const QCPScatterStyle& style ); + void setErrorType ( ErrorType errorType ); + void setErrorPen ( const QPen& pen ); + void setErrorBarSize ( double size ); + void setErrorBarSkipSymbol ( bool enabled ); + void setChannelFillGraph ( QCPGraph* targetGraph ); + void setAdaptiveSampling ( bool enabled ); // non-property methods: - void addData(const QCPDataMap& dataMap); - void addData(const QCPData& data); - void addData(double key, double value); - void addData(const QVector& keys, const QVector& values); - void removeDataBefore(double key); - void removeDataAfter(double key); - void removeData(double fromKey, double toKey); - void removeData(double key); + void addData ( const QCPDataMap& dataMap ); + void addData ( const QCPData& data ); + void addData ( double key, double value ); + void addData ( const QVector& keys, const QVector& values ); + void removeDataBefore ( double key ); + void removeDataAfter ( double key ); + void removeData ( double fromKey, double toKey ); + void removeData ( double key ); // reimplemented virtual methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; using QCPAbstractPlottable::rescaleAxes; using QCPAbstractPlottable::rescaleKeyAxis; using QCPAbstractPlottable::rescaleValueAxis; - void rescaleAxes(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface - void rescaleKeyAxis(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface - void rescaleValueAxis(bool onlyEnlarge, bool includeErrorBars) const; // overloads base class interface + void rescaleAxes ( bool onlyEnlarge, bool includeErrorBars ) const; // overloads base class interface + void rescaleKeyAxis ( bool onlyEnlarge, bool includeErrorBars ) const; // overloads base class interface + void rescaleValueAxis ( bool onlyEnlarge, bool includeErrorBars ) const; // overloads base class interface protected: // property members: @@ -2614,44 +2620,44 @@ protected: bool mAdaptiveSampling; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain, - bool includeErrors) const; // overloads base class interface - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain, - bool includeErrors) const; // overloads base class interface + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain, + bool includeErrors ) const; // overloads base class interface + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain, + bool includeErrors ) const; // overloads base class interface // introduced virtual methods: - virtual void drawFill(QCPPainter* painter, QVector* lineData) const; - virtual void drawScatterPlot(QCPPainter* painter, QVector* scatterData) const; - virtual void drawLinePlot(QCPPainter* painter, QVector* lineData) const; - virtual void drawImpulsePlot(QCPPainter* painter, QVector* lineData) const; + virtual void drawFill ( QCPPainter* painter, QVector* lineData ) const; + virtual void drawScatterPlot ( QCPPainter* painter, QVector* scatterData ) const; + virtual void drawLinePlot ( QCPPainter* painter, QVector* lineData ) const; + virtual void drawImpulsePlot ( QCPPainter* painter, QVector* lineData ) const; // non-virtual methods: - void getPreparedData(QVector* lineData, QVector* scatterData) const; - void getPlotData(QVector* lineData, QVector* scatterData) const; - void getScatterPlotData(QVector* scatterData) const; - void getLinePlotData(QVector* linePixelData, QVector* scatterData) const; - void getStepLeftPlotData(QVector* linePixelData, QVector* scatterData) const; - void getStepRightPlotData(QVector* linePixelData, QVector* scatterData) const; - void getStepCenterPlotData(QVector* linePixelData, QVector* scatterData) const; - void getImpulsePlotData(QVector* linePixelData, QVector* scatterData) const; - void drawError(QCPPainter* painter, double x, double y, const QCPData& data) const; - void getVisibleDataBounds(QCPDataMap::const_iterator& lower, QCPDataMap::const_iterator& upper) const; - int countDataInBounds(const QCPDataMap::const_iterator& lower, const QCPDataMap::const_iterator& upper, - int maxCount) const; - void addFillBasePoints(QVector* lineData) const; - void removeFillBasePoints(QVector* lineData) const; - QPointF lowerFillBasePoint(double lowerKey) const; - QPointF upperFillBasePoint(double upperKey) const; - const QPolygonF getChannelFillPolygon(const QVector* lineData) const; - int findIndexBelowX(const QVector* data, double x) const; - int findIndexAboveX(const QVector* data, double x) const; - int findIndexBelowY(const QVector* data, double y) const; - int findIndexAboveY(const QVector* data, double y) const; - double pointDistance(const QPointF& pixelPoint) const; + void getPreparedData ( QVector* lineData, QVector* scatterData ) const; + void getPlotData ( QVector* lineData, QVector* scatterData ) const; + void getScatterPlotData ( QVector* scatterData ) const; + void getLinePlotData ( QVector* linePixelData, QVector* scatterData ) const; + void getStepLeftPlotData ( QVector* linePixelData, QVector* scatterData ) const; + void getStepRightPlotData ( QVector* linePixelData, QVector* scatterData ) const; + void getStepCenterPlotData ( QVector* linePixelData, QVector* scatterData ) const; + void getImpulsePlotData ( QVector* linePixelData, QVector* scatterData ) const; + void drawError ( QCPPainter* painter, double x, double y, const QCPData& data ) const; + void getVisibleDataBounds ( QCPDataMap::const_iterator& lower, QCPDataMap::const_iterator& upper ) const; + int countDataInBounds ( const QCPDataMap::const_iterator& lower, const QCPDataMap::const_iterator& upper, + int maxCount ) const; + void addFillBasePoints ( QVector* lineData ) const; + void removeFillBasePoints ( QVector* lineData ) const; + QPointF lowerFillBasePoint ( double lowerKey ) const; + QPointF upperFillBasePoint ( double upperKey ) const; + const QPolygonF getChannelFillPolygon ( const QVector* lineData ) const; + int findIndexBelowX ( const QVector* data, double x ) const; + int findIndexAboveX ( const QVector* data, double x ) const; + int findIndexBelowY ( const QVector* data, double y ) const; + int findIndexAboveY ( const QVector* data, double y ) const; + double pointDistance ( const QPointF& pixelPoint ) const; friend class QCustomPlot; friend class QCPLegend; @@ -2666,10 +2672,10 @@ class QCP_LIB_DECL QCPCurveData { public: QCPCurveData(); - QCPCurveData(double t, double key, double value); + QCPCurveData ( double t, double key, double value ); double t, key, value; }; -Q_DECLARE_TYPEINFO(QCPCurveData, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPCurveData, Q_MOVABLE_TYPE ); /*! \typedef QCPCurveDataMap Container for storing \ref QCPCurveData items in a sorted fashion. The key of the map @@ -2688,8 +2694,8 @@ class QCP_LIB_DECL QCPCurve : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle) - Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle) + Q_PROPERTY ( QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle ) + Q_PROPERTY ( LineStyle lineStyle READ lineStyle WRITE setLineStyle ) /// \endcond public: /*! @@ -2700,7 +2706,7 @@ public: enum LineStyle { lsNone ///< No line is drawn between data points (e.g. only scatters) , lsLine ///< Data points are connected with a straight line }; - explicit QCPCurve(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPCurve ( QCPAxis* keyAxis, QCPAxis* valueAxis ); virtual ~QCPCurve(); // getters: @@ -2709,26 +2715,26 @@ public: LineStyle lineStyle() const { return mLineStyle; } // setters: - void setData(QCPCurveDataMap* data, bool copy = false); - void setData(const QVector& t, const QVector& key, const QVector& value); - void setData(const QVector& key, const QVector& value); - void setScatterStyle(const QCPScatterStyle& style); - void setLineStyle(LineStyle style); + void setData ( QCPCurveDataMap* data, bool copy = false ); + void setData ( const QVector& t, const QVector& key, const QVector& value ); + void setData ( const QVector& key, const QVector& value ); + void setScatterStyle ( const QCPScatterStyle& style ); + void setLineStyle ( LineStyle style ); // non-property methods: - void addData(const QCPCurveDataMap& dataMap); - void addData(const QCPCurveData& data); - void addData(double t, double key, double value); - void addData(double key, double value); - void addData(const QVector& ts, const QVector& keys, const QVector& values); - void removeDataBefore(double t); - void removeDataAfter(double t); - void removeData(double fromt, double tot); - void removeData(double t); + void addData ( const QCPCurveDataMap& dataMap ); + void addData ( const QCPCurveData& data ); + void addData ( double t, double key, double value ); + void addData ( double key, double value ); + void addData ( const QVector& ts, const QVector& keys, const QVector& values ); + void removeDataBefore ( double t ); + void removeDataAfter ( double t ); + void removeData ( double fromt, double tot ); + void removeData ( double t ); // reimplemented virtual methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; protected: // property members: @@ -2737,27 +2743,27 @@ protected: LineStyle mLineStyle; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; // introduced virtual methods: - virtual void drawScatterPlot(QCPPainter* painter, const QVector* pointData) const; + virtual void drawScatterPlot ( QCPPainter* painter, const QVector* pointData ) const; // non-virtual methods: - void getCurveData(QVector* lineData) const; - int getRegion(double x, double y, double rectLeft, double rectTop, double rectRight, double rectBottom) const; - QPointF getOptimizedPoint(int prevRegion, double prevKey, double prevValue, double key, double value, double rectLeft, - double rectTop, double rectRight, double rectBottom) const; - QVector getOptimizedCornerPoints(int prevRegion, int currentRegion, double prevKey, double prevValue, - double key, double value, double rectLeft, double rectTop, double rectRight, double rectBottom) const; - bool mayTraverse(int prevRegion, int currentRegion) const; - bool getTraverse(double prevKey, double prevValue, double key, double value, double rectLeft, double rectTop, - double rectRight, double rectBottom, QPointF& crossA, QPointF& crossB) const; - void getTraverseCornerPoints(int prevRegion, int currentRegion, double rectLeft, double rectTop, double rectRight, - double rectBottom, QVector& beforeTraverse, QVector& afterTraverse) const; - double pointDistance(const QPointF& pixelPoint) const; + void getCurveData ( QVector* lineData ) const; + int getRegion ( double x, double y, double rectLeft, double rectTop, double rectRight, double rectBottom ) const; + QPointF getOptimizedPoint ( int prevRegion, double prevKey, double prevValue, double key, double value, double rectLeft, + double rectTop, double rectRight, double rectBottom ) const; + QVector getOptimizedCornerPoints ( int prevRegion, int currentRegion, double prevKey, double prevValue, + double key, double value, double rectLeft, double rectTop, double rectRight, double rectBottom ) const; + bool mayTraverse ( int prevRegion, int currentRegion ) const; + bool getTraverse ( double prevKey, double prevValue, double key, double value, double rectLeft, double rectTop, + double rectRight, double rectBottom, QPointF& crossA, QPointF& crossB ) const; + void getTraverseCornerPoints ( int prevRegion, int currentRegion, double rectLeft, double rectTop, double rectRight, + double rectBottom, QVector& beforeTraverse, QVector& afterTraverse ) const; + double pointDistance ( const QPointF& pixelPoint ) const; friend class QCustomPlot; friend class QCPLegend; @@ -2772,8 +2778,8 @@ class QCP_LIB_DECL QCPBarsGroup : public QObject { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(SpacingType spacingType READ spacingType WRITE setSpacingType) - Q_PROPERTY(double spacing READ spacing WRITE setSpacing) + Q_PROPERTY ( SpacingType spacingType READ spacingType WRITE setSpacingType ) + Q_PROPERTY ( double spacing READ spacing WRITE setSpacing ) /// \endcond public: /*! @@ -2786,7 +2792,7 @@ public: , stAxisRectRatio ///< Bar spacing is given by a fraction of the axis rect size , stPlotCoords ///< Bar spacing is in key coordinates and thus scales with the key axis range }; - QCPBarsGroup(QCustomPlot* parentPlot); + QCPBarsGroup ( QCustomPlot* parentPlot ); ~QCPBarsGroup(); // getters: @@ -2794,19 +2800,19 @@ public: double spacing() const { return mSpacing; } // setters: - void setSpacingType(SpacingType spacingType); - void setSpacing(double spacing); + void setSpacingType ( SpacingType spacingType ); + void setSpacing ( double spacing ); // non-virtual methods: QList bars() const { return mBars; } - QCPBars* bars(int index) const; + QCPBars* bars ( int index ) const; int size() const { return mBars.size(); } bool isEmpty() const { return mBars.isEmpty(); } void clear(); - bool contains(QCPBars* bars) const { return mBars.contains(bars); } - void append(QCPBars* bars); - void insert(int i, QCPBars* bars); - void remove(QCPBars* bars); + bool contains ( QCPBars* bars ) const { return mBars.contains ( bars ); } + void append ( QCPBars* bars ); + void insert ( int i, QCPBars* bars ); + void remove ( QCPBars* bars ); protected: // non-property members: @@ -2816,15 +2822,15 @@ protected: QList mBars; // non-virtual methods: - void registerBars(QCPBars* bars); - void unregisterBars(QCPBars* bars); + void registerBars ( QCPBars* bars ); + void unregisterBars ( QCPBars* bars ); // virtual methods: - double keyPixelOffset(const QCPBars* bars, double keyCoord); - double getPixelSpacing(const QCPBars* bars, double keyCoord); + double keyPixelOffset ( const QCPBars* bars, double keyCoord ); + double getPixelSpacing ( const QCPBars* bars, double keyCoord ); private: - Q_DISABLE_COPY(QCPBarsGroup) + Q_DISABLE_COPY ( QCPBarsGroup ) friend class QCPBars; }; @@ -2834,10 +2840,10 @@ class QCP_LIB_DECL QCPBarData { public: QCPBarData(); - QCPBarData(double key, double value); + QCPBarData ( double key, double value ); double key, value; }; -Q_DECLARE_TYPEINFO(QCPBarData, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPBarData, Q_MOVABLE_TYPE ); /*! \typedef QCPBarDataMap Container for storing \ref QCPBarData items in a sorted fashion. The key of the map @@ -2855,12 +2861,12 @@ class QCP_LIB_DECL QCPBars : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(double width READ width WRITE setWidth) - Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType) - Q_PROPERTY(QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup) - Q_PROPERTY(double baseValue READ baseValue WRITE setBaseValue) - Q_PROPERTY(QCPBars* barBelow READ barBelow) - Q_PROPERTY(QCPBars* barAbove READ barAbove) + Q_PROPERTY ( double width READ width WRITE setWidth ) + Q_PROPERTY ( WidthType widthType READ widthType WRITE setWidthType ) + Q_PROPERTY ( QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup ) + Q_PROPERTY ( double baseValue READ baseValue WRITE setBaseValue ) + Q_PROPERTY ( QCPBars* barBelow READ barBelow ) + Q_PROPERTY ( QCPBars* barAbove READ barAbove ) /// \endcond public: /*! @@ -2873,9 +2879,9 @@ public: , wtAxisRectRatio ///< Bar width is given by a fraction of the axis rect size , wtPlotCoords ///< Bar width is in key coordinates and thus scales with the key axis range }; - Q_ENUMS(WidthType) + Q_ENUMS ( WidthType ) - explicit QCPBars(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPBars ( QCPAxis* keyAxis, QCPAxis* valueAxis ); virtual ~QCPBars(); // getters: @@ -2888,28 +2894,28 @@ public: QCPBarDataMap* data() const { return mData; } // setters: - void setWidth(double width); - void setWidthType(WidthType widthType); - void setBarsGroup(QCPBarsGroup* barsGroup); - void setBaseValue(double baseValue); - void setData(QCPBarDataMap* data, bool copy = false); - void setData(const QVector& key, const QVector& value); + void setWidth ( double width ); + void setWidthType ( WidthType widthType ); + void setBarsGroup ( QCPBarsGroup* barsGroup ); + void setBaseValue ( double baseValue ); + void setData ( QCPBarDataMap* data, bool copy = false ); + void setData ( const QVector& key, const QVector& value ); // non-property methods: - void moveBelow(QCPBars* bars); - void moveAbove(QCPBars* bars); - void addData(const QCPBarDataMap& dataMap); - void addData(const QCPBarData& data); - void addData(double key, double value); - void addData(const QVector& keys, const QVector& values); - void removeDataBefore(double key); - void removeDataAfter(double key); - void removeData(double fromKey, double toKey); - void removeData(double key); + void moveBelow ( QCPBars* bars ); + void moveAbove ( QCPBars* bars ); + void addData ( const QCPBarDataMap& dataMap ); + void addData ( const QCPBarData& data ); + void addData ( double key, double value ); + void addData ( const QVector& keys, const QVector& values ); + void removeDataBefore ( double key ); + void removeDataAfter ( double key ); + void removeData ( double fromKey, double toKey ); + void removeData ( double key ); // reimplemented virtual methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; protected: // property members: @@ -2921,17 +2927,17 @@ protected: QPointer mBarBelow, mBarAbove; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; // non-virtual methods: - void getVisibleDataBounds(QCPBarDataMap::const_iterator& lower, QCPBarDataMap::const_iterator& upperEnd) const; - QPolygonF getBarPolygon(double key, double value) const; - void getPixelWidth(double key, double& lower, double& upper) const; - double getStackedBaseValue(double key, bool positive) const; - static void connectBars(QCPBars* lower, QCPBars* upper); + void getVisibleDataBounds ( QCPBarDataMap::const_iterator& lower, QCPBarDataMap::const_iterator& upperEnd ) const; + QPolygonF getBarPolygon ( double key, double value ) const; + void getPixelWidth ( double key, double& lower, double& upper ) const; + double getStackedBaseValue ( double key, bool positive ) const; + static void connectBars ( QCPBars* lower, QCPBars* upper ); friend class QCustomPlot; friend class QCPLegend; @@ -2947,22 +2953,22 @@ class QCP_LIB_DECL QCPStatisticalBox : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(double key READ key WRITE setKey) - Q_PROPERTY(double minimum READ minimum WRITE setMinimum) - Q_PROPERTY(double lowerQuartile READ lowerQuartile WRITE setLowerQuartile) - Q_PROPERTY(double median READ median WRITE setMedian) - Q_PROPERTY(double upperQuartile READ upperQuartile WRITE setUpperQuartile) - Q_PROPERTY(double maximum READ maximum WRITE setMaximum) - Q_PROPERTY(QVector outliers READ outliers WRITE setOutliers) - Q_PROPERTY(double width READ width WRITE setWidth) - Q_PROPERTY(double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth) - Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen) - Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen) - Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen) - Q_PROPERTY(QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle) + Q_PROPERTY ( double key READ key WRITE setKey ) + Q_PROPERTY ( double minimum READ minimum WRITE setMinimum ) + Q_PROPERTY ( double lowerQuartile READ lowerQuartile WRITE setLowerQuartile ) + Q_PROPERTY ( double median READ median WRITE setMedian ) + Q_PROPERTY ( double upperQuartile READ upperQuartile WRITE setUpperQuartile ) + Q_PROPERTY ( double maximum READ maximum WRITE setMaximum ) + Q_PROPERTY ( QVector outliers READ outliers WRITE setOutliers ) + Q_PROPERTY ( double width READ width WRITE setWidth ) + Q_PROPERTY ( double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth ) + Q_PROPERTY ( QPen whiskerPen READ whiskerPen WRITE setWhiskerPen ) + Q_PROPERTY ( QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen ) + Q_PROPERTY ( QPen medianPen READ medianPen WRITE setMedianPen ) + Q_PROPERTY ( QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle ) /// \endcond public: - explicit QCPStatisticalBox(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPStatisticalBox ( QCPAxis* keyAxis, QCPAxis* valueAxis ); // getters: double key() const { return mKey; } @@ -2980,24 +2986,24 @@ public: QCPScatterStyle outlierStyle() const { return mOutlierStyle; } // setters: - void setKey(double key); - void setMinimum(double value); - void setLowerQuartile(double value); - void setMedian(double value); - void setUpperQuartile(double value); - void setMaximum(double value); - void setOutliers(const QVector& values); - void setData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum); - void setWidth(double width); - void setWhiskerWidth(double width); - void setWhiskerPen(const QPen& pen); - void setWhiskerBarPen(const QPen& pen); - void setMedianPen(const QPen& pen); - void setOutlierStyle(const QCPScatterStyle& style); + void setKey ( double key ); + void setMinimum ( double value ); + void setLowerQuartile ( double value ); + void setMedian ( double value ); + void setUpperQuartile ( double value ); + void setMaximum ( double value ); + void setOutliers ( const QVector& values ); + void setData ( double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum ); + void setWidth ( double width ); + void setWhiskerWidth ( double width ); + void setWhiskerPen ( const QPen& pen ); + void setWhiskerBarPen ( const QPen& pen ); + void setMedianPen ( const QPen& pen ); + void setOutlierStyle ( const QCPScatterStyle& style ); // non-property methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; protected: // property members: @@ -3009,16 +3015,16 @@ protected: QCPScatterStyle mOutlierStyle; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; // introduced virtual methods: - virtual void drawQuartileBox(QCPPainter* painter, QRectF* quartileBox = 0) const; - virtual void drawMedian(QCPPainter* painter) const; - virtual void drawWhiskers(QCPPainter* painter) const; - virtual void drawOutliers(QCPPainter* painter) const; + virtual void drawQuartileBox ( QCPPainter* painter, QRectF* quartileBox = 0 ) const; + virtual void drawMedian ( QCPPainter* painter ) const; + virtual void drawWhiskers ( QCPPainter* painter ) const; + virtual void drawOutliers ( QCPPainter* painter ) const; friend class QCustomPlot; friend class QCPLegend; @@ -3028,10 +3034,10 @@ protected: class QCP_LIB_DECL QCPColorMapData { public: - QCPColorMapData(int keySize, int valueSize, const QCPRange& keyRange, const QCPRange& valueRange); + QCPColorMapData ( int keySize, int valueSize, const QCPRange& keyRange, const QCPRange& valueRange ); ~QCPColorMapData(); - QCPColorMapData(const QCPColorMapData& other); - QCPColorMapData& operator=(const QCPColorMapData& other); + QCPColorMapData ( const QCPColorMapData& other ); + QCPColorMapData& operator= ( const QCPColorMapData& other ); // getters: int keySize() const { return mKeySize; } @@ -3039,26 +3045,26 @@ public: QCPRange keyRange() const { return mKeyRange; } QCPRange valueRange() const { return mValueRange; } QCPRange dataBounds() const { return mDataBounds; } - double data(double key, double value); - double cell(int keyIndex, int valueIndex); + double data ( double key, double value ); + double cell ( int keyIndex, int valueIndex ); // setters: - void setSize(int keySize, int valueSize); - void setKeySize(int keySize); - void setValueSize(int valueSize); - void setRange(const QCPRange& keyRange, const QCPRange& valueRange); - void setKeyRange(const QCPRange& keyRange); - void setValueRange(const QCPRange& valueRange); - void setData(double key, double value, double z); - void setCell(int keyIndex, int valueIndex, double z); + void setSize ( int keySize, int valueSize ); + void setKeySize ( int keySize ); + void setValueSize ( int valueSize ); + void setRange ( const QCPRange& keyRange, const QCPRange& valueRange ); + void setKeyRange ( const QCPRange& keyRange ); + void setValueRange ( const QCPRange& valueRange ); + void setData ( double key, double value, double z ); + void setCell ( int keyIndex, int valueIndex, double z ); // non-property methods: void recalculateDataBounds(); void clear(); - void fill(double z); + void fill ( double z ); bool isEmpty() const { return mIsEmpty; } - void coordToCell(double key, double value, int* keyIndex, int* valueIndex) const; - void cellToCoord(int keyIndex, int valueIndex, double* key, double* value) const; + void coordToCell ( double key, double value, int* keyIndex, int* valueIndex ) const; + void cellToCoord ( int keyIndex, int valueIndex, double* key, double* value ) const; protected: // property members: @@ -3078,15 +3084,15 @@ class QCP_LIB_DECL QCPColorMap : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged) - Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged) - Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged) - Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate) - Q_PROPERTY(bool tightBoundary READ tightBoundary WRITE setTightBoundary) - Q_PROPERTY(QCPColorScale* colorScale READ colorScale WRITE setColorScale) + Q_PROPERTY ( QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged ) + Q_PROPERTY ( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged ) + Q_PROPERTY ( QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged ) + Q_PROPERTY ( bool interpolate READ interpolate WRITE setInterpolate ) + Q_PROPERTY ( bool tightBoundary READ tightBoundary WRITE setTightBoundary ) + Q_PROPERTY ( QCPColorScale* colorScale READ colorScale WRITE setColorScale ) /// \endcond public: - explicit QCPColorMap(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPColorMap ( QCPAxis* keyAxis, QCPAxis* valueAxis ); virtual ~QCPColorMap(); // getters: @@ -3099,27 +3105,27 @@ public: QCPColorScale* colorScale() const { return mColorScale.data(); } // setters: - void setData(QCPColorMapData* data, bool copy = false); - Q_SLOT void setDataRange(const QCPRange& dataRange); - Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType); - Q_SLOT void setGradient(const QCPColorGradient& gradient); - void setInterpolate(bool enabled); - void setTightBoundary(bool enabled); - void setColorScale(QCPColorScale* colorScale); + void setData ( QCPColorMapData* data, bool copy = false ); + Q_SLOT void setDataRange ( const QCPRange& dataRange ); + Q_SLOT void setDataScaleType ( QCPAxis::ScaleType scaleType ); + Q_SLOT void setGradient ( const QCPColorGradient& gradient ); + void setInterpolate ( bool enabled ); + void setTightBoundary ( bool enabled ); + void setColorScale ( QCPColorScale* colorScale ); // non-property methods: - void rescaleDataRange(bool recalculateDataBounds = false); - Q_SLOT void updateLegendIcon(Qt::TransformationMode transformMode = Qt::SmoothTransformation, - const QSize& thumbSize = QSize(32, 18)); + void rescaleDataRange ( bool recalculateDataBounds = false ); + Q_SLOT void updateLegendIcon ( Qt::TransformationMode transformMode = Qt::SmoothTransformation, + const QSize& thumbSize = QSize ( 32, 18 ) ); // reimplemented virtual methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; signals: - void dataRangeChanged(QCPRange newRange); - void dataScaleTypeChanged(QCPAxis::ScaleType scaleType); - void gradientChanged(QCPColorGradient newGradient); + void dataRangeChanged ( QCPRange newRange ); + void dataScaleTypeChanged ( QCPAxis::ScaleType scaleType ); + void gradientChanged ( QCPColorGradient newGradient ); protected: // property members: @@ -3139,10 +3145,10 @@ protected: virtual void updateMapImage(); // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; friend class QCustomPlot; friend class QCPLegend; @@ -3157,10 +3163,10 @@ class QCP_LIB_DECL QCPFinancialData { public: QCPFinancialData(); - QCPFinancialData(double key, double open, double high, double low, double close); + QCPFinancialData ( double key, double open, double high, double low, double close ); double key, open, high, low, close; }; -Q_DECLARE_TYPEINFO(QCPFinancialData, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO ( QCPFinancialData, Q_MOVABLE_TYPE ); /*! \typedef QCPFinancialDataMap Container for storing \ref QCPFinancialData items in a sorted fashion. The key of the map @@ -3178,13 +3184,13 @@ class QCP_LIB_DECL QCPFinancial : public QCPAbstractPlottable { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(ChartStyle chartStyle READ chartStyle WRITE setChartStyle) - Q_PROPERTY(double width READ width WRITE setWidth) - Q_PROPERTY(bool twoColored READ twoColored WRITE setTwoColored) - Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive) - Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative) - Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive) - Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative) + Q_PROPERTY ( ChartStyle chartStyle READ chartStyle WRITE setChartStyle ) + Q_PROPERTY ( double width READ width WRITE setWidth ) + Q_PROPERTY ( bool twoColored READ twoColored WRITE setTwoColored ) + Q_PROPERTY ( QBrush brushPositive READ brushPositive WRITE setBrushPositive ) + Q_PROPERTY ( QBrush brushNegative READ brushNegative WRITE setBrushNegative ) + Q_PROPERTY ( QPen penPositive READ penPositive WRITE setPenPositive ) + Q_PROPERTY ( QPen penNegative READ penNegative WRITE setPenNegative ) /// \endcond public: /*! @@ -3195,9 +3201,9 @@ public: enum ChartStyle { csOhlc ///< Open-High-Low-Close bar representation , csCandlestick ///< Candlestick representation }; - Q_ENUMS(ChartStyle) + Q_ENUMS ( ChartStyle ) - explicit QCPFinancial(QCPAxis* keyAxis, QCPAxis* valueAxis); + explicit QCPFinancial ( QCPAxis* keyAxis, QCPAxis* valueAxis ); virtual ~QCPFinancial(); // getters: @@ -3212,35 +3218,35 @@ public: // setters: - void setData(QCPFinancialDataMap* data, bool copy = false); - void setData(const QVector& key, const QVector& open, const QVector& high, - const QVector& low, const QVector& close); - void setChartStyle(ChartStyle style); - void setWidth(double width); - void setTwoColored(bool twoColored); - void setBrushPositive(const QBrush& brush); - void setBrushNegative(const QBrush& brush); - void setPenPositive(const QPen& pen); - void setPenNegative(const QPen& pen); + void setData ( QCPFinancialDataMap* data, bool copy = false ); + void setData ( const QVector& key, const QVector& open, const QVector& high, + const QVector& low, const QVector& close ); + void setChartStyle ( ChartStyle style ); + void setWidth ( double width ); + void setTwoColored ( bool twoColored ); + void setBrushPositive ( const QBrush& brush ); + void setBrushNegative ( const QBrush& brush ); + void setPenPositive ( const QPen& pen ); + void setPenNegative ( const QPen& pen ); // non-property methods: - void addData(const QCPFinancialDataMap& dataMap); - void addData(const QCPFinancialData& data); - void addData(double key, double open, double high, double low, double close); - void addData(const QVector& key, const QVector& open, const QVector& high, - const QVector& low, const QVector& close); - void removeDataBefore(double key); - void removeDataAfter(double key); - void removeData(double fromKey, double toKey); - void removeData(double key); + void addData ( const QCPFinancialDataMap& dataMap ); + void addData ( const QCPFinancialData& data ); + void addData ( double key, double open, double high, double low, double close ); + void addData ( const QVector& key, const QVector& open, const QVector& high, + const QVector& low, const QVector& close ); + void removeDataBefore ( double key ); + void removeDataAfter ( double key ); + void removeData ( double fromKey, double toKey ); + void removeData ( double key ); // reimplemented virtual methods: virtual void clearData(); - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // static methods: - static QCPFinancialDataMap timeSeriesToOhlc(const QVector& time, const QVector& value, - double timeBinSize, double timeBinOffset = 0); + static QCPFinancialDataMap timeSeriesToOhlc ( const QVector& time, const QVector& value, + double timeBinSize, double timeBinOffset = 0 ); protected: // property members: @@ -3252,21 +3258,22 @@ protected: QPen mPenPositive, mPenNegative; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual void drawLegendIcon(QCPPainter* painter, const QRectF& rect) const; - virtual QCPRange getKeyRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; - virtual QCPRange getValueRange(bool& foundRange, SignDomain inSignDomain = sdBoth) const; + virtual void draw ( QCPPainter* painter ); + virtual void drawLegendIcon ( QCPPainter* painter, const QRectF& rect ) const; + virtual QCPRange getKeyRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; + virtual QCPRange getValueRange ( bool& foundRange, SignDomain inSignDomain = sdBoth ) const; // non-virtual methods: - void drawOhlcPlot(QCPPainter* painter, const QCPFinancialDataMap::const_iterator& begin, - const QCPFinancialDataMap::const_iterator& end); - void drawCandlestickPlot(QCPPainter* painter, const QCPFinancialDataMap::const_iterator& begin, - const QCPFinancialDataMap::const_iterator& end); - double ohlcSelectTest(const QPointF& pos, const QCPFinancialDataMap::const_iterator& begin, - const QCPFinancialDataMap::const_iterator& end) const; - double candlestickSelectTest(const QPointF& pos, const QCPFinancialDataMap::const_iterator& begin, - const QCPFinancialDataMap::const_iterator& end) const; - void getVisibleDataBounds(QCPFinancialDataMap::const_iterator& lower, QCPFinancialDataMap::const_iterator& upper) const; + void drawOhlcPlot ( QCPPainter* painter, const QCPFinancialDataMap::const_iterator& begin, + const QCPFinancialDataMap::const_iterator& end ); + void drawCandlestickPlot ( QCPPainter* painter, const QCPFinancialDataMap::const_iterator& begin, + const QCPFinancialDataMap::const_iterator& end ); + double ohlcSelectTest ( const QPointF& pos, const QCPFinancialDataMap::const_iterator& begin, + const QCPFinancialDataMap::const_iterator& end ) const; + double candlestickSelectTest ( const QPointF& pos, const QCPFinancialDataMap::const_iterator& begin, + const QCPFinancialDataMap::const_iterator& end ) const; + void getVisibleDataBounds ( QCPFinancialDataMap::const_iterator& lower, + QCPFinancialDataMap::const_iterator& upper ) const; friend class QCustomPlot; friend class QCPLegend; @@ -3277,11 +3284,11 @@ class QCP_LIB_DECL QCPItemStraightLine : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) /// \endcond public: - QCPItemStraightLine(QCustomPlot* parentPlot); + QCPItemStraightLine ( QCustomPlot* parentPlot ); virtual ~QCPItemStraightLine(); // getters: @@ -3289,11 +3296,11 @@ public: QPen selectedPen() const { return mSelectedPen; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const point1; QCPItemPosition* const point2; @@ -3303,11 +3310,11 @@ protected: QPen mPen, mSelectedPen; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); // non-virtual methods: - double distToStraightLine(const QVector2D& point1, const QVector2D& vec, const QVector2D& point) const; - QLineF getRectClippedStraightLine(const QVector2D& point1, const QVector2D& vec, const QRect& rect) const; + double distToStraightLine ( const QVector2D& point1, const QVector2D& vec, const QVector2D& point ) const; + QLineF getRectClippedStraightLine ( const QVector2D& point1, const QVector2D& vec, const QRect& rect ) const; QPen mainPen() const; }; @@ -3316,13 +3323,13 @@ class QCP_LIB_DECL QCPItemLine : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QCPLineEnding head READ head WRITE setHead) - Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QCPLineEnding head READ head WRITE setHead ) + Q_PROPERTY ( QCPLineEnding tail READ tail WRITE setTail ) /// \endcond public: - QCPItemLine(QCustomPlot* parentPlot); + QCPItemLine ( QCustomPlot* parentPlot ); virtual ~QCPItemLine(); // getters: @@ -3332,13 +3339,13 @@ public: QCPLineEnding tail() const { return mTail; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setHead(const QCPLineEnding& head); - void setTail(const QCPLineEnding& tail); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setHead ( const QCPLineEnding& head ); + void setTail ( const QCPLineEnding& tail ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const start; QCPItemPosition* const end; @@ -3349,10 +3356,10 @@ protected: QCPLineEnding mHead, mTail; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); // non-virtual methods: - QLineF getRectClippedLine(const QVector2D& start, const QVector2D& end, const QRect& rect) const; + QLineF getRectClippedLine ( const QVector2D& start, const QVector2D& end, const QRect& rect ) const; QPen mainPen() const; }; @@ -3361,13 +3368,13 @@ class QCP_LIB_DECL QCPItemCurve : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QCPLineEnding head READ head WRITE setHead) - Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QCPLineEnding head READ head WRITE setHead ) + Q_PROPERTY ( QCPLineEnding tail READ tail WRITE setTail ) /// \endcond public: - QCPItemCurve(QCustomPlot* parentPlot); + QCPItemCurve ( QCustomPlot* parentPlot ); virtual ~QCPItemCurve(); // getters: @@ -3377,13 +3384,13 @@ public: QCPLineEnding tail() const { return mTail; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setHead(const QCPLineEnding& head); - void setTail(const QCPLineEnding& tail); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setHead ( const QCPLineEnding& head ); + void setTail ( const QCPLineEnding& tail ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const start; QCPItemPosition* const startDir; @@ -3396,7 +3403,7 @@ protected: QCPLineEnding mHead, mTail; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); // non-virtual methods: QPen mainPen() const; @@ -3407,13 +3414,13 @@ class QCP_LIB_DECL QCPItemRect : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) /// \endcond public: - QCPItemRect(QCustomPlot* parentPlot); + QCPItemRect ( QCustomPlot* parentPlot ); virtual ~QCPItemRect(); // getters: @@ -3423,13 +3430,13 @@ public: QBrush selectedBrush() const { return mSelectedBrush; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setSelectedBrush(const QBrush& brush); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setSelectedBrush ( const QBrush& brush ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const topLeft; QCPItemPosition* const bottomRight; @@ -3448,8 +3455,8 @@ protected: QBrush mBrush, mSelectedBrush; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual void draw ( QCPPainter* painter ); + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: QPen mainPen() const; @@ -3461,22 +3468,22 @@ class QCP_LIB_DECL QCPItemText : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor) - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) - Q_PROPERTY(QString text READ text WRITE setText) - Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment) - Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment) - Q_PROPERTY(double rotation READ rotation WRITE setRotation) - Q_PROPERTY(QMargins padding READ padding WRITE setPadding) + Q_PROPERTY ( QColor color READ color WRITE setColor ) + Q_PROPERTY ( QColor selectedColor READ selectedColor WRITE setSelectedColor ) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) + Q_PROPERTY ( QFont font READ font WRITE setFont ) + Q_PROPERTY ( QFont selectedFont READ selectedFont WRITE setSelectedFont ) + Q_PROPERTY ( QString text READ text WRITE setText ) + Q_PROPERTY ( Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment ) + Q_PROPERTY ( Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment ) + Q_PROPERTY ( double rotation READ rotation WRITE setRotation ) + Q_PROPERTY ( QMargins padding READ padding WRITE setPadding ) /// \endcond public: - QCPItemText(QCustomPlot* parentPlot); + QCPItemText ( QCustomPlot* parentPlot ); virtual ~QCPItemText(); // getters: @@ -3495,22 +3502,22 @@ public: QMargins padding() const { return mPadding; } // setters; - void setColor(const QColor& color); - void setSelectedColor(const QColor& color); - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setSelectedBrush(const QBrush& brush); - void setFont(const QFont& font); - void setSelectedFont(const QFont& font); - void setText(const QString& text); - void setPositionAlignment(Qt::Alignment alignment); - void setTextAlignment(Qt::Alignment alignment); - void setRotation(double degrees); - void setPadding(const QMargins& padding); + void setColor ( const QColor& color ); + void setSelectedColor ( const QColor& color ); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setSelectedBrush ( const QBrush& brush ); + void setFont ( const QFont& font ); + void setSelectedFont ( const QFont& font ); + void setText ( const QString& text ); + void setPositionAlignment ( Qt::Alignment alignment ); + void setTextAlignment ( Qt::Alignment alignment ); + void setRotation ( double degrees ); + void setPadding ( const QMargins& padding ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const position; QCPItemAnchor* const topLeft; @@ -3537,11 +3544,11 @@ protected: QMargins mPadding; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual void draw ( QCPPainter* painter ); + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: - QPointF getTextDrawPoint(const QPointF& pos, const QRectF& rect, Qt::Alignment positionAlignment) const; + QPointF getTextDrawPoint ( const QPointF& pos, const QRectF& rect, Qt::Alignment positionAlignment ) const; QFont mainFont() const; QColor mainColor() const; QPen mainPen() const; @@ -3553,13 +3560,13 @@ class QCP_LIB_DECL QCPItemEllipse : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) /// \endcond public: - QCPItemEllipse(QCustomPlot* parentPlot); + QCPItemEllipse ( QCustomPlot* parentPlot ); virtual ~QCPItemEllipse(); // getters: @@ -3569,13 +3576,13 @@ public: QBrush selectedBrush() const { return mSelectedBrush; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setSelectedBrush(const QBrush& brush); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setSelectedBrush ( const QBrush& brush ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const topLeft; QCPItemPosition* const bottomRight; @@ -3597,8 +3604,8 @@ protected: QBrush mBrush, mSelectedBrush; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual void draw ( QCPPainter* painter ); + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: QPen mainPen() const; @@ -3610,15 +3617,15 @@ class QCP_LIB_DECL QCPItemPixmap : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) - Q_PROPERTY(bool scaled READ scaled WRITE setScaled) - Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode) - Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode) - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) + Q_PROPERTY ( QPixmap pixmap READ pixmap WRITE setPixmap ) + Q_PROPERTY ( bool scaled READ scaled WRITE setScaled ) + Q_PROPERTY ( Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode ) + Q_PROPERTY ( Qt::TransformationMode transformationMode READ transformationMode ) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) /// \endcond public: - QCPItemPixmap(QCustomPlot* parentPlot); + QCPItemPixmap ( QCustomPlot* parentPlot ); virtual ~QCPItemPixmap(); // getters: @@ -3630,14 +3637,14 @@ public: QPen selectedPen() const { return mSelectedPen; } // setters; - void setPixmap(const QPixmap& pixmap); - void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio, - Qt::TransformationMode transformationMode = Qt::SmoothTransformation); - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); + void setPixmap ( const QPixmap& pixmap ); + void setScaled ( bool scaled, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio, + Qt::TransformationMode transformationMode = Qt::SmoothTransformation ); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const topLeft; QCPItemPosition* const bottomRight; @@ -3660,12 +3667,12 @@ protected: QPen mPen, mSelectedPen; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual void draw ( QCPPainter* painter ); + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: - void updateScaledPixmap(QRect finalRect = QRect(), bool flipHorz = false, bool flipVert = false); - QRect getFinalRect(bool* flippedHorz = 0, bool* flippedVert = 0) const; + void updateScaledPixmap ( QRect finalRect = QRect(), bool flipHorz = false, bool flipVert = false ); + QRect getFinalRect ( bool* flippedHorz = 0, bool* flippedVert = 0 ) const; QPen mainPen() const; }; @@ -3674,15 +3681,15 @@ class QCP_LIB_DECL QCPItemTracer : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(QBrush brush READ brush WRITE setBrush) - Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush) - Q_PROPERTY(double size READ size WRITE setSize) - Q_PROPERTY(TracerStyle style READ style WRITE setStyle) - Q_PROPERTY(QCPGraph* graph READ graph WRITE setGraph) - Q_PROPERTY(double graphKey READ graphKey WRITE setGraphKey) - Q_PROPERTY(bool interpolating READ interpolating WRITE setInterpolating) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( QBrush brush READ brush WRITE setBrush ) + Q_PROPERTY ( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush ) + Q_PROPERTY ( double size READ size WRITE setSize ) + Q_PROPERTY ( TracerStyle style READ style WRITE setStyle ) + Q_PROPERTY ( QCPGraph* graph READ graph WRITE setGraph ) + Q_PROPERTY ( double graphKey READ graphKey WRITE setGraphKey ) + Q_PROPERTY ( bool interpolating READ interpolating WRITE setInterpolating ) /// \endcond public: /*! @@ -3696,9 +3703,9 @@ public: , tsCircle ///< A circle , tsSquare ///< A square }; - Q_ENUMS(TracerStyle) + Q_ENUMS ( TracerStyle ) - QCPItemTracer(QCustomPlot* parentPlot); + QCPItemTracer ( QCustomPlot* parentPlot ); virtual ~QCPItemTracer(); // getters: @@ -3713,18 +3720,18 @@ public: bool interpolating() const { return mInterpolating; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setBrush(const QBrush& brush); - void setSelectedBrush(const QBrush& brush); - void setSize(double size); - void setStyle(TracerStyle style); - void setGraph(QCPGraph* graph); - void setGraphKey(double key); - void setInterpolating(bool enabled); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setBrush ( const QBrush& brush ); + void setSelectedBrush ( const QBrush& brush ); + void setSize ( double size ); + void setStyle ( TracerStyle style ); + void setGraph ( QCPGraph* graph ); + void setGraphKey ( double key ); + void setInterpolating ( bool enabled ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; // non-virtual methods: void updatePosition(); @@ -3742,7 +3749,7 @@ protected: bool mInterpolating; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); + virtual void draw ( QCPPainter* painter ); // non-virtual methods: QPen mainPen() const; @@ -3754,10 +3761,10 @@ class QCP_LIB_DECL QCPItemBracket : public QCPAbstractItem { Q_OBJECT /// \cond INCLUDE_QPROPERTIES - Q_PROPERTY(QPen pen READ pen WRITE setPen) - Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen) - Q_PROPERTY(double length READ length WRITE setLength) - Q_PROPERTY(BracketStyle style READ style WRITE setStyle) + Q_PROPERTY ( QPen pen READ pen WRITE setPen ) + Q_PROPERTY ( QPen selectedPen READ selectedPen WRITE setSelectedPen ) + Q_PROPERTY ( double length READ length WRITE setLength ) + Q_PROPERTY ( BracketStyle style READ style WRITE setStyle ) /// \endcond public: enum BracketStyle { bsSquare ///< A brace with angled edges @@ -3766,7 +3773,7 @@ public: , bsCalligraphic ///< A curly brace with varying stroke width giving a calligraphic impression }; - QCPItemBracket(QCustomPlot* parentPlot); + QCPItemBracket ( QCustomPlot* parentPlot ); virtual ~QCPItemBracket(); // getters: @@ -3776,13 +3783,13 @@ public: BracketStyle style() const { return mStyle; } // setters; - void setPen(const QPen& pen); - void setSelectedPen(const QPen& pen); - void setLength(double length); - void setStyle(BracketStyle style); + void setPen ( const QPen& pen ); + void setSelectedPen ( const QPen& pen ); + void setLength ( double length ); + void setStyle ( BracketStyle style ); // reimplemented virtual methods: - virtual double selectTest(const QPointF& pos, bool onlySelectable, QVariant* details = 0) const; + virtual double selectTest ( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const; QCPItemPosition* const left; QCPItemPosition* const right; @@ -3796,8 +3803,8 @@ protected: BracketStyle mStyle; // reimplemented virtual methods: - virtual void draw(QCPPainter* painter); - virtual QPointF anchorPixelPoint(int anchorId) const; + virtual void draw ( QCPPainter* painter ); + virtual QPointF anchorPixelPoint ( int anchorId ) const; // non-virtual methods: QPen mainPen() const; diff --git a/src/exquisite/qrcode/qrdecode/qrdecode.pri b/src/exquisite/qrcode/qrdecode/qrdecode.pri index 7b1fd4a0..2792f005 100644 --- a/src/exquisite/qrcode/qrdecode/qrdecode.pri +++ b/src/exquisite/qrcode/qrdecode/qrdecode.pri @@ -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 diff --git a/src/frame/qqtinput.cpp b/src/frame/qqtinput.cpp index 43797035..fb785109 100644 --- a/src/frame/qqtinput.cpp +++ b/src/frame/qqtinput.cpp @@ -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 btn = this->findChildren(); @@ -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);}") diff --git a/src/frame/qqtinput.h b/src/frame/qqtinput.h index 041f099b..32a8bc51 100644 --- a/src/frame/qqtinput.h +++ b/src/frame/qqtinput.h @@ -2,6 +2,7 @@ #define FRMINPUT_H /** + * 原作者 刘典武 mod引用 LGPLv2.1 * T.D.R (QQ:2657635903) mod 2015年12月20日19:44:04 **/ @@ -20,23 +21,23 @@ #include 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 ); //改变字母大小写 QListlabCh; //汉字标签数组 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(); diff --git a/src/frame/qqtinput.ui b/src/frame/qqtinput.ui index 5aa85a25..288af171 100644 --- a/src/frame/qqtinput.ui +++ b/src/frame/qqtinput.ui @@ -1,7 +1,7 @@ - frmInput - + QQtInput + 0 diff --git a/src/frame/qqtmsgbox.cpp b/src/frame/qqtmsgbox.cpp index d1214593..9de19c10 100644 --- a/src/frame/qqtmsgbox.cpp +++ b/src/frame/qqtmsgbox.cpp @@ -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; diff --git a/src/frame/qqtmsgbox.h b/src/frame/qqtmsgbox.h index f43b9e24..d85d5973 100644 --- a/src/frame/qqtmsgbox.h +++ b/src/frame/qqtmsgbox.h @@ -5,40 +5,40 @@ #include 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 diff --git a/src/frame/qqtmsgbox.ui b/src/frame/qqtmsgbox.ui index cdffece0..d13b3a35 100644 --- a/src/frame/qqtmsgbox.ui +++ b/src/frame/qqtmsgbox.ui @@ -1,7 +1,7 @@ - QQTMsgBox - + QQtMsgBox + 0 diff --git a/src/frame/qqtpassworddialog.cpp b/src/frame/qqtpassworddialog.cpp index bb7948e7..de93e321 100644 --- a/src/frame/qqtpassworddialog.cpp +++ b/src/frame/qqtpassworddialog.cpp @@ -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); diff --git a/src/frame/qqtpassworddialog.h b/src/frame/qqtpassworddialog.h index 66fa5b39..e80b538d 100644 --- a/src/frame/qqtpassworddialog.h +++ b/src/frame/qqtpassworddialog.h @@ -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 diff --git a/src/frame/qqtpassworddialog.ui b/src/frame/qqtpassworddialog.ui index 39914cea..033369e8 100644 --- a/src/frame/qqtpassworddialog.ui +++ b/src/frame/qqtpassworddialog.ui @@ -1,7 +1,7 @@ - QQTPasswordDialog - + QQtPasswordDialog + 0 diff --git a/src/frame/qqtpreviewwidget.cpp b/src/frame/qqtpreviewwidget.cpp index 7d1e742f..3b69f4c5 100644 --- a/src/frame/qqtpreviewwidget.cpp +++ b/src/frame/qqtpreviewwidget.cpp @@ -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; diff --git a/src/frame/qqtpreviewwidget.h b/src/frame/qqtpreviewwidget.h index eebf4af8..2a8327d8 100644 --- a/src/frame/qqtpreviewwidget.h +++ b/src/frame/qqtpreviewwidget.h @@ -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 diff --git a/src/frame/qqtpreviewwidget.ui b/src/frame/qqtpreviewwidget.ui index 8a4cf3d4..9a09e2db 100644 --- a/src/frame/qqtpreviewwidget.ui +++ b/src/frame/qqtpreviewwidget.ui @@ -1,7 +1,7 @@ - QQTPreviewWidget - + QQtPreviewWidget + 0 diff --git a/src/frame/qqtprogressdialog.cpp b/src/frame/qqtprogressdialog.cpp index 03d935d0..ff67b4b9 100644 --- a/src/frame/qqtprogressdialog.cpp +++ b/src/frame/qqtprogressdialog.cpp @@ -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() diff --git a/src/frame/qqtwifiwidget.cpp b/src/frame/qqtwifiwidget.cpp index 695eb8fb..3b8aeea6 100644 --- a/src/frame/qqtwifiwidget.cpp +++ b/src/frame/qqtwifiwidget.cpp @@ -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(); } diff --git a/src/frame/qqtwifiwidget.h b/src/frame/qqtwifiwidget.h index 7b15a8e2..9207e8e1 100644 --- a/src/frame/qqtwifiwidget.h +++ b/src/frame/qqtwifiwidget.h @@ -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 diff --git a/src/frame/qqtwifiwidget.ui b/src/frame/qqtwifiwidget.ui index e4c502dc..f3c656a0 100644 --- a/src/frame/qqtwifiwidget.ui +++ b/src/frame/qqtwifiwidget.ui @@ -2,8 +2,8 @@ - QQTWIFIWidget - + QQtWiFiWidget + 0 diff --git a/src/frame/qqtword.cpp b/src/frame/qqtword.cpp index 9336d2ac..a87fee69 100644 --- a/src/frame/qqtword.cpp +++ b/src/frame/qqtword.cpp @@ -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 QQTWord::tableSpans(const QTableView* table) +QHash QQtWord::tableSpans(const QTableView* table) { Q_ASSERT(table); diff --git a/src/frame/qqtword.h b/src/frame/qqtword.h index 68403fcc..60d16afb 100644 --- a/src/frame/qqtword.h +++ b/src/frame/qqtword.h @@ -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 pageSceneVector; - QQTGraphicsScene* pageScene; + QVector pageSceneVector; + QQtGraphicsScene* pageScene; /* * 页面元素 @@ -147,7 +147,7 @@ private: QFontMetrics* fmt; - QHash tableSpans(const QTableView* table); + QHash tableSpans ( const QTableView* table ); }; #endif // QQTWORD_H diff --git a/src/gui/qqtjsontreemodel.cpp b/src/gui/qqtjsontreemodel.cpp index 2ceb635c..4c2f3ebc 100644 --- a/src/gui/qqtjsontreemodel.cpp +++ b/src/gui/qqtjsontreemodel.cpp @@ -52,7 +52,7 @@ bool QQtJsonTreeModel::query ( QString condition ) } /** - * @brief QQTXmlTreeModel::parseChildElement + * @brief QQtXmlTreeModel::parseChildElement * @param element * @param parent * 这套递归代码,第一次和最后一次不同。 diff --git a/src/gui/qqtxmltreemodel.cpp b/src/gui/qqtxmltreemodel.cpp index 6a300b54..4af53f22 100644 --- a/src/gui/qqtxmltreemodel.cpp +++ b/src/gui/qqtxmltreemodel.cpp @@ -3,12 +3,12 @@ #include "qqtcore.h" #include -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 diff --git a/src/gui/qqtxmltreemodel.h b/src/gui/qqtxmltreemodel.h index d51ea405..8a7312a5 100644 --- a/src/gui/qqtxmltreemodel.h +++ b/src/gui/qqtxmltreemodel.h @@ -5,11 +5,11 @@ #include #include -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: diff --git a/src/multimedia/qqtmplayer.cpp b/src/multimedia/qqtmplayer.cpp index 8b36c487..10e84984 100644 --- a/src/multimedia/qqtmplayer.cpp +++ b/src/multimedia/qqtmplayer.cpp @@ -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); diff --git a/src/multimedia/qqtmplayer.h b/src/multimedia/qqtmplayer.h index b416779e..d2c22a6f 100644 --- a/src/multimedia/qqtmplayer.h +++ b/src/multimedia/qqtmplayer.h @@ -4,22 +4,22 @@ #include #include -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: diff --git a/src/network/qqtclient.cpp b/src/network/qqtclient.cpp index f194c103..355c042f 100644 --- a/src/network/qqtclient.cpp +++ b/src/network/qqtclient.cpp @@ -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(); diff --git a/src/network/qqtclient.h b/src/network/qqtclient.h index ac74b701..f32005dc 100644 --- a/src/network/qqtclient.h +++ b/src/network/qqtclient.h @@ -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(); diff --git a/src/network/qqtethenetmanager.cpp b/src/network/qqtethenetmanager.cpp index 844e4427..e98d77da 100644 --- a/src/network/qqtethenetmanager.cpp +++ b/src/network/qqtethenetmanager.cpp @@ -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::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; diff --git a/src/network/qqtethenetmanager.h b/src/network/qqtethenetmanager.h index 9945a1ed..388ca0b9 100644 --- a/src/network/qqtethenetmanager.h +++ b/src/network/qqtethenetmanager.h @@ -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& 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 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; }; diff --git a/src/network/qqtserver.cpp b/src/network/qqtserver.cpp index 24e83e26..b8fe641a 100644 --- a/src/network/qqtserver.cpp +++ b/src/network/qqtserver.cpp @@ -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; } diff --git a/src/network/qqtserver.h b/src/network/qqtserver.h index 9f66f694..63b23b31 100644 --- a/src/network/qqtserver.h +++ b/src/network/qqtserver.h @@ -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; }; diff --git a/src/pluginwatcher/qqtpluginwatcher.cpp b/src/pluginwatcher/qqtpluginwatcher.cpp index 0af9e476..d38b1200 100644 --- a/src/pluginwatcher/qqtpluginwatcher.cpp +++ b/src/pluginwatcher/qqtpluginwatcher.cpp @@ -6,8 +6,8 @@ #include #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()) { diff --git a/src/pluginwatcher/qqtpluginwatcher.h b/src/pluginwatcher/qqtpluginwatcher.h index 995d6801..9c836d09 100644 --- a/src/pluginwatcher/qqtpluginwatcher.h +++ b/src/pluginwatcher/qqtpluginwatcher.h @@ -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; diff --git a/src/printsupport/qqtprinter.cpp b/src/printsupport/qqtprinter.cpp index 4b2bab84..8164089e 100644 --- a/src/printsupport/qqtprinter.cpp +++ b/src/printsupport/qqtprinter.cpp @@ -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() { /* * 此处不会影响打印质量,不必再调试 diff --git a/src/printsupport/qqtprinter.h b/src/printsupport/qqtprinter.h index e506ddf2..d5cc5918 100644 --- a/src/printsupport/qqtprinter.h +++ b/src/printsupport/qqtprinter.h @@ -4,12 +4,12 @@ #include #include -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: diff --git a/src/qqt_3rdparty.pri b/src/qqt_3rdparty.pri index 02c611a9..8a07b44e 100644 --- a/src/qqt_3rdparty.pri +++ b/src/qqt_3rdparty.pri @@ -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) { diff --git a/src/qqt_header.pri b/src/qqt_header.pri index cfb27757..eb8a7d6f 100644 --- a/src/qqt_header.pri +++ b/src/qqt_header.pri @@ -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 diff --git a/src/qqt_source.pri b/src/qqt_source.pri index 07578b1e..7075f936 100644 --- a/src/qqt_source.pri +++ b/src/qqt_source.pri @@ -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 diff --git a/src/widgets/qqtapplication.cpp b/src/widgets/qqtapplication.cpp index d1350b5a..9a5736da 100644 --- a/src/widgets/qqtapplication.cpp +++ b/src/widgets/qqtapplication.cpp @@ -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; } diff --git a/src/widgets/qqtgraphicsitem.cpp b/src/widgets/qqtgraphicsitem.cpp index bed34e85..00c7e3fb 100644 --- a/src/widgets/qqtgraphicsitem.cpp +++ b/src/widgets/qqtgraphicsitem.cpp @@ -3,40 +3,40 @@ #include #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()); diff --git a/src/widgets/qqtgraphicsitem.h b/src/widgets/qqtgraphicsitem.h index c1ee625e..2c937467 100644 --- a/src/widgets/qqtgraphicsitem.h +++ b/src/widgets/qqtgraphicsitem.h @@ -5,100 +5,100 @@ #include #include -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 ); }; diff --git a/src/widgets/qqtgraphicsscene.cpp b/src/widgets/qqtgraphicsscene.cpp index c8a16432..1ed04735 100644 --- a/src/widgets/qqtgraphicsscene.cpp +++ b/src/widgets/qqtgraphicsscene.cpp @@ -3,25 +3,25 @@ #include #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) { diff --git a/src/widgets/qqtgraphicsscene.h b/src/widgets/qqtgraphicsscene.h index 6e922818..241963e7 100644 --- a/src/widgets/qqtgraphicsscene.h +++ b/src/widgets/qqtgraphicsscene.h @@ -5,36 +5,37 @@ #include "qqtgraphicsitem.h" #include -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, - 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); } + 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 ); } - 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: }; diff --git a/src/widgets/qqtgraphicsview.cpp b/src/widgets/qqtgraphicsview.cpp index f4162829..ac040c2a 100644 --- a/src/widgets/qqtgraphicsview.cpp +++ b/src/widgets/qqtgraphicsview.cpp @@ -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 778,628 //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) { diff --git a/src/widgets/qqtgraphicsview.h b/src/widgets/qqtgraphicsview.h index ea66884f..47bd015d 100644 --- a/src/widgets/qqtgraphicsview.h +++ b/src/widgets/qqtgraphicsview.h @@ -4,11 +4,11 @@ #include #include -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 diff --git a/src/widgets/qqtheaderview.cpp b/src/widgets/qqtheaderview.cpp index fc12155a..36f8f6aa 100644 --- a/src/widgets/qqtheaderview.cpp +++ b/src/widgets/qqtheaderview.cpp @@ -6,19 +6,19 @@ #include #include -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()); diff --git a/src/widgets/qqtheaderview.h b/src/widgets/qqtheaderview.h index 49ab92a0..9a201085 100644 --- a/src/widgets/qqtheaderview.h +++ b/src/widgets/qqtheaderview.h @@ -4,14 +4,14 @@ #include #include /** - * @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: diff --git a/src/widgets/qqtlineeditwithsearch.cpp b/src/widgets/qqtlineeditwithsearch.cpp index 45831fac..86936eca 100644 --- a/src/widgets/qqtlineeditwithsearch.cpp +++ b/src/widgets/qqtlineeditwithsearch.cpp @@ -2,7 +2,7 @@ #include #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)); diff --git a/src/widgets/qqtlineeditwithsearch.h b/src/widgets/qqtlineeditwithsearch.h index 37d29674..6bb0a5df 100644 --- a/src/widgets/qqtlineeditwithsearch.h +++ b/src/widgets/qqtlineeditwithsearch.h @@ -5,13 +5,13 @@ #include #include -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(); diff --git a/src/widgets/qqttableview.cpp b/src/widgets/qqttableview.cpp index a0e7a7da..504e94d9 100644 --- a/src/widgets/qqttableview.cpp +++ b/src/widgets/qqttableview.cpp @@ -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); diff --git a/src/widgets/qqttableview.h b/src/widgets/qqttableview.h index 37ceac6d..bfe99e6e 100644 --- a/src/widgets/qqttableview.h +++ b/src/widgets/qqttableview.h @@ -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