mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
fix svg widget qt4 build
This commit is contained in:
parent
55897af10d
commit
b1c56960a6
@ -36,15 +36,12 @@ MainWindow::MainWindow ( QWidget* parent ) :
|
||||
"/Users/abel/Develop/d1-product/App/skin/default/bt_stir_press.svg" );
|
||||
ui->p0->setRange ( 0, 100 );
|
||||
ui->p0->setValue ( 60 );
|
||||
|
||||
QTimer* timer = new QTimer ( this );
|
||||
timer->setInterval ( 100 );
|
||||
timer->setSingleShot ( false );
|
||||
QObject::connect ( timer, &QTimer::timeout,
|
||||
[this]
|
||||
{
|
||||
static int i = 0;
|
||||
ui->p0->setValue ( i++ % 100 );
|
||||
} ) ;
|
||||
QObject::connect ( timer, SIGNAL ( timeout() ),
|
||||
this, SLOT ( updateProgress() ) ) ;
|
||||
timer->start();
|
||||
}
|
||||
|
||||
@ -52,3 +49,9 @@ MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::updateProgress()
|
||||
{
|
||||
static int i = 0;
|
||||
ui->p0->setValue ( i++ % 100 );
|
||||
}
|
||||
|
@ -15,6 +15,9 @@ public:
|
||||
explicit MainWindow ( QWidget* parent = 0 );
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
void updateProgress();
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
};
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <QGraphicsSvgItem>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtGraphicsSvgItem : public QGraphicsSvgItem
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QSvgRenderer>
|
||||
#include <qqtwidgets.h>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgCheckBox : public QQtCheckBox
|
||||
{
|
||||
|
@ -23,11 +23,16 @@ void QQtSvgLabel::paintEvent(QPaintEvent* event)
|
||||
Q_UNUSED ( event )
|
||||
|
||||
QStylePainter p ( this );
|
||||
|
||||
if ( mSvgRender.isValid() )
|
||||
mSvgRender.render ( &p );
|
||||
|
||||
bool enabled = isEnabled();
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
p.drawItemText ( rect(), alignment(), palette(), enabled, text() );
|
||||
#else
|
||||
QStyleOptionFrame opt;
|
||||
initStyleOption ( &opt );
|
||||
p.drawItemText ( rect(), alignment(), opt.palette, enabled, text() );
|
||||
#endif
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <qqtlabel.h>
|
||||
#include <QSvgRenderer>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgLabel : public QQtLabel
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <qqtsvgwidget.h>
|
||||
#include <QSvgRenderer>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgProgressBar : public QQtSvgWidget
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QSvgRenderer>
|
||||
#include <qqtwidgets.h>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgPushButton : public QQtPushButton
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QSvgRenderer>
|
||||
#include <qqtwidgets.h>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgRadioButton : public QQtRadioButton
|
||||
{
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <QSvgWidget>
|
||||
#include <qqt-local.h>
|
||||
#include <qqtcore.h>
|
||||
|
||||
class QQTSHARED_EXPORT QQtSvgWidget : public QSvgWidget
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
// QQTTreeView interface
|
||||
// QQtTreeView interface
|
||||
protected:
|
||||
void drawRow ( QPainter* painter, const QStyleOptionViewItem& options, const QModelIndex& index ) const;
|
||||
void drawBranches ( QPainter* painter, const QRect& rect, const QModelIndex& index ) const;
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "qqttreewidget.h"
|
||||
#include "ui_qqttreewidget.h"
|
||||
#include "qqtxmltreemodel.h"
|
||||
|
||||
QQtTreeWidget::QQtTreeWidget ( QWidget* parent ) :
|
||||
|
Loading…
x
Reference in New Issue
Block a user