2017-11-16 22:09:17 +08:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
#include "qqtsvgwidget.h"
|
|
|
|
#include "qqtsvgpushbutton.h"
|
2017-11-18 10:50:48 +08:00
|
|
|
#include "qqt-qt.h"
|
|
|
|
#include <QObject>
|
2017-11-16 22:09:17 +08:00
|
|
|
|
2017-11-18 10:50:48 +08:00
|
|
|
MainWindow::MainWindow ( QWidget* parent ) :
|
|
|
|
QMainWindow ( parent ),
|
|
|
|
ui ( new Ui::MainWindow )
|
2017-11-16 22:09:17 +08:00
|
|
|
{
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->setupUi ( this );
|
2017-11-18 18:12:53 +08:00
|
|
|
QString svg =
|
|
|
|
QString ( "/Users/abel/Develop/b0-toolskits/macLibraries/Qt/Examples/Qt-5.9.2/svg/svgviewer/files/bubbles.svg" );
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->w->setSvgFile ( svg );
|
2017-11-16 22:09:17 +08:00
|
|
|
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->b0->iconTable() [BTN_NORMAL] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->b0->iconTable() [BTN_HOVER] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->b0->iconTable() [BTN_PRESS] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir_press.svg";
|
2017-11-16 22:09:17 +08:00
|
|
|
ui->b0->renderToVariable();
|
2017-11-17 18:58:03 +08:00
|
|
|
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->c0->iconTable() [BTN_NORMAL] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->c0->iconTable() [BTN_HOVER] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->c0->iconTable() [BTN_PRESS] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir_press.svg";
|
2017-11-17 18:58:03 +08:00
|
|
|
ui->c0->renderToVariable();
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->r0->iconTable() [BTN_NORMAL] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->r0->iconTable() [BTN_HOVER] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->r0->iconTable() [BTN_PRESS] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir_press.svg";
|
2017-11-17 18:58:03 +08:00
|
|
|
ui->r0->renderToVariable();
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->r1->iconTable() [BTN_NORMAL] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->r1->iconTable() [BTN_HOVER] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir.svg";
|
|
|
|
ui->r1->iconTable() [BTN_PRESS] = "/Users/abel/Develop/d1-product/App/skin/default/bt_stir_press.svg";
|
2017-11-17 18:58:03 +08:00
|
|
|
ui->r1->renderToVariable();
|
2017-11-18 10:50:48 +08:00
|
|
|
|
2017-11-18 18:12:53 +08:00
|
|
|
ui->p0->setSvgFile ( "/Users/abel/Develop/d1-product/App/skin/default/bk_progress_background.svg",
|
|
|
|
"/Users/abel/Develop/d1-product/App/skin/default/bk_progress_trunk.svg" );
|
2017-11-18 10:50:48 +08:00
|
|
|
ui->p0->setRange ( 0, 100 );
|
|
|
|
ui->p0->setValue ( 60 );
|
2017-11-18 11:38:00 +08:00
|
|
|
|
2017-11-18 10:50:48 +08:00
|
|
|
QTimer* timer = new QTimer ( this );
|
|
|
|
timer->setInterval ( 100 );
|
|
|
|
timer->setSingleShot ( false );
|
2017-11-18 11:38:00 +08:00
|
|
|
QObject::connect ( timer, SIGNAL ( timeout() ),
|
|
|
|
this, SLOT ( updateProgress() ) ) ;
|
2017-11-18 10:50:48 +08:00
|
|
|
timer->start();
|
2017-11-16 22:09:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2017-11-18 11:38:00 +08:00
|
|
|
|
|
|
|
void MainWindow::updateProgress()
|
|
|
|
{
|
|
|
|
static int i = 0;
|
|
|
|
ui->p0->setValue ( i++ % 100 );
|
|
|
|
}
|