mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
add QQtChart, open customplot to ios, move all QQT to QQt
This commit is contained in:
parent
df5bc5d0d6
commit
66598fdcad
@ -16,14 +16,14 @@ AnimationManager* AnimationManager::Instance(QObject* parent)
|
|||||||
AnimationManager::AnimationManager(QObject* parent) : QObject(parent)
|
AnimationManager::AnimationManager(QObject* parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
//init app's all animation
|
//init app's all animation
|
||||||
QPushButton* pushButton = (QPushButton*)QQTObjectFactory::registedObject("pushButton");
|
QPushButton* pushButton = (QPushButton*)QQtObjectFactory::registedObject("pushButton");
|
||||||
QPushButton* pushButton_2 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_2");
|
QPushButton* pushButton_2 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_2");
|
||||||
QPushButton* pushButton_3 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_3");
|
QPushButton* pushButton_3 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_3");
|
||||||
QPushButton* pushButton_4 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_4");
|
QPushButton* pushButton_4 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_4");
|
||||||
QPushButton* pushButton_5 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_5");
|
QPushButton* pushButton_5 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_5");
|
||||||
QPushButton* pushButton_6 = (QPushButton*)QQTObjectFactory::registedObject("pushButton_6");
|
QPushButton* pushButton_6 = (QPushButton*)QQtObjectFactory::registedObject("pushButton_6");
|
||||||
|
|
||||||
QQTAnimation* ani = new QQTAnimation(this);
|
QQtAnimation* ani = new QQtAnimation(this);
|
||||||
QSequentialAnimationGroup* sa = new QSequentialAnimationGroup(ani);
|
QSequentialAnimationGroup* sa = new QSequentialAnimationGroup(ani);
|
||||||
QParallelAnimationGroup* pa = new QParallelAnimationGroup(ani);
|
QParallelAnimationGroup* pa = new QParallelAnimationGroup(ani);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -14,7 +14,7 @@ QQTWindow::QQTWindow(QWidget* parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
@ -29,15 +29,15 @@ QQTWindow::QQTWindow(QWidget* parent) :
|
|||||||
setFixedSize(1024, 600);
|
setFixedSize(1024, 600);
|
||||||
moveCenter(this);
|
moveCenter(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(ui->pushButton);
|
QQtObjectFactory::registerObject(ui->pushButton);
|
||||||
QQTObjectFactory::registerObject(ui->pushButton_2);
|
QQtObjectFactory::registerObject(ui->pushButton_2);
|
||||||
QQTObjectFactory::registerObject(ui->pushButton_3);
|
QQtObjectFactory::registerObject(ui->pushButton_3);
|
||||||
QQTObjectFactory::registerObject(ui->pushButton_4);
|
QQtObjectFactory::registerObject(ui->pushButton_4);
|
||||||
QQTObjectFactory::registerObject(ui->pushButton_5);
|
QQtObjectFactory::registerObject(ui->pushButton_5);
|
||||||
QQTObjectFactory::registerObject(ui->pushButton_6);
|
QQtObjectFactory::registerObject(ui->pushButton_6);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTAnimationManager::Instance
|
* @brief QQtAnimationManager::Instance
|
||||||
* 开启或者关闭动画
|
* 开启或者关闭动画
|
||||||
*/
|
*/
|
||||||
AnimationManager::Instance(this);
|
AnimationManager::Instance(this);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -99,20 +99,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -139,13 +139,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -100,20 +100,20 @@ QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -140,13 +140,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if(file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -17,7 +17,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -25,8 +25,8 @@ AnimationManager::AnimationManager(QObject *parent) : QObject(parent)
|
|||||||
* user can't decate qqtwindow
|
* user can't decate qqtwindow
|
||||||
*/
|
*/
|
||||||
QQTWindow* qqtwindow = (QQTWindow*)
|
QQTWindow* qqtwindow = (QQTWindow*)
|
||||||
QQTObjectFactory::registedObject("QQTWindow");
|
QQtObjectFactory::registedObject("QQTWindow");
|
||||||
QQTAnimation* ani = new QQTAnimation(this);
|
QQtAnimation* ani = new QQtAnimation(this);
|
||||||
QSequentialAnimationGroup* sani = new QSequentialAnimationGroup(ani);
|
QSequentialAnimationGroup* sani = new QSequentialAnimationGroup(ani);
|
||||||
QParallelAnimationGroup* pani = new QParallelAnimationGroup(ani);
|
QParallelAnimationGroup* pani = new QParallelAnimationGroup(ani);
|
||||||
QPropertyAnimation* ani1 = new QPropertyAnimation(qqtwindow, "geometry");
|
QPropertyAnimation* ani1 = new QPropertyAnimation(qqtwindow, "geometry");
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -98,20 +98,20 @@ QQTApp::QQTApp(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -138,13 +138,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -22,7 +22,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -3,29 +3,29 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt-qt.h"
|
#include "qqt-qt.h"
|
||||||
|
|
||||||
QQTClient* QQTUpgradeClientInstance(QObject* parent)
|
QQtClient* QQTUpgradeClientInstance(QObject* parent)
|
||||||
{
|
{
|
||||||
static QQTClient* cli = NULL;
|
static QQtClient* cli = NULL;
|
||||||
if (!cli)
|
if (!cli)
|
||||||
{
|
{
|
||||||
QStringList ip;
|
QStringList ip;
|
||||||
ip << "222.175.114.244" << "124.133.1.54";
|
ip << "222.175.114.244" << "124.133.1.54";
|
||||||
//"www.QQToo.com"
|
//"www.QQToo.com"
|
||||||
cli = new QQTClient(parent);
|
cli = new QQtClient(parent);
|
||||||
cli->SetServerIPAddress(ip);
|
cli->SetServerIPAddress(ip);
|
||||||
cli->SetServerPort(8089);
|
cli->SetServerPort(8089);
|
||||||
}
|
}
|
||||||
return cli;
|
return cli;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTClient* QQTCloudClientInstance(QObject* parent)
|
QQtClient* QQTCloudClientInstance(QObject* parent)
|
||||||
{
|
{
|
||||||
static QQTClient* cli = NULL;
|
static QQtClient* cli = NULL;
|
||||||
if (!cli)
|
if (!cli)
|
||||||
{
|
{
|
||||||
QStringList ip;
|
QStringList ip;
|
||||||
ip << "222.175.114.244" << "124.133.1.54";
|
ip << "222.175.114.244" << "124.133.1.54";
|
||||||
cli = new QQTClient(parent);
|
cli = new QQtClient(parent);
|
||||||
cli->SetServerIPAddress(ip);
|
cli->SetServerIPAddress(ip);
|
||||||
cli->SetServerPort(7079);
|
cli->SetServerPort(7079);
|
||||||
}
|
}
|
||||||
|
@ -424,10 +424,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
QQTClient *QQTUpgradeClientInstance(QObject *parent);
|
QQtClient *QQTUpgradeClientInstance(QObject *parent);
|
||||||
|
|
||||||
|
|
||||||
QQTClient *QQTCloudClientInstance(QObject *parent);
|
QQtClient *QQTCloudClientInstance(QObject *parent);
|
||||||
|
|
||||||
|
|
||||||
#endif // QQTCLOUDPROTOCOL_H
|
#endif // QQTCLOUDPROTOCOL_H
|
||||||
|
@ -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);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,6 @@ public:
|
|||||||
bool dispatcher(const QByteArray &m) override;
|
bool dispatcher(const QByteArray &m) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
QQTServer *QQTSingleServer(QObject* parent);
|
QQtServer *QQTSingleServer(QObject* parent);
|
||||||
|
|
||||||
#endif // QQTLANPROTOCOL_H
|
#endif // QQTLANPROTOCOL_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
void QQTLanServer(QObject* parent = 0)
|
void QQTLanServer(QObject* parent = 0)
|
||||||
{
|
{
|
||||||
static QQTServer* s = new QQTServer(parent);
|
static QQtServer* s = new QQtServer(parent);
|
||||||
s->listen(QHostAddress::Any, 8000);
|
s->listen(QHostAddress::Any, 8000);
|
||||||
|
|
||||||
s->installedProtocol();
|
s->installedProtocol();
|
||||||
@ -100,20 +100,20 @@ QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
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)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
//QQTClient
|
//QQtClient
|
||||||
//QQTCloudClientInstance(this);
|
//QQTCloudClientInstance(this);
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
//QQTEthManager
|
//QQTEthManager
|
||||||
QQTEthenetManager::Instance(this);
|
QQtEthenetManager::Instance(this);
|
||||||
#endif
|
#endif
|
||||||
//QQTServer
|
//QQtServer
|
||||||
//QQTPeerPort
|
//QQTPeerPort
|
||||||
|
|
||||||
//QQTPeerPortInstance(this);
|
//QQTPeerPortInstance(this);
|
||||||
@ -140,13 +140,13 @@ void QQTApp::setLanguage()
|
|||||||
|
|
||||||
void QQTApp::slotUPanAutoRun(int status)
|
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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
if(file.exists())
|
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;
|
return;
|
||||||
QProcess* p = new QProcess(this);
|
QProcess* p = new QProcess(this);
|
||||||
p->setWorkingDirectory(mP);
|
p->setWorkingDirectory(mP);
|
||||||
|
@ -13,7 +13,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
/*
|
/*
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QQTLineEditWithSearch" name="lineEdit">
|
<widget class="QQtLineEditWithSearch" name="lineEdit">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>QQTLineEditWithSearch</class>
|
<class>QQtLineEditWithSearch</class>
|
||||||
<extends>QLineEdit</extends>
|
<extends>QLineEdit</extends>
|
||||||
<header location="global">qqtlineeditwithsearch.h</header>
|
<header location="global">qqtlineeditwithsearch.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
6
src/charts/qqtchart.cpp
Normal file
6
src/charts/qqtchart.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "qqtchart.h"
|
||||||
|
|
||||||
|
QQtChart::QQtChart(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
17
src/charts/qqtchart.h
Normal file
17
src/charts/qqtchart.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef QQTCHART_H
|
||||||
|
#define QQTCHART_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class QQtChart : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QQtChart(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QQTCHART_H
|
13
src/charts/qqtchartview.cpp
Normal file
13
src/charts/qqtchartview.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include "qqtchartview.h"
|
||||||
|
|
||||||
|
QQtChartView::QQtChartView ( QWidget* parent ) :
|
||||||
|
QChartView ( parent )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QQtChartView::QQtChartView ( QChart* chart, QWidget* parent ) :
|
||||||
|
QChartView ( chart, parent )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
29
src/charts/qqtchartview.h
Normal file
29
src/charts/qqtchartview.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef QQTCHARTVIEW_H
|
||||||
|
#define QQTCHARTVIEW_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QtCharts/QChartView>
|
||||||
|
#include <QtCharts/QBarSeries>
|
||||||
|
#include <QtCharts/QBarSet>
|
||||||
|
#include <QtCharts/QLegend>
|
||||||
|
#include <QtCharts/QBarCategoryAxis>
|
||||||
|
|
||||||
|
QT_CHARTS_USE_NAMESPACE
|
||||||
|
|
||||||
|
#include "qqtcore.h"
|
||||||
|
#include "qqt-local.h"
|
||||||
|
|
||||||
|
class QQTSHARED_EXPORT QQtChartView : public QChartView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QQtChartView ( QWidget* parent = nullptr );
|
||||||
|
explicit QQtChartView ( QChart* chart, QWidget* parent = nullptr );
|
||||||
|
virtual ~QQtChartView() {}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QQTCHARTVIEW_H
|
@ -1,6 +1,6 @@
|
|||||||
#include "qqtanimation.h"
|
#include "qqtanimation.h"
|
||||||
|
|
||||||
QQTAnimation::QQTAnimation(QObject* parent) : QParallelAnimationGroup(parent)
|
QQtAnimation::QQtAnimation(QObject* parent) : QParallelAnimationGroup(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTAnimation : public QParallelAnimationGroup
|
class QQTSHARED_EXPORT QQtAnimation : public QParallelAnimationGroup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTAnimation(QObject* parent = nullptr);
|
explicit QQtAnimation ( QObject* parent = nullptr );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ typedef unsigned char uint8_t;
|
|||||||
#define NOTICE "Notice"
|
#define NOTICE "Notice"
|
||||||
|
|
||||||
|
|
||||||
QQTSHARED_EXPORT void QQTSleep(int millsecond);
|
QQTSHARED_EXPORT void QQTSleep ( int millsecond );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#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")
|
#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
|
* QMutex,QSemphore,QCondation在gui线程会锁定gui,而我希望在gui线程中堵塞但是不要锁定gui
|
||||||
* 这个block应用场合为gui线程内部,不适用线程之间
|
* 这个block应用场合为gui线程内部,不适用线程之间
|
||||||
* 仅仅锁定一次和解锁一次,多次锁定和解锁无用途。
|
* 仅仅锁定一次和解锁一次,多次锁定和解锁无用途。
|
||||||
*/
|
*/
|
||||||
class QQTSHARED_EXPORT QQTBlock : public QObject
|
class QQTSHARED_EXPORT QQtBlock : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTBlock(QObject* parent = 0): QObject(parent), m_lock(0) {}
|
explicit QQtBlock ( QObject* parent = 0 ) : QObject ( parent ), m_lock ( 0 ) {}
|
||||||
|
|
||||||
//0x7FFFFFFF
|
//0x7FFFFFFF
|
||||||
bool lock(int millsecond = 0x7FFFFFFF) {
|
bool lock ( int millsecond = 0x7FFFFFFF ) {
|
||||||
//m_lock++;
|
//m_lock++;
|
||||||
m_lock = 1;
|
m_lock = 1;
|
||||||
|
|
||||||
timer.restart();
|
timer.restart();
|
||||||
|
|
||||||
while (timer.elapsed() < millsecond) {
|
while ( timer.elapsed() < millsecond ) {
|
||||||
if (m_lock <= 0)
|
if ( m_lock <= 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer.elapsed() >= millsecond)
|
if ( timer.elapsed() >= millsecond )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -164,7 +164,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isLocked() {
|
bool isLocked() {
|
||||||
if (m_lock <= 0)
|
if ( m_lock <= 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The QQTObjectFactory class
|
* @brief The QQtObjectFactory class
|
||||||
* QQT 对象管理器 工厂模式
|
* QQT 对象管理器 工厂模式
|
||||||
*/
|
*/
|
||||||
class QQTSHARED_EXPORT QQTObjectFactory
|
class QQTSHARED_EXPORT QQtObjectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -23,39 +23,39 @@ public:
|
|||||||
* @param parent
|
* @param parent
|
||||||
* @return
|
* @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;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 生成对象,调用constructorHelper<className>(parent)
|
* 生成对象,调用constructorHelper<className>(parent)
|
||||||
*/
|
*/
|
||||||
return (*constructor)(parent);
|
return ( *constructor ) ( parent );
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief registerObject 将对象注册进工厂
|
* @brief registerObject 将对象注册进工厂
|
||||||
* @param w
|
* @param w
|
||||||
*/
|
*/
|
||||||
static void registerObject(const QObject* const& w) {
|
static void registerObject ( const QObject* const& w ) {
|
||||||
containers().push_back(w);
|
containers().push_back ( w );
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief unregisterObject 取消对象在工厂中注册
|
* @brief unregisterObject 取消对象在工厂中注册
|
||||||
* @param w
|
* @param w
|
||||||
*/
|
*/
|
||||||
static void unregisterObject(const QObject*& w) {
|
static void unregisterObject ( const QObject*& w ) {
|
||||||
QListIterator<const QObject*> itor(containers());
|
QListIterator<const QObject*> itor ( containers() );
|
||||||
|
|
||||||
while (itor.hasNext()) {
|
while ( itor.hasNext() ) {
|
||||||
const QObject* ww = itor.next();
|
const QObject* ww = itor.next();
|
||||||
|
|
||||||
if (ww == w) {
|
if ( ww == w ) {
|
||||||
containers().removeOne(w);
|
containers().removeOne ( w );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,13 +65,13 @@ public:
|
|||||||
* @param objName
|
* @param objName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static const QObject* registedObject(const QString objName) {
|
static const QObject* registedObject ( const QString objName ) {
|
||||||
QListIterator<const QObject*> itor(containers());
|
QListIterator<const QObject*> itor ( containers() );
|
||||||
|
|
||||||
while (itor.hasNext()) {
|
while ( itor.hasNext() ) {
|
||||||
const QObject* ww = itor.next();
|
const QObject* ww = itor.next();
|
||||||
|
|
||||||
if (ww->objectName() == objName) {
|
if ( ww->objectName() == objName ) {
|
||||||
return ww;
|
return ww;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,11 +80,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef QObject* (*Constructor)(QObject* parent);
|
typedef QObject* ( *Constructor ) ( QObject* parent );
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static QObject* constructorHelper(QObject* parent) {
|
static QObject* constructorHelper ( QObject* parent ) {
|
||||||
return new T(parent);
|
return new T ( parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
static QHash<QByteArray, Constructor>& constructors() {
|
static QHash<QByteArray, Constructor>& constructors() {
|
||||||
@ -100,7 +100,7 @@ private:
|
|||||||
/*
|
/*
|
||||||
* 将生成此类对象的具体(非模板)函数注册进Hash
|
* 将生成此类对象的具体(非模板)函数注册进Hash
|
||||||
*/
|
*/
|
||||||
constructors().insert(T::staticMetaObject.className(), &constructorHelper<T>);
|
constructors().insert ( T::staticMetaObject.className(), &constructorHelper<T> );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,9 +3,7 @@ QT += core gui
|
|||||||
#lessThan(QT_MAJOR_VERSION, 5): QT += declarative
|
#lessThan(QT_MAJOR_VERSION, 5): QT += declarative
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
|
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
|
||||||
|
|
||||||
DEFINES += QZXING_LIBRARY \
|
DEFINES += ZXING_ICONV_CONST
|
||||||
ZXING_ICONV_CONST \
|
|
||||||
DISABLE_LIBRARY_FEATURES
|
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
HEADERS += $$PWD/imagehandler.h
|
HEADERS += $$PWD/imagehandler.h
|
||||||
|
@ -5,20 +5,20 @@
|
|||||||
#include "qqtsql.h"
|
#include "qqtsql.h"
|
||||||
#include "qqtframe.h"
|
#include "qqtframe.h"
|
||||||
|
|
||||||
QQTInput* QQTInput::_instance = 0;
|
QQtInput* QQtInput::_instance = 0;
|
||||||
QQTInput::QQTInput(QWidget* parent) :
|
QQtInput::QQtInput(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::frmInput)
|
ui(new Ui::QQtInput)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTInput::~QQTInput()
|
QQtInput::~QQtInput()
|
||||||
{
|
{
|
||||||
delete ui;
|
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->currentPosition = position;
|
||||||
this->currentStyle = style;
|
this->currentStyle = style;
|
||||||
@ -34,7 +34,7 @@ void QQTInput::Init(QString type, QString position, QString style, int btnFontSi
|
|||||||
this->changePosition();
|
this->changePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::mouseMoveEvent(QMouseEvent* e)
|
void QQtInput::mouseMoveEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
if (mousePressed && (e->buttons() && Qt::LeftButton))
|
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)
|
if (e->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
@ -53,12 +53,12 @@ void QQTInput::mousePressEvent(QMouseEvent* e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::mouseReleaseEvent(QMouseEvent*)
|
void QQtInput::mouseReleaseEvent(QMouseEvent*)
|
||||||
{
|
{
|
||||||
mousePressed = false;
|
mousePressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::InitForm()
|
void QQtInput::InitForm()
|
||||||
{
|
{
|
||||||
this->mousePressed = false;
|
this->mousePressed = false;
|
||||||
this->setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
|
this->setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
|
||||||
@ -191,7 +191,7 @@ void QQTInput::InitForm()
|
|||||||
qApp->installEventFilter(this);
|
qApp->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::InitProperty()
|
void QQtInput::InitProperty()
|
||||||
{
|
{
|
||||||
ui->btnOther1->setProperty("btnOther", true);
|
ui->btnOther1->setProperty("btnOther", true);
|
||||||
ui->btnOther2->setProperty("btnOther", true);
|
ui->btnOther2->setProperty("btnOther", true);
|
||||||
@ -282,12 +282,12 @@ void QQTInput::InitProperty()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::ShowPanel()
|
void QQtInput::ShowPanel()
|
||||||
{
|
{
|
||||||
this->setVisible(true);
|
this->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQTInput::checkPress()
|
bool QQtInput::checkPress()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 只有属于输入法键盘的合法按钮才继续处理
|
* 只有属于输入法键盘的合法按钮才继续处理
|
||||||
@ -304,7 +304,7 @@ bool QQTInput::checkPress()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::reClicked()
|
void QQtInput::reClicked()
|
||||||
{
|
{
|
||||||
if (isPress)
|
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();
|
//pline() << obj->objectName() << currentEditType << event->type();
|
||||||
if (event->type() == QEvent::MouseButtonPress)
|
if (event->type() == QEvent::MouseButtonPress)
|
||||||
@ -774,7 +774,7 @@ bool QQTInput::eventFilter(QObject* obj, QEvent* event)
|
|||||||
return QWidget::eventFilter(obj, event);
|
return QWidget::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
|
void QQtInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
|
||||||
{
|
{
|
||||||
currentFocusWidget = nowWidget;
|
currentFocusWidget = nowWidget;
|
||||||
|
|
||||||
@ -878,7 +878,7 @@ void QQTInput::focusChanged(QWidget* oldWidget, QWidget* nowWidget)
|
|||||||
//pline() << currentEditType;
|
//pline() << currentEditType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::changeType()
|
void QQtInput::changeType()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 如果需要更改输入法初始模式,改变currentType这个变量即可
|
* 如果需要更改输入法初始模式,改变currentType这个变量即可
|
||||||
@ -920,7 +920,7 @@ void QQTInput::changeType()
|
|||||||
ui->labPY->setText("");
|
ui->labPY->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::changeLetter(bool isUpper)
|
void QQtInput::changeLetter(bool isUpper)
|
||||||
{
|
{
|
||||||
QList<QPushButton*> btn = this->findChildren<QPushButton*>();
|
QList<QPushButton*> btn = this->findChildren<QPushButton*>();
|
||||||
|
|
||||||
@ -940,7 +940,7 @@ void QQTInput::changeLetter(bool isUpper)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::selectChinese()
|
void QQtInput::selectChinese()
|
||||||
{
|
{
|
||||||
clearChinese();
|
clearChinese();
|
||||||
QSqlQuery query(m_db);
|
QSqlQuery query(m_db);
|
||||||
@ -969,7 +969,7 @@ void QQTInput::selectChinese()
|
|||||||
showChinese();
|
showChinese();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::showChinese()
|
void QQtInput::showChinese()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 每个版面最多显示10个汉字
|
* 每个版面最多显示10个汉字
|
||||||
@ -999,7 +999,7 @@ void QQTInput::showChinese()
|
|||||||
qDebug() << "currentPY_index:" << currentPY_index << "currentPY_count:" << currentPY_count;
|
qDebug() << "currentPY_index:" << currentPY_index << "currentPY_count:" << currentPY_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::insertValue(QString value)
|
void QQtInput::insertValue(QString value)
|
||||||
{
|
{
|
||||||
if (currentEditType == "QLineEdit")
|
if (currentEditType == "QLineEdit")
|
||||||
{
|
{
|
||||||
@ -1024,7 +1024,7 @@ void QQTInput::insertValue(QString value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::deleteValue()
|
void QQtInput::deleteValue()
|
||||||
{
|
{
|
||||||
if (currentEditType == "QLineEdit")
|
if (currentEditType == "QLineEdit")
|
||||||
{
|
{
|
||||||
@ -1085,7 +1085,7 @@ void QQTInput::deleteValue()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::setChinese(int index)
|
void QQtInput::setChinese(int index)
|
||||||
{
|
{
|
||||||
int count = currentPY.count();
|
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;
|
currentPY_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::changeRect()
|
void QQtInput::changeRect()
|
||||||
{
|
{
|
||||||
QRect geo = geometry();
|
QRect geo = geometry();
|
||||||
|
|
||||||
@ -1133,7 +1133,7 @@ void QQTInput::changeRect()
|
|||||||
setGeometry(geo);
|
setGeometry(geo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::changePosition()
|
void QQtInput::changePosition()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 如果需要更改输入法面板的显示位置,改变currentPosition这个变量即可
|
* 如果需要更改输入法面板的显示位置,改变currentPosition这个变量即可
|
||||||
@ -1230,7 +1230,7 @@ void QQTInput::changePosition()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTInput::ChangeStyle()
|
void QQtInput::ChangeStyle()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 如果需要更改输入法面板的样式,改变currentStyle这个变量即可
|
* 如果需要更改输入法面板的样式,改变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);
|
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;
|
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));
|
.arg(topColor).arg(bottomColor));
|
||||||
qss.append(
|
qss.append(
|
||||||
QString("QWidget#widgetTopPinyin{background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 %1,stop:1 %2);}")
|
QString("QWidget#widgetTopPinyin{background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 %1,stop:1 %2);}")
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define FRMINPUT_H
|
#define FRMINPUT_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 原作者 刘典武 mod引用 LGPLv2.1
|
||||||
* T.D.R (QQ:2657635903) mod 2015年12月20日19:44:04
|
* T.D.R (QQ:2657635903) mod 2015年12月20日19:44:04
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -20,23 +21,23 @@
|
|||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class frmInput;
|
class QQtInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTInput : public QWidget
|
class QQTSHARED_EXPORT QQtInput : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit QQTInput(QWidget* parent = 0);
|
explicit QQtInput ( QWidget* parent = 0 );
|
||||||
~QQTInput();
|
~QQtInput();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
* 单例模式,保证一个程序只存在一个输入法实例对象
|
* 单例模式,保证一个程序只存在一个输入法实例对象
|
||||||
*/
|
*/
|
||||||
static QQTInput* Instance() {
|
static QQtInput* Instance() {
|
||||||
if (!_instance) {
|
if ( !_instance ) {
|
||||||
_instance = new QQTInput;
|
_instance = new QQtInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _instance;
|
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:
|
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:
|
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,
|
void changeStyle ( QString topColor, QString bottomColor,
|
||||||
QString borderColor, QString textColor);
|
QString borderColor, QString textColor );
|
||||||
/*
|
/*
|
||||||
* 定时器处理退格键
|
* 定时器处理退格键
|
||||||
*/
|
*/
|
||||||
void reClicked();
|
void reClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::frmInput* ui;
|
Ui::QQtInput* ui;
|
||||||
static QQTInput* _instance; //实例对象
|
static QQtInput* _instance; //实例对象
|
||||||
|
|
||||||
int deskWidth; //桌面宽度
|
int deskWidth; //桌面宽度
|
||||||
int deskHeight; //桌面高度
|
int deskHeight; //桌面高度
|
||||||
@ -125,12 +126,12 @@ private:
|
|||||||
QString currentStyle; //当前输入法面板样式
|
QString currentStyle; //当前输入法面板样式
|
||||||
int btnFontSize; //当前输入法面板按钮字体大小
|
int btnFontSize; //当前输入法面板按钮字体大小
|
||||||
int labFontSize; //当前输入法面板标签字体大小
|
int labFontSize; //当前输入法面板标签字体大小
|
||||||
void insertValue(QString value);//插入值到当前焦点控件
|
void insertValue ( QString value ); //插入值到当前焦点控件
|
||||||
void deleteValue(); //删除当前焦点控件的一个字符
|
void deleteValue(); //删除当前焦点控件的一个字符
|
||||||
|
|
||||||
QString currentType; //当前输入法类型
|
QString currentType; //当前输入法类型
|
||||||
void changeType(); //改变输入法类型
|
void changeType(); //改变输入法类型
|
||||||
void changeLetter(bool isUpper);//改变字母大小写
|
void changeLetter ( bool isUpper ); //改变字母大小写
|
||||||
|
|
||||||
QList<QLabel*>labCh; //汉字标签数组
|
QList<QLabel*>labCh; //汉字标签数组
|
||||||
QStringList allPY; //所有拼音链表
|
QStringList allPY; //所有拼音链表
|
||||||
@ -139,7 +140,7 @@ private:
|
|||||||
int currentPY_count; //当前拼音数量
|
int currentPY_count; //当前拼音数量
|
||||||
void selectChinese(); //查询汉字
|
void selectChinese(); //查询汉字
|
||||||
void showChinese(); //显示查询到的汉字
|
void showChinese(); //显示查询到的汉字
|
||||||
void setChinese(int index); //设置当前汉字
|
void setChinese ( int index ); //设置当前汉字
|
||||||
void clearChinese(); //清空当前汉字信息
|
void clearChinese(); //清空当前汉字信息
|
||||||
void changeRect();
|
void changeRect();
|
||||||
void changePosition();
|
void changePosition();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>frmInput</class>
|
<class>QQtInput</class>
|
||||||
<widget class="QWidget" name="frmInput">
|
<widget class="QWidget" name="QQtInput">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#include "ui_qqtmsgbox.h"
|
#include "ui_qqtmsgbox.h"
|
||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
|
|
||||||
QQTMsgBox::QQTMsgBox(QWidget* parent) :
|
QQtMsgBox::QQtMsgBox(QWidget* parent) :
|
||||||
QQtDialog(parent),
|
QQtDialog(parent),
|
||||||
ui(new Ui::QQTMsgBox)
|
ui(new Ui::QQtMsgBox)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@ -83,41 +83,41 @@ QQTMsgBox::QQTMsgBox(QWidget* parent) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTMsgBox::~QQTMsgBox()
|
QQtMsgBox::~QQtMsgBox()
|
||||||
{
|
{
|
||||||
delete ui;
|
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);
|
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);
|
return msgBox->_question(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQTMsgBox::_warning(QString content)
|
int QQtMsgBox::_warning(QString content)
|
||||||
{
|
{
|
||||||
ui->lbContent->setText(content);
|
ui->lbContent->setText(content);
|
||||||
showYes();;
|
showYes();;
|
||||||
return exec();
|
return exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQTMsgBox::_question(QString content)
|
int QQtMsgBox::_question(QString content)
|
||||||
{
|
{
|
||||||
ui->lbContent->setText(content);
|
ui->lbContent->setText(content);
|
||||||
showYesAndNo();
|
showYesAndNo();
|
||||||
return exec();
|
return exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::showYes()
|
void QQtMsgBox::showYes()
|
||||||
{
|
{
|
||||||
ui->btnYes->setHidden(false);
|
ui->btnYes->setHidden(false);
|
||||||
ui->btnNo->setHidden(true);
|
ui->btnNo->setHidden(true);
|
||||||
@ -126,7 +126,7 @@ void QQTMsgBox::showYes()
|
|||||||
ui->btnYes->setGeometry(x0, y0, btnW, btnH);
|
ui->btnYes->setGeometry(x0, y0, btnW, btnH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::showYesAndNo()
|
void QQtMsgBox::showYesAndNo()
|
||||||
{
|
{
|
||||||
ui->btnYes->setHidden(false);
|
ui->btnYes->setHidden(false);
|
||||||
ui->btnNo->setHidden(false);
|
ui->btnNo->setHidden(false);
|
||||||
@ -136,7 +136,7 @@ void QQTMsgBox::showYesAndNo()
|
|||||||
ui->btnNo->setGeometry(x0 + btnW + x0, y0, btnW, btnH);
|
ui->btnNo->setGeometry(x0 + btnW + x0, y0, btnW, btnH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::showNull()
|
void QQtMsgBox::showNull()
|
||||||
{
|
{
|
||||||
ui->btnYes->setHidden(true);
|
ui->btnYes->setHidden(true);
|
||||||
ui->btnNo->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);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
ui->lbContent->setText(content);
|
ui->lbContent->setText(content);
|
||||||
@ -158,7 +158,7 @@ void QQTMsgBox::warning(QString content)
|
|||||||
QQTSleep(delayShow);
|
QQTSleep(delayShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::question(QString content)
|
void QQtMsgBox::question(QString content)
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
ui->lbContent->setText(content);
|
ui->lbContent->setText(content);
|
||||||
@ -169,7 +169,7 @@ void QQTMsgBox::question(QString content)
|
|||||||
QQTSleep(delayShow);
|
QQTSleep(delayShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::information(QString content)
|
void QQtMsgBox::information(QString content)
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
ui->lbContent->setText(content);
|
ui->lbContent->setText(content);
|
||||||
@ -180,7 +180,7 @@ void QQTMsgBox::information(QString content)
|
|||||||
QQTSleep(delayShow);
|
QQTSleep(delayShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTMsgBox::timerEvent(QTimerEvent* e)
|
void QQtMsgBox::timerEvent(QTimerEvent* e)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -5,40 +5,40 @@
|
|||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
namespace Ui {
|
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
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QQTMsgBox(QWidget* parent = 0);
|
explicit QQtMsgBox ( QWidget* parent = 0 );
|
||||||
~QQTMsgBox();
|
~QQtMsgBox();
|
||||||
|
|
||||||
void warning(QString content);
|
void warning ( QString content );
|
||||||
void question(QString content);
|
void question ( QString content );
|
||||||
void information(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:
|
protected:
|
||||||
int _warning(QString content);
|
int _warning ( QString content );
|
||||||
int _question(QString content);
|
int _question ( QString content );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::QQTMsgBox* ui;
|
Ui::QQtMsgBox* ui;
|
||||||
quint32 m_time;
|
quint32 m_time;
|
||||||
int delayShow;
|
int delayShow;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ private:
|
|||||||
|
|
||||||
// QObject interface
|
// QObject interface
|
||||||
protected:
|
protected:
|
||||||
void timerEvent(QTimerEvent*);
|
void timerEvent ( QTimerEvent* );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTMSGBOX_H
|
#endif // QQTMSGBOX_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QQTMsgBox</class>
|
<class>QQtMsgBox</class>
|
||||||
<widget class="QQtDialog" name="QQTMsgBox">
|
<widget class="QQtDialog" name="QQtMsgBox">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "qqtpassworddialog.h"
|
#include "qqtpassworddialog.h"
|
||||||
#include "ui_qqtpassworddialog.h"
|
#include "ui_qqtpassworddialog.h"
|
||||||
|
|
||||||
QQTPasswordDialog::QQTPasswordDialog(QWidget* parent) :
|
QQtPasswordDialog::QQtPasswordDialog(QWidget* parent) :
|
||||||
QQtDialog(parent),
|
QQtDialog(parent),
|
||||||
ui(new Ui::QQTPasswordDialog)
|
ui(new Ui::QQtPasswordDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
@ -18,28 +18,28 @@ QQTPasswordDialog::QQTPasswordDialog(QWidget* parent) :
|
|||||||
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTPasswordDialog::~QQTPasswordDialog()
|
QQtPasswordDialog::~QQtPasswordDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPasswordDialog::setWifiName(QString name)
|
void QQtPasswordDialog::setWifiName(QString name)
|
||||||
{
|
{
|
||||||
ui->label_ssid_name->setText(name);
|
ui->label_ssid_name->setText(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QQTPasswordDialog::wifiPwd()
|
QString QQtPasswordDialog::wifiPwd()
|
||||||
{
|
{
|
||||||
return ui->lineEdit_ssid_password->text();
|
return ui->lineEdit_ssid_password->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPasswordDialog::connectClicked()
|
void QQtPasswordDialog::connectClicked()
|
||||||
{
|
{
|
||||||
emit connectClicked(ui->lineEdit_ssid_password->text());
|
emit connectClicked(ui->lineEdit_ssid_password->text());
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPasswordDialog::btnEnabled(QString pas)
|
void QQtPasswordDialog::btnEnabled(QString pas)
|
||||||
{
|
{
|
||||||
bool enable = pas.length() < 8 ? false : true;
|
bool enable = pas.length() < 8 ? false : true;
|
||||||
ui->pushButton_ssid_connect->setEnabled(enable);
|
ui->pushButton_ssid_connect->setEnabled(enable);
|
||||||
|
@ -5,28 +5,28 @@
|
|||||||
#include "qqt-local.h"
|
#include "qqt-local.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class QQTPasswordDialog;
|
class QQtPasswordDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTPasswordDialog : public QQtDialog
|
class QQTSHARED_EXPORT QQtPasswordDialog : public QQtDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QQTPasswordDialog(QWidget* parent = 0);
|
explicit QQtPasswordDialog ( QWidget* parent = 0 );
|
||||||
~QQTPasswordDialog();
|
~QQtPasswordDialog();
|
||||||
|
|
||||||
void setWifiName(QString name);
|
void setWifiName ( QString name );
|
||||||
QString wifiPwd();
|
QString wifiPwd();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void connectClicked(QString password);
|
void connectClicked ( QString password );
|
||||||
private slots:
|
private slots:
|
||||||
void connectClicked();
|
void connectClicked();
|
||||||
void btnEnabled(QString);
|
void btnEnabled ( QString );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::QQTPasswordDialog* ui;
|
Ui::QQtPasswordDialog* ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTPASSWORDDIALOG_H
|
#endif // QQTPASSWORDDIALOG_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QQTPasswordDialog</class>
|
<class>QQtPasswordDialog</class>
|
||||||
<widget class="QQtDialog" name="QQTPasswordDialog">
|
<widget class="QQtDialog" name="QQtPasswordDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "qqtpreviewwidget.h"
|
#include "qqtpreviewwidget.h"
|
||||||
#include "ui_qqtpreviewwidget.h"
|
#include "ui_qqtpreviewwidget.h"
|
||||||
|
|
||||||
QQTPreviewWidget::QQTPreviewWidget(QWidget* parent) :
|
QQtPreviewWidget::QQtPreviewWidget(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::QQTPreviewWidget)
|
ui(new Ui::QQtPreviewWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@ -33,12 +33,12 @@ QQTPreviewWidget::QQTPreviewWidget(QWidget* parent) :
|
|||||||
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
|
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTPreviewWidget::~QQTPreviewWidget()
|
QQtPreviewWidget::~QQtPreviewWidget()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQTPreviewWidget::play()
|
int QQtPreviewWidget::play()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 这块代码放在哪里
|
* 这块代码放在哪里
|
||||||
@ -153,7 +153,7 @@ int QQTPreviewWidget::play()
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQTPreviewWidget::close()
|
int QQtPreviewWidget::close()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
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 int pixel32 = 0;
|
||||||
unsigned char* pixel = (unsigned char*)&pixel32;
|
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;
|
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 height)
|
||||||
{
|
{
|
||||||
unsigned int in, out = 0;
|
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)
|
if (fd <= 0)
|
||||||
return;
|
return;
|
||||||
@ -287,7 +287,7 @@ void QQTPreviewWidget::paintEvent(QPaintEvent*)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QQTPreviewWidget::mousePressEvent(QMouseEvent* e)
|
void QQtPreviewWidget::mousePressEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
static bool bGInit = false;
|
static bool bGInit = false;
|
||||||
|
|
||||||
|
@ -21,21 +21,21 @@ extern "C" {
|
|||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class QQTPreviewWidget;
|
class QQtPreviewWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTPreviewWidget : public QWidget
|
class QQTSHARED_EXPORT QQtPreviewWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QQTPreviewWidget(QWidget* parent = 0);
|
explicit QQtPreviewWidget ( QWidget* parent = 0 );
|
||||||
~QQTPreviewWidget();
|
~QQtPreviewWidget();
|
||||||
int play();
|
int play();
|
||||||
int close();
|
int close();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::QQTPreviewWidget* ui;
|
Ui::QQtPreviewWidget* ui;
|
||||||
|
|
||||||
struct sensor_info sinfo;
|
struct sensor_info sinfo;
|
||||||
int pre_bpp;
|
int pre_bpp;
|
||||||
@ -61,13 +61,13 @@ private:
|
|||||||
QRect geome;
|
QRect geome;
|
||||||
Qt::WindowFlags flags;
|
Qt::WindowFlags flags;
|
||||||
|
|
||||||
int convert_yuv_to_rgb_pixel(int y, int u, int v);
|
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_buffer ( unsigned char* yuv, unsigned char* rgb, unsigned int width, unsigned int height );
|
||||||
|
|
||||||
// QWidget interface
|
// QWidget interface
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent*);
|
void paintEvent ( QPaintEvent* );
|
||||||
void mousePressEvent(QMouseEvent* e);
|
void mousePressEvent ( QMouseEvent* e );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QPREVIEWUI_H
|
#endif // QPREVIEWUI_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QQTPreviewWidget</class>
|
<class>QQtPreviewWidget</class>
|
||||||
<widget class="QWidget" name="QQTPreviewWidget">
|
<widget class="QWidget" name="QQtPreviewWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
@ -33,8 +33,8 @@ QQtProgressDialog::QQtProgressDialog(QWidget* parent) :
|
|||||||
"./skin/default/bk_progress_chunk.png");
|
"./skin/default/bk_progress_chunk.png");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QQTObjectFactory::registerObject(this);
|
QQtObjectFactory::registerObject(this);
|
||||||
QQTObjectFactory::registerObject(ui->btnCancel);
|
QQtObjectFactory::registerObject(ui->btnCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
QQtProgressDialog::~QQtProgressDialog()
|
QQtProgressDialog::~QQtProgressDialog()
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "qqtethenetmanager.h"
|
#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
|
Qt::CheckState state) const
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
@ -39,24 +39,24 @@ void QQTWIFIIDTextDelegate::drawCheck(QPainter* painter, const QStyleOptionViewI
|
|||||||
#endif
|
#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
|
const QString& text) const
|
||||||
{
|
{
|
||||||
if ("COMPLETED" == text)
|
if ("COMPLETED" == text)
|
||||||
painter->drawImage(rect, QImage("./skin/default/bk_sel.png"));
|
painter->drawImage(rect, QImage("./skin/default/bk_sel.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
|
QQtWiFiWidget::QQtWiFiWidget(QWidget* parent) :
|
||||||
QQTTableView(parent),
|
QQTTableView(parent),
|
||||||
ui(new Ui::QQTWIFIWidget)
|
ui(new Ui::QQtWiFiWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
connect(this, SIGNAL(clicked(QModelIndex)),
|
connect(this, SIGNAL(clicked(QModelIndex)),
|
||||||
this, SLOT(clickWIFI()), Qt::QueuedConnection);
|
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()));
|
connect(m_pManager, SIGNAL(sigRefreshed()), this, SLOT(wifiRefreshed()));
|
||||||
|
|
||||||
m_model = new QStandardItemModel(this);
|
m_model = new QStandardItemModel(this);
|
||||||
@ -75,7 +75,7 @@ QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
|
|||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
#endif
|
#endif
|
||||||
dg = new QQTWIFIIDTextDelegate(this);
|
dg = new QQtWiFiIdTextDelegate(this);
|
||||||
setItemDelegateForColumn(ESSID_STATUS, dg);
|
setItemDelegateForColumn(ESSID_STATUS, dg);
|
||||||
|
|
||||||
for (int i = ESSID_TYPE; i < ESSID_MAX; i++)
|
for (int i = ESSID_TYPE; i < ESSID_MAX; i++)
|
||||||
@ -90,24 +90,24 @@ QQTWIFIWidget::QQTWIFIWidget(QWidget* parent) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTWIFIWidget::~QQTWIFIWidget()
|
QQtWiFiWidget::~QQtWiFiWidget()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TWifi QQTWIFIWidget::currentWifi()
|
TWifi QQtWiFiWidget::currentWifi()
|
||||||
{
|
{
|
||||||
return m_pManager->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);
|
return m_pManager->setCurrentWifi(bssid_mac, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWIFIWidget::wifiRefreshed()
|
void QQtWiFiWidget::wifiRefreshed()
|
||||||
{
|
{
|
||||||
int row = 0;
|
int row = 0;
|
||||||
m_model->removeRows(row, m_model->rowCount());
|
m_model->removeRows(row, m_model->rowCount());
|
||||||
@ -128,14 +128,14 @@ void QQTWIFIWidget::wifiRefreshed()
|
|||||||
m_model->submit();
|
m_model->submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWIFIWidget::clickWIFI()
|
void QQtWiFiWidget::clickWIFI()
|
||||||
{
|
{
|
||||||
QString name = m_model->data(m_model->index(currentIndex().row(), ESSID_NAME)).toString();
|
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 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 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();
|
QString mac = m_model->data(m_model->index(currentIndex().row(), ESSID_BSSID)).toString();
|
||||||
|
|
||||||
QQTEthenetManager::Instance()->setRefresh(false);
|
QQtEthenetManager::Instance()->setRefresh(false);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -143,7 +143,7 @@ void QQTWIFIWidget::clickWIFI()
|
|||||||
{
|
{
|
||||||
m_pass->setWifiName(name);
|
m_pass->setWifiName(name);
|
||||||
|
|
||||||
if (QQTPasswordDialog::Rejected == m_pass->exec())
|
if (QQtPasswordDialog::Rejected == m_pass->exec())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,13 +153,13 @@ void QQTWIFIWidget::clickWIFI()
|
|||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
QQTMsgBox::warning(this, tr("Password error"));
|
QQtMsgBox::warning(this, tr("Password error"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pline() << name << encryt << m_pass->wifiPwd();
|
pline() << name << encryt << m_pass->wifiPwd();
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
QQTEthenetManager::Instance()->setRefresh();
|
QQtEthenetManager::Instance()->setRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,50 +10,51 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt-local.h"
|
#include "qqt-local.h"
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTWIFIIDTextDelegate : public QItemDelegate
|
class QQTSHARED_EXPORT QQtWiFiIdTextDelegate : public QItemDelegate
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QQTWIFIIDTextDelegate(QObject* parent = 0): QItemDelegate(parent), parent(parent) { }
|
QQtWiFiIdTextDelegate ( QObject* parent = 0 ) : QItemDelegate ( parent ), parent ( parent ) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QObject* parent;
|
QObject* parent;
|
||||||
|
|
||||||
// QItemDelegate interface
|
// QItemDelegate interface
|
||||||
protected:
|
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
|
// QItemDelegate interface
|
||||||
protected:
|
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 {
|
namespace Ui {
|
||||||
class QQTWIFIWidget;
|
class QQtWiFiWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QQTWIFIWidget : public QQTTableView
|
class QQtWiFiWidget : public QQTTableView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QQTWIFIWidget(QWidget* parent = 0);
|
explicit QQtWiFiWidget ( QWidget* parent = 0 );
|
||||||
~QQTWIFIWidget();
|
~QQtWiFiWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void clickWIFI();
|
void clickWIFI();
|
||||||
void wifiRefreshed();
|
void wifiRefreshed();
|
||||||
protected:
|
protected:
|
||||||
TWifi currentWifi();
|
TWifi currentWifi();
|
||||||
bool setCurrentWifi(QString bssid_mac, QString password = "");
|
bool setCurrentWifi ( QString bssid_mac, QString password = "" );
|
||||||
private:
|
private:
|
||||||
QQTEthenetManager* m_pManager;
|
QQtEthenetManager* m_pManager;
|
||||||
QQTWIFIIDTextDelegate* dg;
|
QQtWiFiIdTextDelegate* dg;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::QQTWIFIWidget* ui;
|
Ui::QQtWiFiWidget* ui;
|
||||||
QStandardItemModel* m_model;
|
QStandardItemModel* m_model;
|
||||||
QQTPasswordDialog* m_pass;
|
QQtPasswordDialog* m_pass;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTWIFIWIDGET_H
|
#endif // QQTWIFIWIDGET_H
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<author/>
|
<author/>
|
||||||
<comment/>
|
<comment/>
|
||||||
<exportmacro/>
|
<exportmacro/>
|
||||||
<class>QQTWIFIWidget</class>
|
<class>QQtWiFiWidget</class>
|
||||||
<widget name="QQTWIFIWidget" class="QQTTableView">
|
<widget name="QQtWiFiWidget" class="QQTTableView">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
@ -5,16 +5,16 @@
|
|||||||
#include "qqtgraphicsitem.h"
|
#include "qqtgraphicsitem.h"
|
||||||
#include "qqtword.h"
|
#include "qqtword.h"
|
||||||
|
|
||||||
QQTWord::QQTWord(QObject* parent) :
|
QQtWord::QQtWord(QObject* parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
fmt(0), headerFmt(0), titleFmt(0), title2Fmt(0), mainFmt(0)
|
fmt(0), headerFmt(0), titleFmt(0), title2Fmt(0), mainFmt(0)
|
||||||
{
|
{
|
||||||
//setup printer
|
//setup printer
|
||||||
/**
|
/**
|
||||||
MIPS bug: you must use QQTPrinter(QPrinter::HighResolution)
|
MIPS bug: you must use QQtPrinter(QPrinter::HighResolution)
|
||||||
Other constructer won't work well
|
Other constructer won't work well
|
||||||
*/
|
*/
|
||||||
pr = new QQTPrinter(QPrinter::HighResolution);
|
pr = new QQtPrinter(QPrinter::HighResolution);
|
||||||
pr->setFullPage(true);
|
pr->setFullPage(true);
|
||||||
pr->setColorMode(QPrinter::Color);
|
pr->setColorMode(QPrinter::Color);
|
||||||
pr->setPaperSize(QPrinter::A4);
|
pr->setPaperSize(QPrinter::A4);
|
||||||
@ -97,7 +97,7 @@ QQTWord::QQTWord(QObject* parent) :
|
|||||||
initWord();
|
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;
|
leftMargin = 134.6;
|
||||||
rightMargin = 134.6;
|
rightMargin = 134.6;
|
||||||
@ -105,21 +105,21 @@ void QQTWord::setMargin(qreal left, qreal right, qreal top, qreal botoom)
|
|||||||
bottomMargin = 177.7;
|
bottomMargin = 177.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF QQTWord::clientRectF()
|
QRectF QQtWord::clientRectF()
|
||||||
{
|
{
|
||||||
return QRectF(leftMargin, topMargin,
|
return QRectF(leftMargin, topMargin,
|
||||||
sceneRect.width() - leftMargin - rightMargin,
|
sceneRect.width() - leftMargin - rightMargin,
|
||||||
sceneRect.height() - topMargin - bottomMargin);
|
sceneRect.height() - topMargin - bottomMargin);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF QQTWord::paperRect()
|
QRectF QQtWord::paperRect()
|
||||||
{
|
{
|
||||||
return QRectF(0, 0,
|
return QRectF(0, 0,
|
||||||
sceneRect.width(),
|
sceneRect.width(),
|
||||||
sceneRect.height());
|
sceneRect.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::setFont(QFont font)
|
void QQtWord::setFont(QFont font)
|
||||||
{
|
{
|
||||||
//normal font 11
|
//normal font 11
|
||||||
m_font = QApplication::font();
|
m_font = QApplication::font();
|
||||||
@ -130,7 +130,7 @@ void QQTWord::setFont(QFont font)
|
|||||||
fmt = new QFontMetrics(m_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;
|
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);
|
QFontMetrics fmt = QFontMetrics(font);
|
||||||
int spacing = fmt.height() * 2;
|
int spacing = fmt.height() * 2;
|
||||||
@ -157,7 +157,7 @@ void QQTWord::addText(const QString& text, QFont font, Qt::Alignment align, QPoi
|
|||||||
|
|
||||||
adjustdy(height + spacing);
|
adjustdy(height + spacing);
|
||||||
|
|
||||||
QQTGraphicsTextItem* item = pageScene->addText(text, font);
|
QQtGraphicsTextItem* item = pageScene->addText(text, font);
|
||||||
|
|
||||||
if (align & Qt::AlignLeft)
|
if (align & Qt::AlignLeft)
|
||||||
item->moveBy(dx, dy + height);
|
item->moveBy(dx, dy + height);
|
||||||
@ -169,7 +169,7 @@ void QQTWord::addText(const QString& text, QFont font, Qt::Alignment align, QPoi
|
|||||||
dy += height + spacing;
|
dy += height + spacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::addSignoffText(const QString& text, QFont font)
|
void QQtWord::addSignoffText(const QString& text, QFont font)
|
||||||
{
|
{
|
||||||
adjustdy(mainHeight + mainSpacing);
|
adjustdy(mainHeight + mainSpacing);
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ void QQTWord::addSignoffText(const QString& text, QFont font)
|
|||||||
dy = ddy;
|
dy = ddy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::addTable(const QTableView* table, QPointF pos)
|
void QQtWord::addTable(const QTableView* table, QPointF pos)
|
||||||
{
|
{
|
||||||
Q_ASSERT(table);
|
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();
|
QString txt = model->headerData(logicalIndex, Qt::Horizontal, Qt::DisplayRole).toString();
|
||||||
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
|
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
|
||||||
QQTGraphicsTextItem* item = pageScene->addText(txt, tableFont);
|
QQtGraphicsTextItem* item = pageScene->addText(txt, tableFont);
|
||||||
item->moveBy(dx, dy);
|
item->moveBy(dx, dy);
|
||||||
dx += actColSize;
|
dx += actColSize;
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ void QQTWord::addTable(const QTableView* table, QPointF pos)
|
|||||||
{
|
{
|
||||||
QString txt = model->data(model->index(row, logicalIndex)).toString();
|
QString txt = model->data(model->index(row, logicalIndex)).toString();
|
||||||
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
|
txt = tableFmt.elidedText(txt, Qt::ElideRight, actColSize - 2);
|
||||||
QQTGraphicsTextItem* item = pageScene->addText(txt, tableFont);
|
QQtGraphicsTextItem* item = pageScene->addText(txt, tableFont);
|
||||||
item->moveBy(dx, dy);
|
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
|
// setup printer
|
||||||
pr->setOutputFileName(pdf);
|
pr->setOutputFileName(pdf);
|
||||||
@ -329,7 +329,7 @@ void QQTWord::exportPdf(const QString& pdf)
|
|||||||
// print pdf
|
// print pdf
|
||||||
QPainter p(pr);
|
QPainter p(pr);
|
||||||
|
|
||||||
QQTGraphicsScene* pageScene = 0;
|
QQtGraphicsScene* pageScene = 0;
|
||||||
|
|
||||||
foreach (pageScene, pageSceneVector)
|
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())
|
if (num < 1 || num > pageSceneVector.size())
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -349,12 +349,12 @@ QQTGraphicsScene* QQTWord::getPage(int num)
|
|||||||
return pageSceneVector.at(num - 1);
|
return pageSceneVector.at(num - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::print()
|
void QQtWord::print()
|
||||||
{
|
{
|
||||||
pr->print();
|
pr->print();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::setHeaderFont(QFont font)
|
void QQtWord::setHeaderFont(QFont font)
|
||||||
{
|
{
|
||||||
//header font
|
//header font
|
||||||
m_headerFont = QApplication::font();;
|
m_headerFont = QApplication::font();;
|
||||||
@ -366,35 +366,35 @@ void QQTWord::setHeaderFont(QFont font)
|
|||||||
headerFmt = new QFontMetrics(m_headerFont);
|
headerFmt = new QFontMetrics(m_headerFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::setHeaderSize(qreal size)
|
void QQtWord::setHeaderSize(qreal size)
|
||||||
{
|
{
|
||||||
headerSize = 70;
|
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;
|
headerText = text;
|
||||||
paintPageHeader();
|
paintPageHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::setFooterSize(qreal size)
|
void QQtWord::setFooterSize(qreal size)
|
||||||
{
|
{
|
||||||
footerSize = 70;
|
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)
|
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(font)
|
||||||
Q_UNUSED(align)
|
Q_UNUSED(align)
|
||||||
@ -402,11 +402,11 @@ void QQTWord::setFooterText(const QString& text, QFont font, Qt::Alignment align
|
|||||||
paintPageFooter();
|
paintPageFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::initWord()
|
void QQtWord::initWord()
|
||||||
{
|
{
|
||||||
while (! pageSceneVector.isEmpty())
|
while (! pageSceneVector.isEmpty())
|
||||||
{
|
{
|
||||||
QQTGraphicsScene* pageScene = pageSceneVector.first();
|
QQtGraphicsScene* pageScene = pageSceneVector.first();
|
||||||
pageScene->clear();
|
pageScene->clear();
|
||||||
delete pageScene;
|
delete pageScene;
|
||||||
pageSceneVector.remove(0);
|
pageSceneVector.remove(0);
|
||||||
@ -417,7 +417,7 @@ void QQTWord::initWord()
|
|||||||
createFrame();
|
createFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::adjustdy(qreal dy0)
|
void QQtWord::adjustdy(qreal dy0)
|
||||||
{
|
{
|
||||||
dx = xpos;
|
dx = xpos;
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ void QQTWord::adjustdy(qreal dy0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QQTWord::createFrame()
|
void QQtWord::createFrame()
|
||||||
{
|
{
|
||||||
xpos = leftMargin;
|
xpos = leftMargin;
|
||||||
xpos2 = sceneRect.width() - rightMargin;
|
xpos2 = sceneRect.width() - rightMargin;
|
||||||
@ -437,13 +437,13 @@ void QQTWord::createFrame()
|
|||||||
dx = xpos;
|
dx = xpos;
|
||||||
dy = ypos;
|
dy = ypos;
|
||||||
|
|
||||||
pageScene = new QQTGraphicsScene(sceneRect);
|
pageScene = new QQtGraphicsScene(sceneRect);
|
||||||
pageSceneVector.append(pageScene);
|
pageSceneVector.append(pageScene);
|
||||||
paintPageHeader();
|
paintPageHeader();
|
||||||
paintPageFooter();
|
paintPageFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::paintPageHeader()
|
void QQtWord::paintPageHeader()
|
||||||
{
|
{
|
||||||
// Page header
|
// Page header
|
||||||
if (headerText.isEmpty())
|
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);
|
headerItem->moveBy(sx, sy);
|
||||||
|
|
||||||
//std text
|
//std text
|
||||||
@ -462,7 +462,7 @@ void QQTWord::paintPageHeader()
|
|||||||
QString time = QTime::currentTime().toString(QLocale().timeFormat(QLocale::ShortFormat));
|
QString time = QTime::currentTime().toString(QLocale().timeFormat(QLocale::ShortFormat));
|
||||||
QString headerStdText;
|
QString headerStdText;
|
||||||
headerStdText = date + " " + time;
|
headerStdText = date + " " + time;
|
||||||
QQTGraphicsTextItem* item = pageScene->addText(headerStdText, m_headerFont);
|
QQtGraphicsTextItem* item = pageScene->addText(headerStdText, m_headerFont);
|
||||||
item->moveBy(xpos2 - headerFmt->width(headerStdText), sy);
|
item->moveBy(xpos2 - headerFmt->width(headerStdText), sy);
|
||||||
|
|
||||||
sy += headerItem->boundingRect().height();
|
sy += headerItem->boundingRect().height();
|
||||||
@ -471,7 +471,7 @@ void QQTWord::paintPageHeader()
|
|||||||
pageScene->addLine(xpos, sy, xpos2, sy, QPen(Qt::black, 1.0));
|
pageScene->addLine(xpos, sy, xpos2, sy, QPen(Qt::black, 1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTWord::paintPageFooter()
|
void QQtWord::paintPageFooter()
|
||||||
{
|
{
|
||||||
if (footerText.isEmpty())
|
if (footerText.isEmpty())
|
||||||
return;
|
return;
|
||||||
@ -482,18 +482,18 @@ void QQTWord::paintPageFooter()
|
|||||||
int sx = xpos;
|
int sx = xpos;
|
||||||
|
|
||||||
QString footerStdText = tr("Page") + QString::number(pageSceneVector.size()) + tr(" ");
|
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 height = item->boundingRect().height();
|
||||||
int sy = ypos2 + footerSize - height;
|
int sy = ypos2 + footerSize - height;
|
||||||
item->moveBy(xpos2 - headerFmt->width(footerStdText), sy);
|
item->moveBy(xpos2 - headerFmt->width(footerStdText), sy);
|
||||||
|
|
||||||
pageScene->addLine(xpos, sy, xpos2, sy, QPen(Qt::black, 1.0));
|
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);
|
footerItem->moveBy(xpos, sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<int, ESpanFlags> QQTWord::tableSpans(const QTableView* table)
|
QHash<int, ESpanFlags> QQtWord::tableSpans(const QTableView* table)
|
||||||
{
|
{
|
||||||
Q_ASSERT(table);
|
Q_ASSERT(table);
|
||||||
|
|
||||||
|
@ -17,52 +17,52 @@ enum ESpanFlag
|
|||||||
ESpanMiddle = 16,
|
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTWord(QObject* parent = 0);
|
explicit QQtWord ( QObject* parent = 0 );
|
||||||
|
|
||||||
void addText(const QString& text, QFont m_font = QFont(),
|
void addText ( const QString& text, QFont m_font = QFont(),
|
||||||
Qt::Alignment align = Qt::AlignHCenter, QPointF point = QPointF(0, 0));
|
Qt::Alignment align = Qt::AlignHCenter, QPointF point = QPointF ( 0, 0 ) );
|
||||||
void addSignoffText(const QString& text, QFont m_font = QFont());
|
void addSignoffText ( const QString& text, QFont m_font = QFont() );
|
||||||
void addTable(const QTableView* table, QPointF pos = QPointF(0, 0));
|
void addTable ( const QTableView* table, QPointF pos = QPointF ( 0, 0 ) );
|
||||||
|
|
||||||
int pageNum();
|
int pageNum();
|
||||||
QQTGraphicsScene* getPage(int num);
|
QQtGraphicsScene* getPage ( int num );
|
||||||
void exportPdf(const QString& pdf);
|
void exportPdf ( const QString& pdf );
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
QRectF clientRectF();
|
QRectF clientRectF();
|
||||||
QRectF paperRect();
|
QRectF paperRect();
|
||||||
void setMargin(qreal left = 0, qreal right = 0,
|
void setMargin ( qreal left = 0, qreal right = 0,
|
||||||
qreal top = 0, qreal botoom = 0);
|
qreal top = 0, qreal botoom = 0 );
|
||||||
void setLineSpacing(qreal mainSpacing = 0);
|
void setLineSpacing ( qreal mainSpacing = 0 );
|
||||||
void setHeaderSize(qreal size = 0);
|
void setHeaderSize ( qreal size = 0 );
|
||||||
void setFooterSize(qreal size = 0);
|
void setFooterSize ( qreal size = 0 );
|
||||||
|
|
||||||
QFont font();
|
QFont font();
|
||||||
void setFont(QFont m_font = QFont());
|
void setFont ( QFont m_font = QFont() );
|
||||||
void setHeaderFont(QFont m_font = QFont());
|
void setHeaderFont ( QFont m_font = QFont() );
|
||||||
QFont mainFont() { return m_mainFont; }
|
QFont mainFont() { return m_mainFont; }
|
||||||
QFont titleFont() { return m_titleFont; }
|
QFont titleFont() { return m_titleFont; }
|
||||||
QFont title2Font() { return m_title2Font; }
|
QFont title2Font() { return m_title2Font; }
|
||||||
QFont headerFont() { return m_headerFont; }
|
QFont headerFont() { return m_headerFont; }
|
||||||
void setHeaderLine(bool show = false);
|
void setHeaderLine ( bool show = false );
|
||||||
void setFooterLine(bool show = false);
|
void setFooterLine ( bool show = false );
|
||||||
void setHeaderText(const QString& text, QFont m_font = QFont(),
|
void setHeaderText ( const QString& text, QFont m_font = QFont(),
|
||||||
Qt::Alignment align = Qt::AlignHCenter);
|
Qt::Alignment align = Qt::AlignHCenter );
|
||||||
void setFooterText(const QString& text, QFont m_font = QFont(),
|
void setFooterText ( const QString& text, QFont m_font = QFont(),
|
||||||
Qt::Alignment align = Qt::AlignHCenter);
|
Qt::Alignment align = Qt::AlignHCenter );
|
||||||
/**
|
/**
|
||||||
* @brief initWordExpress 初始化纸张,第一张空白纸
|
* @brief initWordExpress 初始化纸张,第一张空白纸
|
||||||
*/
|
*/
|
||||||
void initWord();
|
void initWord();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void adjustdy(qreal dy0);
|
virtual void adjustdy ( qreal dy0 );
|
||||||
virtual void createFrame();
|
virtual void createFrame();
|
||||||
virtual void paintPageHeader();
|
virtual void paintPageHeader();
|
||||||
virtual void paintPageFooter();
|
virtual void paintPageFooter();
|
||||||
@ -75,13 +75,13 @@ private:
|
|||||||
/*
|
/*
|
||||||
* 输出
|
* 输出
|
||||||
*/
|
*/
|
||||||
QQTPrinter* pr;
|
QQtPrinter* pr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 对页面元素高度不能迅速统计的场景
|
* 对页面元素高度不能迅速统计的场景
|
||||||
*/
|
*/
|
||||||
QVector<QQTGraphicsScene*> pageSceneVector;
|
QVector<QQtGraphicsScene*> pageSceneVector;
|
||||||
QQTGraphicsScene* pageScene;
|
QQtGraphicsScene* pageScene;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 页面元素
|
* 页面元素
|
||||||
@ -147,7 +147,7 @@ private:
|
|||||||
QFontMetrics* fmt;
|
QFontMetrics* fmt;
|
||||||
|
|
||||||
|
|
||||||
QHash<int, ESpanFlags> tableSpans(const QTableView* table);
|
QHash<int, ESpanFlags> tableSpans ( const QTableView* table );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTWORD_H
|
#endif // QQTWORD_H
|
||||||
|
@ -52,7 +52,7 @@ bool QQtJsonTreeModel::query ( QString condition )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTXmlTreeModel::parseChildElement
|
* @brief QQtXmlTreeModel::parseChildElement
|
||||||
* @param element
|
* @param element
|
||||||
* @param parent
|
* @param parent
|
||||||
* 这套递归代码,第一次和最后一次不同。
|
* 这套递归代码,第一次和最后一次不同。
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
|
||||||
QQTXmlTreeModel::QQTXmlTreeModel ( QObject* parent ) : QQtTreeModel ( parent )
|
QQtXmlTreeModel::QQtXmlTreeModel ( QObject* parent ) : QQtTreeModel ( parent )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTXmlTreeModel::setFilePath ( QString fileName )
|
void QQtXmlTreeModel::setFilePath ( QString fileName )
|
||||||
{
|
{
|
||||||
QFile file ( fileName );
|
QFile file ( fileName );
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ void QQTXmlTreeModel::setFilePath ( QString fileName )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQTXmlTreeModel::query ( QString condition )
|
bool QQtXmlTreeModel::query ( QString condition )
|
||||||
{
|
{
|
||||||
Q_UNUSED ( condition )
|
Q_UNUSED ( condition )
|
||||||
//TODO:
|
//TODO:
|
||||||
@ -52,12 +52,12 @@ bool QQTXmlTreeModel::query ( QString condition )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTXmlTreeModel::parseChildElement
|
* @brief QQtXmlTreeModel::parseChildElement
|
||||||
* @param element
|
* @param element
|
||||||
* @param parent
|
* @param parent
|
||||||
* 这套递归代码,第一次和最后一次不同。
|
* 这套递归代码,第一次和最后一次不同。
|
||||||
*/
|
*/
|
||||||
void QQTXmlTreeModel::parseChildElement ( const QDomElement& element, QStandardItem* itemParent )
|
void QQtXmlTreeModel::parseChildElement ( const QDomElement& element, QStandardItem* itemParent )
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @brief element name
|
* @brief element name
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTXmlTreeModel : public QQtTreeModel
|
class QQTSHARED_EXPORT QQtXmlTreeModel : public QQtTreeModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTXmlTreeModel ( QObject* parent = 0 );
|
explicit QQtXmlTreeModel ( QObject* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "qqtmplayer.h"
|
#include "qqtmplayer.h"
|
||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
|
|
||||||
QQTPlayer::QQTPlayer(QObject* parent) :
|
QQtPlayer::QQtPlayer(QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
app = new QProcess(this);
|
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";
|
QString mppath = "mplayer";
|
||||||
QStringList mpargs;
|
QStringList mpargs;
|
||||||
@ -32,14 +32,14 @@ void QQTPlayer::play(QString filename, int wid, int width, int height)
|
|||||||
pline() << "mpp start success :)";
|
pline() << "mpp start success :)";
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPlayer::pause()
|
void QQtPlayer::pause()
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "pause\n");
|
sprintf(buf, "pause\n");
|
||||||
app->write(buf);
|
app->write(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPlayer::stop()
|
void QQtPlayer::stop()
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "stop\n");
|
sprintf(buf, "stop\n");
|
||||||
@ -48,7 +48,7 @@ void QQTPlayer::stop()
|
|||||||
app->write(buf);
|
app->write(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
double QQTPlayer::timeLength()
|
double QQtPlayer::timeLength()
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "get_time_length\n");
|
sprintf(buf, "get_time_length\n");
|
||||||
@ -60,7 +60,7 @@ double QQTPlayer::timeLength()
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
double QQTPlayer::timePos()
|
double QQtPlayer::timePos()
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "get_time_pos\n");
|
sprintf(buf, "get_time_pos\n");
|
||||||
@ -72,7 +72,7 @@ double QQTPlayer::timePos()
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQTPlayer::percent()
|
int QQtPlayer::percent()
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "get_percent\n");
|
sprintf(buf, "get_percent\n");
|
||||||
@ -84,28 +84,28 @@ int QQTPlayer::percent()
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPlayer::seekPos(double second)
|
void QQtPlayer::seekPos(double second)
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "seek %lf\n", second);
|
sprintf(buf, "seek %lf\n", second);
|
||||||
app->write(buf);
|
app->write(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPlayer::setVolume(int v)
|
void QQtPlayer::setVolume(int v)
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "volume %d 1\n", v);
|
sprintf(buf, "volume %d 1\n", v);
|
||||||
app->write(buf);
|
app->write(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPlayer::mute(bool m)
|
void QQtPlayer::mute(bool m)
|
||||||
{
|
{
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "mute %d\n", m);
|
sprintf(buf, "mute %d\n", m);
|
||||||
app->write(buf);
|
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};
|
char buf[256] = {0};
|
||||||
sprintf(buf, "change_rectangle 0 %d \n", width);
|
sprintf(buf, "change_rectangle 0 %d \n", width);
|
||||||
|
@ -4,22 +4,22 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTPlayer : public QObject
|
class QQTSHARED_EXPORT QQtPlayer : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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 pause();
|
||||||
void stop();
|
void stop();
|
||||||
double timeLength();
|
double timeLength();
|
||||||
double timePos();
|
double timePos();
|
||||||
int percent();
|
int percent();
|
||||||
void seekPos(double second = 0);
|
void seekPos ( double second = 0 );
|
||||||
void setVolume(int v = 100);
|
void setVolume ( int v = 100 );
|
||||||
void mute(bool m = false);
|
void mute ( bool m = false );
|
||||||
void setRect(int x, int y, int width, int height);
|
void setRect ( int x, int y, int width, int height );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt.h"
|
#include "qqt.h"
|
||||||
|
|
||||||
QQTClient::QQTClient ( QObject* parent ) :
|
QQtClient::QQtClient ( QObject* parent ) :
|
||||||
QTcpSocket ( parent )
|
QTcpSocket ( parent )
|
||||||
{
|
{
|
||||||
connect ( this, SIGNAL ( stateChanged ( QAbstractSocket::SocketState ) ), this,
|
connect ( this, SIGNAL ( stateChanged ( QAbstractSocket::SocketState ) ), this,
|
||||||
@ -44,11 +44,11 @@ QQTClient::QQTClient ( QObject* parent ) :
|
|||||||
m_protocol = NULL;
|
m_protocol = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTClient::~QQTClient()
|
QQtClient::~QQtClient()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::installProtocol ( QQtProtocol* stack )
|
void QQtClient::installProtocol ( QQtProtocol* stack )
|
||||||
{
|
{
|
||||||
if ( m_protocol )
|
if ( m_protocol )
|
||||||
return;
|
return;
|
||||||
@ -58,7 +58,7 @@ void QQTClient::installProtocol ( QQtProtocol* stack )
|
|||||||
this, SLOT ( write ( const QByteArray& ) ) );
|
this, SLOT ( write ( const QByteArray& ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::uninstallProtocol ( QQtProtocol* stack )
|
void QQtClient::uninstallProtocol ( QQtProtocol* stack )
|
||||||
{
|
{
|
||||||
Q_UNUSED ( stack )
|
Q_UNUSED ( stack )
|
||||||
|
|
||||||
@ -70,12 +70,12 @@ void QQTClient::uninstallProtocol ( QQtProtocol* stack )
|
|||||||
m_protocol = NULL;
|
m_protocol = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQtProtocol* QQTClient::installedProtocol()
|
QQtProtocol* QQtClient::installedProtocol()
|
||||||
{
|
{
|
||||||
return m_protocol;
|
return m_protocol;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::SendConnectMessage()
|
void QQtClient::SendConnectMessage()
|
||||||
{
|
{
|
||||||
pline() << isValid() << isOpen() << state();
|
pline() << isValid() << isOpen() << state();
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void QQTClient::SendConnectMessage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int QQTClient::SendDisConnectFromHost()
|
int QQtClient::SendDisConnectFromHost()
|
||||||
{
|
{
|
||||||
pline() << isValid() << isOpen() << state();
|
pline() << isValid() << isOpen() << state();
|
||||||
|
|
||||||
@ -119,17 +119,17 @@ int QQTClient::SendDisConnectFromHost()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::domainHostFound()
|
void QQtClient::domainHostFound()
|
||||||
{
|
{
|
||||||
pline();
|
pline();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTClient::socketStateChanged
|
* @brief QQtClient::socketStateChanged
|
||||||
* @param eSocketState
|
* @param eSocketState
|
||||||
* 状态函数
|
* 状态函数
|
||||||
*/
|
*/
|
||||||
void QQTClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
|
void QQtClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
|
||||||
{
|
{
|
||||||
pline() << eSocketState;
|
pline() << eSocketState;
|
||||||
|
|
||||||
@ -155,11 +155,11 @@ void QQTClient::socketStateChanged ( QAbstractSocket::SocketState eSocketState )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTClient::socketErrorOccured
|
* @brief QQtClient::socketErrorOccured
|
||||||
* @param e
|
* @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();
|
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();
|
pline();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::updateProgress ( qint64 bytes )
|
void QQtClient::updateProgress ( qint64 bytes )
|
||||||
{
|
{
|
||||||
Q_UNUSED ( bytes )
|
Q_UNUSED ( bytes )
|
||||||
//pline() << bytes;
|
//pline() << bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTClient::connectToSingelHost()
|
void QQtClient::connectToSingelHost()
|
||||||
{
|
{
|
||||||
int contype = eConType % m_serverIP.size();
|
int contype = eConType % m_serverIP.size();
|
||||||
QString ip = m_serverIP.at ( contype );
|
QString ip = m_serverIP.at ( contype );
|
||||||
@ -216,7 +216,7 @@ void QQTClient::connectToSingelHost()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QQTClient::readyReadData()
|
void QQtClient::readyReadData()
|
||||||
{
|
{
|
||||||
QByteArray bytes;
|
QByteArray bytes;
|
||||||
bytes = readAll();
|
bytes = readAll();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**************************************************
|
/**************************************************
|
||||||
* QQTClient
|
* QQtClient
|
||||||
* 在一个工程当中仅仅存在一个实例,通过调用QQTClient实现。
|
* 在一个工程当中仅仅存在一个实例,通过调用QQtClient实现。
|
||||||
**************************************************/
|
**************************************************/
|
||||||
#ifndef QQT_CLIENT_H
|
#ifndef QQT_CLIENT_H
|
||||||
#define QQT_CLIENT_H
|
#define QQT_CLIENT_H
|
||||||
@ -20,18 +20,18 @@
|
|||||||
/**
|
/**
|
||||||
* @brief 客户端决定和协议的交互关系;只跟协议打交道;
|
* @brief 客户端决定和协议的交互关系;只跟协议打交道;
|
||||||
*/
|
*/
|
||||||
class QQTSHARED_EXPORT QQTClient : public QTcpSocket
|
class QQTSHARED_EXPORT QQtClient : public QTcpSocket
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTClient(QObject* parent = 0);
|
explicit QQtClient ( QObject* parent = 0 );
|
||||||
virtual ~QQTClient();
|
virtual ~QQtClient();
|
||||||
|
|
||||||
void SetServerIPAddress(QStringList ip) { m_serverIP = ip; }
|
void SetServerIPAddress ( QStringList ip ) { m_serverIP = ip; }
|
||||||
void SetServerPort(quint32 p = 7079) { m_PORT = p; }
|
void SetServerPort ( quint32 p = 7079 ) { m_PORT = p; }
|
||||||
|
|
||||||
void installProtocol(QQtProtocol* stack);
|
void installProtocol ( QQtProtocol* stack );
|
||||||
void uninstallProtocol(QQtProtocol* stack);
|
void uninstallProtocol ( QQtProtocol* stack );
|
||||||
QQtProtocol* installedProtocol();
|
QQtProtocol* installedProtocol();
|
||||||
|
|
||||||
void SendConnectMessage();
|
void SendConnectMessage();
|
||||||
@ -43,16 +43,16 @@ signals:
|
|||||||
void signalConnectFail();//
|
void signalConnectFail();//
|
||||||
void signalDisConnectSucc();//maybe
|
void signalDisConnectSucc();//maybe
|
||||||
void signalDisConnectFail();//
|
void signalDisConnectFail();//
|
||||||
void signalUpdateProgress(qint64 value);
|
void signalUpdateProgress ( qint64 value );
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void domainHostFound();
|
void domainHostFound();
|
||||||
void socketStateChanged(QAbstractSocket::SocketState);
|
void socketStateChanged ( QAbstractSocket::SocketState );
|
||||||
void socketErrorOccured(QAbstractSocket::SocketError);
|
void socketErrorOccured ( QAbstractSocket::SocketError );
|
||||||
void socketConnected();
|
void socketConnected();
|
||||||
void socketDisconnect();
|
void socketDisconnect();
|
||||||
void updateProgress(qint64);
|
void updateProgress ( qint64 );
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void readyReadData();
|
void readyReadData();
|
||||||
|
@ -3,18 +3,18 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt-qt.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)
|
if (_instance)
|
||||||
return _instance;
|
return _instance;
|
||||||
|
|
||||||
_instance = new QQTEthenetManager(parent);
|
_instance = new QQtEthenetManager(parent);
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQTEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
|
bool QQtEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
|
||||||
{
|
{
|
||||||
for (QList<TWifi>::Iterator it = m_wifiList.begin();
|
for (QList<TWifi>::Iterator it = m_wifiList.begin();
|
||||||
it != m_wifiList.end(); it++)
|
it != m_wifiList.end(); it++)
|
||||||
@ -38,13 +38,13 @@ bool QQTEthenetManager::setCurrentWifi(QString bssid_mac, QString password)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::ipconfig()
|
void QQtEthenetManager::ipconfig()
|
||||||
{
|
{
|
||||||
saveScript();
|
saveScript();
|
||||||
config();
|
config();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QQTEthenetManager::currentNetName()
|
QString QQtEthenetManager::currentNetName()
|
||||||
{
|
{
|
||||||
if ("eth0" == m_netName)
|
if ("eth0" == m_netName)
|
||||||
return "Wired Lan";
|
return "Wired Lan";
|
||||||
@ -56,7 +56,7 @@ QString QQTEthenetManager::currentNetName()
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::readStatus()
|
void QQtEthenetManager::readStatus()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 从 status 中读取
|
* 从 status 中读取
|
||||||
@ -99,7 +99,7 @@ void QQTEthenetManager::readStatus()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::refreshWifiList()
|
void QQtEthenetManager::refreshWifiList()
|
||||||
{
|
{
|
||||||
static int scanid = 0;
|
static int scanid = 0;
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ void QQTEthenetManager::refreshWifiList()
|
|||||||
emit sigRefreshed();
|
emit sigRefreshed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::refreshWifiStatus()
|
void QQtEthenetManager::refreshWifiStatus()
|
||||||
{
|
{
|
||||||
readStatus();
|
readStatus();
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ void QQTEthenetManager::refreshWifiStatus()
|
|||||||
emit sigDisConnected();
|
emit sigDisConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::checkLanConnection()
|
void QQtEthenetManager::checkLanConnection()
|
||||||
{
|
{
|
||||||
char cmdbuf[MAX_PATH];
|
char cmdbuf[MAX_PATH];
|
||||||
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
|
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
|
||||||
@ -219,7 +219,7 @@ void QQTEthenetManager::checkLanConnection()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::DhcpPassed(QString netname)
|
void QQtEthenetManager::DhcpPassed(QString netname)
|
||||||
{
|
{
|
||||||
int sockfd;
|
int sockfd;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
@ -291,20 +291,20 @@ void QQTEthenetManager::DhcpPassed(QString netname)
|
|||||||
saveScript();
|
saveScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::checkNetworkClear()
|
void QQtEthenetManager::checkNetworkClear()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
m_clearThread->start();
|
m_clearThread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTEthenetManager::QQTEthenetManager(QObject* parent) :
|
QQtEthenetManager::QQtEthenetManager(QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
m_bUseDHCP = false;
|
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(cleared()), this, SIGNAL(sigNetworkClear()));
|
||||||
connect(m_clearThread, SIGNAL(notcleared()), this, SIGNAL(sigNetworkNotClear()));
|
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)));
|
connect(m_thread, SIGNAL(passed(QString)), this, SLOT(DhcpPassed(QString)));
|
||||||
/*
|
/*
|
||||||
* 检查网线
|
* 检查网线
|
||||||
@ -326,7 +326,7 @@ QQTEthenetManager::QQTEthenetManager(QObject* parent) :
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::restoreWifi()
|
void QQtEthenetManager::restoreWifi()
|
||||||
{
|
{
|
||||||
QString name = m_curWifi[ESSID_NAME];
|
QString name = m_curWifi[ESSID_NAME];
|
||||||
QString password = m_curWifi[ESSID_PASS];
|
QString password = m_curWifi[ESSID_PASS];
|
||||||
@ -380,7 +380,7 @@ void QQTEthenetManager::restoreWifi()
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQTEthenetManager::restartWifi()
|
bool QQtEthenetManager::restartWifi()
|
||||||
{
|
{
|
||||||
char cmdbuf[MAX_PATH];
|
char cmdbuf[MAX_PATH];
|
||||||
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
|
char cmdresult[MAX_PATH]; //设置一个合适的长度,以存储每一行输出
|
||||||
@ -397,7 +397,7 @@ bool QQTEthenetManager::restartWifi()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::saveScript()
|
void QQtEthenetManager::saveScript()
|
||||||
{
|
{
|
||||||
QString ip, mask, gw, dns;
|
QString ip, mask, gw, dns;
|
||||||
getAddr(ip, mask, gw, dns);
|
getAddr(ip, mask, gw, dns);
|
||||||
@ -445,7 +445,7 @@ void QQTEthenetManager::saveScript()
|
|||||||
system(cmdbuf);
|
system(cmdbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTEthenetManager::config()
|
void QQtEthenetManager::config()
|
||||||
{
|
{
|
||||||
char cmdbuf[MAX_PATH];
|
char cmdbuf[MAX_PATH];
|
||||||
bzero(cmdbuf, MAX_PATH);
|
bzero(cmdbuf, MAX_PATH);
|
||||||
@ -507,7 +507,7 @@ void QQTEthenetManager::config()
|
|||||||
system(cmdbuf);
|
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;
|
QSettings netSet;
|
||||||
netSet.setValue("/Network/IP", ip);
|
netSet.setValue("/Network/IP", ip);
|
||||||
@ -517,7 +517,7 @@ void QQTEthenetManager::setAddr(QString ip, QString mask, QString gw, QString dn
|
|||||||
netSet.sync();
|
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;
|
QSettings netSet;
|
||||||
ip = netSet.value("/Network/IP").toString();
|
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();
|
dns = netSet.value("/Network/DNS").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTDhcpThread::run()
|
void QQtDHCPThread::run()
|
||||||
{
|
{
|
||||||
char cmdbuf[MAX_PATH];
|
char cmdbuf[MAX_PATH];
|
||||||
bzero(cmdbuf, MAX_PATH);
|
bzero(cmdbuf, MAX_PATH);
|
||||||
@ -536,7 +536,7 @@ void QQTDhcpThread::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QQTNetworkClearThread::run()
|
void QQtNetWorkClearThread::run()
|
||||||
{
|
{
|
||||||
static bool _bclear = false;
|
static bool _bclear = false;
|
||||||
bool bclear = false;
|
bool bclear = false;
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt-local.h"
|
#include "qqt-local.h"
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTNetworkClearThread : public QThread
|
class QQTSHARED_EXPORT QQtNetWorkClearThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QQTNetworkClearThread(QObject* parent = 0) : QThread(parent) {
|
QQtNetWorkClearThread ( QObject* parent = 0 ) : QThread ( parent ) {
|
||||||
}
|
}
|
||||||
signals:
|
signals:
|
||||||
void cleared();
|
void cleared();
|
||||||
@ -23,15 +23,15 @@ protected:
|
|||||||
void run();
|
void run();
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTDhcpThread : public QThread
|
class QQTSHARED_EXPORT QQtDHCPThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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:
|
signals:
|
||||||
void passed(QString);
|
void passed ( QString );
|
||||||
// QThread interface
|
// QThread interface
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
@ -40,19 +40,19 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// thread unsafe
|
// thread unsafe
|
||||||
class QQTSHARED_EXPORT QQTEthenetManager : public QObject
|
class QQTSHARED_EXPORT QQtEthenetManager : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static QQTEthenetManager* Instance(QObject* parent = 0);
|
static QQtEthenetManager* Instance ( QObject* parent = 0 );
|
||||||
|
|
||||||
QList<TWifi>& wifiList() { return m_wifiList; }
|
QList<TWifi>& wifiList() { return m_wifiList; }
|
||||||
inline TWifi currentWifi() { return m_curWifi; }
|
inline TWifi currentWifi() { return m_curWifi; }
|
||||||
bool setCurrentWifi(QString bssid_mac, QString password = "");
|
bool setCurrentWifi ( QString bssid_mac, QString password = "" );
|
||||||
void setRefresh(bool ref = true) { ref ? m_workTimer->start(5000) : m_workTimer->stop(); }
|
void setRefresh ( bool ref = true ) { ref ? m_workTimer->start ( 5000 ) : m_workTimer->stop(); }
|
||||||
void setDHCP(bool bUse = false) { m_bUseDHCP = bUse; }
|
void setDHCP ( bool bUse = false ) { m_bUseDHCP = bUse; }
|
||||||
void setAddr(QString ip, QString mask, QString gw, QString dns);
|
void setAddr ( QString ip, QString mask, QString gw, QString dns );
|
||||||
void getAddr(QString& ip, QString& mask, QString& gw, QString& dns);
|
void getAddr ( QString& ip, QString& mask, QString& gw, QString& dns );
|
||||||
/**
|
/**
|
||||||
* @brief configIPAddress
|
* @brief configIPAddress
|
||||||
* wpa_suplicant.conf
|
* wpa_suplicant.conf
|
||||||
@ -87,7 +87,7 @@ signals:
|
|||||||
/*
|
/*
|
||||||
* Wifi状态改变
|
* Wifi状态改变
|
||||||
*/
|
*/
|
||||||
void sigStatusChanged(QString status);
|
void sigStatusChanged ( QString status );
|
||||||
/*
|
/*
|
||||||
* 有线连接上
|
* 有线连接上
|
||||||
*/
|
*/
|
||||||
@ -109,11 +109,11 @@ private slots:
|
|||||||
void refreshWifiList();
|
void refreshWifiList();
|
||||||
void refreshWifiStatus();
|
void refreshWifiStatus();
|
||||||
void checkLanConnection();
|
void checkLanConnection();
|
||||||
void DhcpPassed(QString netname);
|
void DhcpPassed ( QString netname );
|
||||||
void checkNetworkClear();
|
void checkNetworkClear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit QQTEthenetManager(QObject* parent = 0);
|
explicit QQtEthenetManager ( QObject* parent = 0 );
|
||||||
void readStatus();
|
void readStatus();
|
||||||
void restoreWifi();
|
void restoreWifi();
|
||||||
bool restartWifi();
|
bool restartWifi();
|
||||||
@ -124,14 +124,14 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
private:
|
private:
|
||||||
static QQTEthenetManager* _instance;
|
static QQtEthenetManager* _instance;
|
||||||
QTimer* m_workTimer;
|
QTimer* m_workTimer;
|
||||||
QList<TWifi> m_wifiList;
|
QList<TWifi> m_wifiList;
|
||||||
TWifi m_curWifi;
|
TWifi m_curWifi;
|
||||||
bool m_bUseDHCP;
|
bool m_bUseDHCP;
|
||||||
QString m_netName;
|
QString m_netName;
|
||||||
QQTDhcpThread* m_thread;
|
QQtDHCPThread* m_thread;
|
||||||
QQTNetworkClearThread* m_clearThread;
|
QQtNetWorkClearThread* m_clearThread;
|
||||||
QString m_status;
|
QString m_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,25 +2,25 @@
|
|||||||
#include "qqtnetwork.h"
|
#include "qqtnetwork.h"
|
||||||
|
|
||||||
|
|
||||||
QQTServer::QQTServer(QObject* parent) :
|
QQtServer::QQtServer(QObject* parent) :
|
||||||
QTcpServer(parent)
|
QTcpServer(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTServer::~QQTServer()
|
QQtServer::~QQtServer()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTServer::incomingConnection(qintptr handle)
|
void QQtServer::incomingConnection(qintptr handle)
|
||||||
{
|
{
|
||||||
QQTClient* clientSocket = new QQTClient(this);
|
QQtClient* clientSocket = new QQtClient(this);
|
||||||
clientSocket->setSocketDescriptor(handle);
|
clientSocket->setSocketDescriptor(handle);
|
||||||
connect(clientSocket, SIGNAL(disconnected()), clientSocket, SLOT(deleteLater()));
|
connect(clientSocket, SIGNAL(disconnected()), clientSocket, SLOT(deleteLater()));
|
||||||
clientSocket->installProtocol(m_protocol);
|
clientSocket->installProtocol(m_protocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTServer::installProtocol(QQtProtocol* stack)
|
void QQtServer::installProtocol(QQtProtocol* stack)
|
||||||
{
|
{
|
||||||
if (m_protocol)
|
if (m_protocol)
|
||||||
return;
|
return;
|
||||||
@ -28,7 +28,7 @@ void QQTServer::installProtocol(QQtProtocol* stack)
|
|||||||
m_protocol = stack;
|
m_protocol = stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTServer::uninstallProtocol(QQtProtocol* stack)
|
void QQtServer::uninstallProtocol(QQtProtocol* stack)
|
||||||
{
|
{
|
||||||
Q_UNUSED(stack)
|
Q_UNUSED(stack)
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ void QQTServer::uninstallProtocol(QQtProtocol* stack)
|
|||||||
m_protocol = NULL;
|
m_protocol = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQtProtocol* QQTServer::installedProtocol()
|
QQtProtocol* QQtServer::installedProtocol()
|
||||||
{
|
{
|
||||||
return m_protocol;
|
return m_protocol;
|
||||||
}
|
}
|
||||||
|
@ -7,21 +7,21 @@
|
|||||||
#include "qqt-local.h"
|
#include "qqt-local.h"
|
||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTServer : public QTcpServer
|
class QQTSHARED_EXPORT QQtServer : public QTcpServer
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTServer(QObject* parent = 0);
|
explicit QQtServer ( QObject* parent = 0 );
|
||||||
~QQTServer();
|
~QQtServer();
|
||||||
|
|
||||||
void installProtocol(QQtProtocol* stack);
|
void installProtocol ( QQtProtocol* stack );
|
||||||
void uninstallProtocol(QQtProtocol* stack);
|
void uninstallProtocol ( QQtProtocol* stack );
|
||||||
QQtProtocol* installedProtocol();
|
QQtProtocol* installedProtocol();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// QTcpServer interface
|
// QTcpServer interface
|
||||||
protected:
|
protected:
|
||||||
virtual void incomingConnection(qintptr handle) override;
|
virtual void incomingConnection ( qintptr handle ) override;
|
||||||
private:
|
private:
|
||||||
QQtProtocol* m_protocol;
|
QQtProtocol* m_protocol;
|
||||||
};
|
};
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <QMouseDriverFactory>
|
#include <QMouseDriverFactory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QQTPluginWatcher* QQTPluginWatcher::_instance = NULL;
|
QQtPluginWatcher* QQtPluginWatcher::_instance = NULL;
|
||||||
QQTPluginWatcher::QQTPluginWatcher(QObject* parent) :
|
QQtPluginWatcher::QQtPluginWatcher(QObject* parent) :
|
||||||
QThread(parent)
|
QThread(parent)
|
||||||
{
|
{
|
||||||
m_devType = E_NULLDEV;
|
m_devType = E_NULLDEV;
|
||||||
@ -31,16 +31,16 @@ QQTPluginWatcher::QQTPluginWatcher(QObject* parent) :
|
|||||||
watcher->start();
|
watcher->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTPluginWatcher* QQTPluginWatcher::Instance()
|
QQtPluginWatcher* QQtPluginWatcher::Instance()
|
||||||
{
|
{
|
||||||
if (_instance)
|
if (_instance)
|
||||||
return _instance;
|
return _instance;
|
||||||
|
|
||||||
_instance = new QQTPluginWatcher();
|
_instance = new QQtPluginWatcher();
|
||||||
return _instance;
|
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));
|
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);
|
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));
|
qDebug("tid=%#llx %s: remove %s", (quintptr)QThread::currentThreadId(), __PRETTY_FUNCTION__, qPrintable(dev));
|
||||||
m_devStat = E_RM;
|
m_devStat = E_RM;
|
||||||
timer->start(1000);
|
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));
|
qDebug("tid=%#llx %s: change %s", (quintptr)QThread::currentThreadId(), __PRETTY_FUNCTION__, qPrintable(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPluginWatcher::slotDeviceDriver()
|
void QQtPluginWatcher::slotDeviceDriver()
|
||||||
{
|
{
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ void QQTPluginWatcher::slotDeviceDriver()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQTPluginWatcher::event(QEvent* e)
|
bool QQtPluginWatcher::event(QEvent* e)
|
||||||
{
|
{
|
||||||
if (e->type() == QDeviceChangeEvent::registeredType())
|
if (e->type() == QDeviceChangeEvent::registeredType())
|
||||||
{
|
{
|
||||||
|
@ -30,11 +30,11 @@
|
|||||||
#define __PRETTY_FUNCTION__ __FUNCTION__
|
#define __PRETTY_FUNCTION__ __FUNCTION__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTPluginWatcher : public QThread
|
class QQTSHARED_EXPORT QQtPluginWatcher : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static QQTPluginWatcher* Instance();
|
static QQtPluginWatcher* Instance();
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -60,23 +60,23 @@ public:
|
|||||||
QString printerFile() { return "/dev/usb/lp0"; }
|
QString printerFile() { return "/dev/usb/lp0"; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void storageChanged(int stat);
|
void storageChanged ( int stat );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slotDeviceAdded(const QString& dev);
|
void slotDeviceAdded ( const QString& dev );
|
||||||
void slotDeviceRemoved(const QString& dev);
|
void slotDeviceRemoved ( const QString& dev );
|
||||||
void slotDeviceChanged(const QString& dev);
|
void slotDeviceChanged ( const QString& dev );
|
||||||
void slotDeviceDriver();
|
void slotDeviceDriver();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool event(QEvent* e);
|
virtual bool event ( QEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDeviceWatcher* watcher;
|
QDeviceWatcher* watcher;
|
||||||
explicit QQTPluginWatcher(QObject* parent = 0);
|
explicit QQtPluginWatcher ( QObject* parent = 0 );
|
||||||
static QQTPluginWatcher* _instance;
|
static QQtPluginWatcher* _instance;
|
||||||
quint32 m_devType;
|
quint32 m_devType;
|
||||||
quint32 m_devStat;
|
quint32 m_devStat;
|
||||||
QString m_storage;
|
QString m_storage;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
#include "qqtprinter.h"
|
#include "qqtprinter.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
QQTPrinter::QQTPrinter(QPrinter::PrinterMode mode) :
|
QQtPrinter::QQtPrinter(QPrinter::PrinterMode mode) :
|
||||||
QPrinter(mode)
|
QPrinter(mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPrinter::setOutputFileName(const QString& name)
|
void QQtPrinter::setOutputFileName(const QString& name)
|
||||||
{
|
{
|
||||||
m_outputname = name;
|
m_outputname = name;
|
||||||
QPrinter::setOutputFileName(m_outputname);
|
QPrinter::setOutputFileName(m_outputname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTPrinter::print()
|
void QQtPrinter::print()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 此处不会影响打印质量,不必再调试
|
* 此处不会影响打印质量,不必再调试
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTPrinter : public QPrinter
|
class QQTSHARED_EXPORT QQtPrinter : public QPrinter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QQTPrinter(PrinterMode mode = HighResolution);
|
QQtPrinter ( PrinterMode mode = HighResolution );
|
||||||
|
|
||||||
void setOutputFileName(const QString&);
|
void setOutputFileName ( const QString& );
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -16,6 +16,7 @@ contains (DEFINES, __EXQUISITE__) {
|
|||||||
#DEFINES += __QRDECODE__
|
#DEFINES += __QRDECODE__
|
||||||
contains (DEFINES, __QRDECODE__) {
|
contains (DEFINES, __QRDECODE__) {
|
||||||
contains(QKIT_PRIVATE, WIN32|WIN64) {
|
contains(QKIT_PRIVATE, WIN32|WIN64) {
|
||||||
|
#ignore: QZXing has no need to export
|
||||||
contains (DEFINES, QQT_LIBRARY) {
|
contains (DEFINES, QQT_LIBRARY) {
|
||||||
DEFINES += QZXING_LIBRARY
|
DEFINES += QZXING_LIBRARY
|
||||||
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
|
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
|
||||||
|
@ -143,16 +143,13 @@ equals(QT_VERSION, 5.9.1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#Qt 5.9.2, android support this feature
|
#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) {
|
contains(QKIT_PRIVATE, iOS||iOSSimulator) {
|
||||||
DEFINES -= __PRINTSUPPORT__
|
DEFINES -= __PRINTSUPPORT__
|
||||||
}
|
}
|
||||||
contains (DEFINES, __PRINTSUPPORT__) {
|
contains (DEFINES, __PRINTSUPPORT__) {
|
||||||
#qtHaveModule(printsupport) : message(qqt use module printsupport)
|
#qtHaveModule(printsupport) : message(qqt use module printsupport)
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += 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###############################
|
##################Exquisite Module###############################
|
||||||
@ -181,7 +178,7 @@ contains (DEFINES, __EXQUISITE__) {
|
|||||||
##################WebSocket Module###############################
|
##################WebSocket Module###############################
|
||||||
#don't close this macro ...
|
#don't close this macro ...
|
||||||
DEFINES += __TCPUDPSOCKET__
|
DEFINES += __TCPUDPSOCKET__
|
||||||
#if you use Qt Service Spoort ( QtSoap ), open this annotation
|
#if you use Qt Service Support ( QtSoap ), open this annotation
|
||||||
DEFINES += __WEBSERVICESUPPORT__
|
DEFINES += __WEBSERVICESUPPORT__
|
||||||
#One Ftp Http 单工...
|
#One Ftp Http 单工...
|
||||||
#Multi 半双工(客户端并发,服务器序列) QNetworkAccessManager
|
#Multi 半双工(客户端并发,服务器序列) QNetworkAccessManager
|
||||||
@ -203,6 +200,18 @@ contains (DEFINES, __WEBSOCKETSUPPORT__) {
|
|||||||
#TODO: QT += webkit
|
#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
|
##library
|
||||||
##################################################################
|
##################################################################
|
||||||
@ -245,6 +254,7 @@ INCLUDEPATH += $$PWD/pluginwatcher
|
|||||||
INCLUDEPATH += $$PWD/printsupport
|
INCLUDEPATH += $$PWD/printsupport
|
||||||
INCLUDEPATH += $$PWD/sql
|
INCLUDEPATH += $$PWD/sql
|
||||||
INCLUDEPATH += $$PWD/widgets
|
INCLUDEPATH += $$PWD/widgets
|
||||||
|
INCLUDEPATH += $$PWD/charts
|
||||||
|
|
||||||
#exquisite widget
|
#exquisite widget
|
||||||
INCLUDEPATH += $$PWD/exquisite
|
INCLUDEPATH += $$PWD/exquisite
|
||||||
|
@ -14,7 +14,32 @@
|
|||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
SOURCES +=
|
SOURCES +=
|
||||||
HEADERS +=
|
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
|
#root dir
|
||||||
HEADERS += $$PWD/qqt.h \
|
HEADERS += $$PWD/qqt.h \
|
||||||
@ -169,24 +194,6 @@ contains (DEFINES, __PRINTSUPPORT__) {
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/frame/qqtword.h
|
$$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
|
#network
|
||||||
|
@ -57,11 +57,11 @@ QQtApplication::QQtApplication(int& argc, char** argv) :
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __EMBEDDED_LINUX__
|
#ifdef __EMBEDDED_LINUX__
|
||||||
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
QQtInput::Instance()->Init("min", "control", "QQT", 14, 14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __PLUGINWATCHER__
|
#ifdef __PLUGINWATCHER__
|
||||||
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
|
QObject::connect(QQtPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
|
||||||
this, SLOT(slotUPanAutoRun(int)));
|
this, SLOT(slotUPanAutoRun(int)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -99,15 +99,15 @@ void QQtApplication::slotUPanAutoRun(int status)
|
|||||||
|
|
||||||
#ifdef __PLUGINWATCHER__
|
#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);
|
QString app = QString("%1/autorun.sh").arg(mP);
|
||||||
QFile file(app);
|
QFile file(app);
|
||||||
|
|
||||||
if (file.exists())
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3,40 +3,40 @@
|
|||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include "qqtcore.h"
|
#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)
|
Q_UNUSED(widget)
|
||||||
QFont oldFont(painter->font());
|
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)
|
Q_UNUSED(widget)
|
||||||
QPen oldPen(painter->pen());
|
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)
|
Q_UNUSED(widget)
|
||||||
QPen oldPen(painter->pen());
|
QPen oldPen(painter->pen());
|
||||||
|
@ -5,100 +5,100 @@
|
|||||||
#include <QGraphicsProxyWidget>
|
#include <QGraphicsProxyWidget>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsItem : public QGraphicsItem
|
class QQTSHARED_EXPORT QQtGraphicsItem : public QGraphicsItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsTextItem : public QGraphicsTextItem
|
class QQTSHARED_EXPORT QQtGraphicsTextItem : public QGraphicsTextItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsTextItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsTextItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
// QGraphicsItem interface
|
// QGraphicsItem interface
|
||||||
public:
|
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:
|
public:
|
||||||
explicit QQTGraphicsSimpleTextItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsSimpleTextItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsPixmapItem : public QGraphicsPixmapItem
|
class QQTSHARED_EXPORT QQtGraphicsPixmapItem : public QGraphicsPixmapItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsPixmapItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsPixmapItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsRectItem : public QGraphicsRectItem
|
class QQTSHARED_EXPORT QQtGraphicsRectItem : public QGraphicsRectItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsRectItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsRectItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
// QGraphicsItem interface
|
// QGraphicsItem interface
|
||||||
public:
|
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:
|
public:
|
||||||
explicit QQTGraphicsLineItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsLineItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
// QGraphicsItem interface
|
// QGraphicsItem interface
|
||||||
public:
|
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:
|
public:
|
||||||
explicit QQTGraphicsPathItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsPathItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsEllipseItem : public QGraphicsEllipseItem
|
class QQTSHARED_EXPORT QQtGraphicsEllipseItem : public QGraphicsEllipseItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsEllipseItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsEllipseItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsPolygonItem : public QGraphicsPolygonItem
|
class QQTSHARED_EXPORT QQtGraphicsPolygonItem : public QGraphicsPolygonItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsPolygonItem(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsPolygonItem ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsItemGroup : public QGraphicsItemGroup
|
class QQTSHARED_EXPORT QQtGraphicsItemGroup : public QGraphicsItemGroup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsItemGroup(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsItemGroup ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsProxyWidget : public QGraphicsProxyWidget
|
class QQTSHARED_EXPORT QQtGraphicsProxyWidget : public QGraphicsProxyWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsProxyWidget(QQTGraphicsItem* parent = 0);
|
explicit QQtGraphicsProxyWidget ( QQtGraphicsItem* parent = 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,25 +3,25 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "qqtcore.h"
|
#include "qqtcore.h"
|
||||||
#include "qqt-qt.h"
|
#include "qqt-qt.h"
|
||||||
QQTGraphicsScene::QQTGraphicsScene(QObject* parent) :
|
QQtGraphicsScene::QQtGraphicsScene(QObject* parent) :
|
||||||
QGraphicsScene(parent)
|
QGraphicsScene(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QQTGraphicsScene::QQTGraphicsScene(const QRectF& sceneRect, QObject* parent) :
|
QQtGraphicsScene::QQtGraphicsScene(const QRectF& sceneRect, QObject* parent) :
|
||||||
QGraphicsScene(sceneRect, 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)
|
QGraphicsScene(x, y, width, height, parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QQTGraphicsScene::render
|
* @brief QQtGraphicsScene::render
|
||||||
* 经过测试,失真是由于render放缩QPainter和drawItems里面的itemPaint共同导致失真
|
* 经过测试,失真是由于render放缩QPainter和drawItems里面的itemPaint共同导致失真
|
||||||
* 现在规整理如下,原则:Qpainter不允许改变
|
* 现在规整理如下,原则:Qpainter不允许改变
|
||||||
* 重写itemPaint函数
|
* 重写itemPaint函数
|
||||||
@ -30,7 +30,7 @@ QQTGraphicsScene::QQTGraphicsScene(qreal x, qreal y, qreal width, qreal height,
|
|||||||
* @param source
|
* @param source
|
||||||
* @param aspectRatioMode
|
* @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)
|
Qt::AspectRatioMode aspectRatioMode)
|
||||||
{
|
{
|
||||||
Q_UNUSED(aspectRatioMode)
|
Q_UNUSED(aspectRatioMode)
|
||||||
@ -101,18 +101,18 @@ void QQTGraphicsScene::render(QPainter* painter, const QRectF& target, const QRe
|
|||||||
painter->restore();
|
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->setFont(font);
|
||||||
item->setPlainText(text);
|
item->setPlainText(text);
|
||||||
addItem(item);
|
addItem(item);
|
||||||
return 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->setRect(rect);
|
||||||
item->setPen(pen);
|
item->setPen(pen);
|
||||||
item->setBrush(brush);
|
item->setBrush(brush);
|
||||||
@ -121,9 +121,9 @@ QQTGraphicsRectItem* QQTGraphicsScene::addRect(const QRectF& rect, const QPen& p
|
|||||||
return item;
|
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->setLine(line);
|
||||||
item->setPen(pen);
|
item->setPen(pen);
|
||||||
item->moveBy(line.x1(), line.y1());
|
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)
|
const QStyleOptionGraphicsItem options[], QWidget* widget)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < numItems; ++i)
|
for (int i = 0; i < numItems; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
QQTGraphicsItem* item = (QQTGraphicsItem*)items[i];
|
QQtGraphicsItem* item = (QQtGraphicsItem*)items[i];
|
||||||
|
|
||||||
if (item->flags() & QGraphicsItem::ItemClipsToShape)
|
if (item->flags() & QGraphicsItem::ItemClipsToShape)
|
||||||
{
|
{
|
||||||
|
@ -5,36 +5,37 @@
|
|||||||
#include "qqtgraphicsitem.h"
|
#include "qqtgraphicsitem.h"
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsScene : public QGraphicsScene
|
class QQTSHARED_EXPORT QQtGraphicsScene : public QGraphicsScene
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QQTGraphicsScene(QObject* parent = 0);
|
QQtGraphicsScene ( QObject* parent = 0 );
|
||||||
QQTGraphicsScene(const QRectF& sceneRect, QObject* parent = 0);
|
QQtGraphicsScene ( const QRectF& sceneRect, QObject* parent = 0 );
|
||||||
QQTGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent = 0);
|
QQtGraphicsScene ( qreal x, qreal y, qreal width, qreal height, QObject* parent = 0 );
|
||||||
virtual ~QQTGraphicsScene() {}
|
virtual ~QQtGraphicsScene() {}
|
||||||
|
|
||||||
void render(QPainter* painter,
|
void render ( QPainter* painter,
|
||||||
const QRectF& target = QRectF(), const QRectF& source = QRectF(),
|
const QRectF& target = QRectF(), const QRectF& source = QRectF(),
|
||||||
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio);
|
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio );
|
||||||
QQTGraphicsEllipseItem* addEllipse(const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush());
|
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(),
|
inline QGraphicsEllipseItem* addEllipse ( qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
|
||||||
const QBrush& brush = QBrush())
|
const QBrush& brush = QBrush() )
|
||||||
{ return addEllipse(QRectF(x, y, w, h), pen, brush); }
|
{ return addEllipse ( QRectF ( x, y, w, h ), pen, brush ); }
|
||||||
|
|
||||||
QQTGraphicsPathItem* addPath(const QPainterPath& path, const QPen& pen = QPen(), const QBrush& brush = QBrush());
|
QQtGraphicsPathItem* addPath ( const QPainterPath& path, const QPen& pen = QPen(), const QBrush& brush = QBrush() );
|
||||||
QQTGraphicsPixmapItem* addPixmap(const QPixmap& pixmap);
|
QQtGraphicsPixmapItem* addPixmap ( const QPixmap& pixmap );
|
||||||
QQTGraphicsPolygonItem* addPolygon(const QPolygonF& polygon, const QPen& pen = QPen(), const QBrush& brush = QBrush());
|
QQtGraphicsPolygonItem* addPolygon ( const QPolygonF& polygon, const QPen& pen = QPen(),
|
||||||
QQTGraphicsTextItem* addText(const QString& text, const QFont& font = QFont());
|
const QBrush& brush = QBrush() );
|
||||||
QQTGraphicsSimpleTextItem* addSimpleText(const QString& text, const QFont& font = QFont());
|
QQtGraphicsTextItem* addText ( const QString& text, const QFont& font = QFont() );
|
||||||
QQTGraphicsProxyWidget* addWidget(QWidget* widget, Qt::WindowFlags wFlags = 0);
|
QQtGraphicsSimpleTextItem* addSimpleText ( const QString& text, const QFont& font = QFont() );
|
||||||
QQTGraphicsLineItem* addLine(const QLineF& line, const QPen& pen = QPen());
|
QQtGraphicsProxyWidget* addWidget ( QWidget* widget, Qt::WindowFlags wFlags = 0 );
|
||||||
inline QQTGraphicsLineItem* addLine(qreal x1, qreal y1, qreal x2, qreal y2, const QPen& pen = QPen())
|
QQtGraphicsLineItem* addLine ( const QLineF& line, const QPen& pen = QPen() );
|
||||||
{ return addLine(QLineF(x1, y1, x2, y2), pen); }
|
inline QQtGraphicsLineItem* addLine ( qreal x1, qreal y1, qreal x2, qreal y2, const QPen& pen = QPen() )
|
||||||
QQTGraphicsRectItem* addRect(const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush());
|
{ return addLine ( QLineF ( x1, y1, x2, y2 ), pen ); }
|
||||||
inline QQTGraphicsRectItem* addRect(qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
|
QQtGraphicsRectItem* addRect ( const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush() );
|
||||||
const QBrush& brush = QBrush())
|
inline QQtGraphicsRectItem* addRect ( qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(),
|
||||||
{ return addRect(QRectF(x, y, w, h), pen, brush); }
|
const QBrush& brush = QBrush() )
|
||||||
|
{ return addRect ( QRectF ( x, y, w, h ), pen, brush ); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
@ -43,8 +44,8 @@ public slots:
|
|||||||
|
|
||||||
// QGraphicsScene interface
|
// QGraphicsScene interface
|
||||||
protected:
|
protected:
|
||||||
void drawItems(QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[],
|
void drawItems ( QPainter* painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[],
|
||||||
QWidget* widget = 0);
|
QWidget* widget = 0 );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
#include "qqtgraphicsscene.h"
|
#include "qqtgraphicsscene.h"
|
||||||
#include "qqt-qt.h"
|
#include "qqt-qt.h"
|
||||||
|
|
||||||
QQTGraphicsView::QQTGraphicsView(QWidget* parent) :
|
QQtGraphicsView::QQtGraphicsView(QWidget* parent) :
|
||||||
QGraphicsView(parent)
|
QGraphicsView(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QQTGraphicsView::paintEvent(QPaintEvent* e)
|
void QQtGraphicsView::paintEvent(QPaintEvent* e)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
//已经确认,在PC和板子上,这同一套计算代码,都存在问题
|
//已经确认,在PC和板子上,这同一套计算代码,都存在问题
|
||||||
@ -30,7 +30,7 @@ void QQTGraphicsView::paintEvent(QPaintEvent* e)
|
|||||||
// pline() << logicalDpiX() << logicalDpiY();
|
// pline() << logicalDpiX() << logicalDpiY();
|
||||||
//pc 96 0.81,0.46 743,593 778,628
|
//pc 96 0.81,0.46 743,593 778,628
|
||||||
//p.scale(1.5/1, 1.5/1);
|
//p.scale(1.5/1, 1.5/1);
|
||||||
QQTGraphicsScene* sn = (QQTGraphicsScene*)scene();
|
QQtGraphicsScene* sn = (QQtGraphicsScene*)scene();
|
||||||
sn->render(&p, rf, rt);
|
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[])
|
const QStyleOptionGraphicsItem options[])
|
||||||
{
|
{
|
||||||
for (int i = 0; i < numItems; ++i)
|
for (int i = 0; i < numItems; ++i)
|
||||||
{
|
{
|
||||||
// Save painter
|
// Save painter
|
||||||
QQTGraphicsItem* item = (QQTGraphicsItem*)items[i];
|
QQtGraphicsItem* item = (QQtGraphicsItem*)items[i];
|
||||||
|
|
||||||
if (item->flags() & QGraphicsItem::ItemClipsToShape)
|
if (item->flags() & QGraphicsItem::ItemClipsToShape)
|
||||||
{
|
{
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTGraphicsView : public QGraphicsView
|
class QQTSHARED_EXPORT QQtGraphicsView : public QGraphicsView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTGraphicsView(QWidget* parent = 0);
|
explicit QQtGraphicsView ( QWidget* parent = 0 );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
@ -17,11 +17,11 @@ public slots:
|
|||||||
|
|
||||||
// QWidget interface
|
// QWidget interface
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent*);
|
void paintEvent ( QPaintEvent* );
|
||||||
|
|
||||||
// QGraphicsView interface
|
// QGraphicsView interface
|
||||||
protected:
|
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
|
#endif // QQTGRAPHICSVIEW_H
|
||||||
|
@ -6,19 +6,19 @@
|
|||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
|
||||||
QQTHeaderView::QQTHeaderView(Qt::Orientation orientation, QWidget* parent) :
|
QQtHeaderView::QQtHeaderView(Qt::Orientation orientation, QWidget* parent) :
|
||||||
QHeaderView(orientation, parent), ori(orientation)
|
QHeaderView(orientation, parent), ori(orientation)
|
||||||
{
|
{
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
setStyleSheet("QHeaderView, QHeaderView::section{background:transparent;}");
|
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());
|
painter->drawText(rect, Qt::AlignCenter, model()->headerData(logicalIndex, ori).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QQTHeaderView::sectionSizeFromContents(int logicalIndex) const
|
QSize QQtHeaderView::sectionSizeFromContents(int logicalIndex) const
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 文字宽度 不是section宽度
|
* 文字宽度 不是section宽度
|
||||||
@ -26,7 +26,7 @@ QSize QQTHeaderView::sectionSizeFromContents(int logicalIndex) const
|
|||||||
return QHeaderView::sectionSizeFromContents(logicalIndex);
|
return QHeaderView::sectionSizeFromContents(logicalIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTHeaderView::paintEvent(QPaintEvent* e)
|
void QQtHeaderView::paintEvent(QPaintEvent* e)
|
||||||
{
|
{
|
||||||
Q_UNUSED(e)
|
Q_UNUSED(e)
|
||||||
QStylePainter p(this->viewport());
|
QStylePainter p(this->viewport());
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
/**
|
/**
|
||||||
* @brief The QQTHeaderView class
|
* @brief The QQtHeaderView class
|
||||||
* Qt4.8.7 不能HeaderView背景全部透明,重写
|
* Qt4.8.7 不能HeaderView背景全部透明,重写
|
||||||
*/
|
*/
|
||||||
class QQTSHARED_EXPORT QQTHeaderView : public QHeaderView
|
class QQTSHARED_EXPORT QQtHeaderView : public QHeaderView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTHeaderView ( Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0 );
|
explicit QQtHeaderView ( Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0 );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include "qqtwidgets.h"
|
#include "qqtwidgets.h"
|
||||||
|
|
||||||
QQTLineEditWithSearch::QQTLineEditWithSearch(QWidget* parent) :
|
QQtLineEditWithSearch::QQtLineEditWithSearch(QWidget* parent) :
|
||||||
QLineEdit(parent)
|
QLineEdit(parent)
|
||||||
{
|
{
|
||||||
m_btnBrower = new QPushButton(this);
|
m_btnBrower = new QPushButton(this);
|
||||||
@ -28,12 +28,12 @@ QQTLineEditWithSearch::QQTLineEditWithSearch(QWidget* parent) :
|
|||||||
connect(m_btnBrower, SIGNAL(clicked()), this, SIGNAL(btnClicked()));
|
connect(m_btnBrower, SIGNAL(clicked()), this, SIGNAL(btnClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTLineEditWithSearch::setButtonText(QString text)
|
void QQtLineEditWithSearch::setButtonText(QString text)
|
||||||
{
|
{
|
||||||
m_btnBrower->setText(text);
|
m_btnBrower->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQTLineEditWithSearch::setObjectName(const QString& name)
|
void QQtLineEditWithSearch::setObjectName(const QString& name)
|
||||||
{
|
{
|
||||||
QLineEdit::setObjectName(name);
|
QLineEdit::setObjectName(name);
|
||||||
m_btnBrower->setObjectName(QString("%1_button").arg(name));
|
m_btnBrower->setObjectName(QString("%1_button").arg(name));
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <qqt-local.h>
|
#include <qqt-local.h>
|
||||||
|
|
||||||
class QQTSHARED_EXPORT QQTLineEditWithSearch : public QLineEdit
|
class QQTSHARED_EXPORT QQtLineEditWithSearch : public QLineEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QQTLineEditWithSearch(QWidget* parent = 0);
|
explicit QQtLineEditWithSearch ( QWidget* parent = 0 );
|
||||||
void setButtonText(QString text);
|
void setButtonText ( QString text );
|
||||||
void setObjectName(const QString& name);
|
void setObjectName ( const QString& name );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void btnClicked();
|
void btnClicked();
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
QQtTableView::QQtTableView(QWidget* parent) :
|
QQtTableView::QQtTableView(QWidget* parent) :
|
||||||
QTableView(parent)
|
QTableView(parent)
|
||||||
{
|
{
|
||||||
m_header = new QQTHeaderView(Qt::Horizontal, this);
|
m_header = new QQtHeaderView(Qt::Horizontal, this);
|
||||||
m_vheader = new QQTHeaderView(Qt::Vertical, this);
|
m_vheader = new QQtHeaderView(Qt::Vertical, this);
|
||||||
|
|
||||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
@ -13,15 +13,15 @@ public:
|
|||||||
explicit QQtTableView(QWidget* parent = 0);
|
explicit QQtTableView(QWidget* parent = 0);
|
||||||
virtual ~QQtTableView();
|
virtual ~QQtTableView();
|
||||||
|
|
||||||
QQTHeaderView* QQTHHeader() { return m_header; }
|
QQtHeaderView* QQTHHeader() { return m_header; }
|
||||||
QQTHeaderView* QQTVHeader() { return m_vheader; }
|
QQtHeaderView* QQTVHeader() { return m_vheader; }
|
||||||
void setQQTHeader();
|
void setQQTHeader();
|
||||||
void setQQTVHeader();
|
void setQQTVHeader();
|
||||||
void setObjectName(const QString& name);
|
void setObjectName(const QString& name);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QQTHeaderView* m_vheader;
|
QQtHeaderView* m_vheader;
|
||||||
QQTHeaderView* m_header;
|
QQtHeaderView* m_header;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QQTTABLEVIEW_H
|
#endif // QQTTABLEVIEW_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user