src/declarative/graphicsitems/qdeclarativegridview_p.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    41 
    41 
    42 #ifndef QDECLARATIVEGRIDVIEW_H
    42 #ifndef QDECLARATIVEGRIDVIEW_H
    43 #define QDECLARATIVEGRIDVIEW_H
    43 #define QDECLARATIVEGRIDVIEW_H
    44 
    44 
    45 #include "private/qdeclarativeflickable_p.h"
    45 #include "private/qdeclarativeflickable_p.h"
       
    46 #include "private/qdeclarativeguard_p.h"
    46 
    47 
    47 QT_BEGIN_HEADER
    48 QT_BEGIN_HEADER
    48 
    49 
    49 QT_BEGIN_NAMESPACE
    50 QT_BEGIN_NAMESPACE
    50 
    51 
   218 public:
   219 public:
   219     QDeclarativeGridViewAttached(QObject *parent)
   220     QDeclarativeGridViewAttached(QObject *parent)
   220         : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
   221         : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
   221     ~QDeclarativeGridViewAttached() {}
   222     ~QDeclarativeGridViewAttached() {}
   222 
   223 
   223     Q_PROPERTY(QDeclarativeGridView *view READ view CONSTANT)
   224     Q_PROPERTY(QDeclarativeGridView *view READ view NOTIFY viewChanged)
   224     QDeclarativeGridView *view() { return m_view; }
   225     QDeclarativeGridView *view() { return m_view; }
       
   226     void setView(QDeclarativeGridView *view) {
       
   227         if (view != m_view) {
       
   228             m_view = view;
       
   229             emit viewChanged();
       
   230         }
       
   231     }
   225 
   232 
   226     Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
   233     Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
   227     bool isCurrentItem() const { return m_isCurrent; }
   234     bool isCurrentItem() const { return m_isCurrent; }
   228     void setIsCurrentItem(bool c) {
   235     void setIsCurrentItem(bool c) {
   229         if (m_isCurrent != c) {
   236         if (m_isCurrent != c) {
   247 Q_SIGNALS:
   254 Q_SIGNALS:
   248     void currentItemChanged();
   255     void currentItemChanged();
   249     void delayRemoveChanged();
   256     void delayRemoveChanged();
   250     void add();
   257     void add();
   251     void remove();
   258     void remove();
       
   259     void viewChanged();
   252 
   260 
   253 public:
   261 public:
   254     QDeclarativeGridView *m_view;
   262     QDeclarativeGuard<QDeclarativeGridView> m_view;
   255     bool m_isCurrent : 1;
   263     bool m_isCurrent : 1;
   256     bool m_delayRemove : 1;
   264     bool m_delayRemove : 1;
   257 };
   265 };
   258 
   266 
   259 
   267