Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
arjide committed Nov 23, 2014
1 parent 957ae51 commit 0e540a3
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/mywidgets/myimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
#include <QBitmap>
#include <QDebug>

#if(QT_VERSION>=0x050000)
MyImage::MyImage(QQuickItem *parent) :
QQuickPaintedItem(parent)
#else
MyImage::MyImage(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
#endif
{
m_cache = true;
m_grayscale = false;
Expand Down
15 changes: 14 additions & 1 deletion src/mywidgets/myimage.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
#ifndef MYIMAGE_H
#define MYIMAGE_H

#include <QQuickPaintedItem>
#include <QImage>
#include <QPixmap>
#include <QBitmap>

#if(QT_VERSION>=0x050000)
#include <QQuickPaintedItem>
#else
#include <QDeclarativeItem>
#endif

#if(QT_VERSION>=0x050000)
class MyImage : public QQuickPaintedItem
#else
class MyImage : public QDeclarativeItem
#endif
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QUrl maskSource READ maskSource WRITE setMaskSource NOTIFY maskSourceChanged)
Q_PROPERTY(bool cache READ cache WRITE setCache NOTIFY cacheChanged)
Q_PROPERTY(bool grayscale READ grayscale WRITE setGrayscale NOTIFY grayscaleChanged)
public:
#if(QT_VERSION>=0x050000)
explicit MyImage(QQuickItem *parent = 0);
#else
explicit MyImage(QDeclarativeItem *parent = 0);
#endif

QUrl source() const;
QUrl maskSource() const;
Expand Down
5 changes: 5 additions & 0 deletions src/mywidgets/mysvgview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
#include <QQuickWindow>
#include <QDebug>

#if(QT_VERSION>=0x050000)
MySvgView::MySvgView(QQuickItem *parent) :
QQuickPaintedItem(parent)
#else
MySvgView::MySvgView(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
#endif
{
m_defaultSize = QSize(0,0);
svg = new QSvgRenderer(this);
Expand Down
15 changes: 14 additions & 1 deletion src/mywidgets/mysvgview.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#ifndef MYSVGVIEW_H
#define MYSVGVIEW_H

#include <QQuickPaintedItem>
#include <QSvgRenderer>

#if(QT_VERSION>=0x050000)
#include <QQuickPaintedItem>
#else
#include <QDeclarativeItem>
#endif

#if(QT_VERSION>=0x050000)
class MySvgView : public QQuickPaintedItem
#else
class MySvgView : public QDeclarativeItem
#endif
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Expand All @@ -15,7 +24,11 @@ class MySvgView : public QQuickPaintedItem

void setDefaultSize( QSize arg );
public:
#if(QT_VERSION>=0x050000)
explicit MySvgView(QQuickItem *parent = 0);
#else
explicit MySvgView(QDeclarativeItem *parent = 0);
#endif
QUrl source() const;
QSize defaultSize() const;

Expand Down
2 changes: 1 addition & 1 deletion src/utility/downloadimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ void DownloadImage::getImage(QObject *caller, QByteArray slotName, QUrl url, QSt
queue_data<<data;
httpRequest->get (this, SLOT(downloadFinished(QNetworkReply*)), url);//去获取
}else{
qDebug()<<"DownloadImage:"<<slotName<<"不是一个规范的函数,所以不可能是一个槽";
qDebug()<<"DownloadImage:"<<slotName<<"不是槽函数";
}
}

0 comments on commit 0e540a3

Please sign in to comment.