Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef QXT_FLOWVIEW_H
00051 #define QXT_FLOWVIEW_H
00052
00053 #include <QWidget>
00054 #include <QAbstractItemModel>
00055 #include "qxtglobal.h"
00056
00057
00058 class QxtFlowViewPrivate;
00059 class QXT_GUI_EXPORT QxtFlowView : public QWidget
00060 {
00061 Q_OBJECT
00062
00063 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
00064 Q_PROPERTY(QSize slideSize READ slideSize WRITE setSlideSize)
00065 Q_PROPERTY(QModelIndex currentIndex READ currentIndex WRITE setCurrentIndex)
00066 Q_PROPERTY(int pictureRole READ pictureRole WRITE setPictureRole)
00067 Q_PROPERTY(int pictureColumn READ pictureColumn WRITE setPictureColumn)
00068 Q_PROPERTY(QModelIndex rootIndex READ rootIndex WRITE setRootIndex)
00069
00070 #if 0
00071 Q_PROPERTY(int textRole READ textRole WRITE setTextRole)
00072 Q_PROPERTY(int textColumn READ textColumn WRITE setTextColumn)
00073 #endif
00074
00075
00076 public:
00077
00078 enum ReflectionEffect
00079 {
00080 NoReflection,
00081 PlainReflection,
00082 BlurredReflection
00083 };
00084
00086 QxtFlowView(QWidget* parent = 0);
00087
00089 ~QxtFlowView();
00090
00096 void setModel(QAbstractItemModel * model);
00097
00099 QAbstractItemModel * model();
00100
00102 QColor backgroundColor() const;
00103
00105 void setBackgroundColor(const QColor& c);
00106
00108 QSize slideSize() const;
00109
00111 void setSlideSize(QSize size);
00112
00114 QModelIndex currentIndex() const;
00115
00116
00118 QModelIndex rootIndex() const;
00119
00120
00122 void setRootIndex(QModelIndex index);
00123
00124
00126 ReflectionEffect reflectionEffect() const;
00127
00129 void setReflectionEffect(ReflectionEffect effect);
00130
00131
00133 int pictureRole();
00135 void setPictureRole(int);
00136
00138 int pictureColumn();
00140 void setPictureColumn(int);
00141
00142 #if 0
00143 int textRole();
00144 void setTextRole(int);
00145 int textColumn();
00146 void setTextColumn(int);
00147 #endif
00148
00149 public Q_SLOTS:
00150
00153 void setCurrentIndex(QModelIndex index);
00154
00156 void showPrevious();
00157
00159 void showNext();
00160
00162 void showSlide(QModelIndex index);
00163
00165 void render();
00166
00168 void triggerRender();
00169
00170 Q_SIGNALS:
00171 void currentIndexChanged(QModelIndex index);
00172
00173 protected:
00174 virtual void paintEvent(QPaintEvent *event);
00175 virtual void keyPressEvent(QKeyEvent* event);
00176 virtual void mousePressEvent(QMouseEvent* event);
00177 virtual void mouseMoveEvent(QMouseEvent * event);
00178 virtual void mouseReleaseEvent(QMouseEvent* event);
00179 virtual void resizeEvent(QResizeEvent* event);
00180 virtual void wheelEvent(QWheelEvent * event);
00181 private Q_SLOTS:
00182 void updateAnimation();
00183
00184 private:
00185 QxtFlowViewPrivate* d;
00186 };
00187
00188 #endif // PICTUREFLOW_H
00189