Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tcsortpaginationtableview.h
浏览该文件的文档.
1 // **************************************************************************
2 // Tianchi C++ library for Qt (open source)
3 // 天池共享源码库
4 // 版权所有 (C) 天池共享源码库开发组
5 // 授权协议:请阅读天池共享源码库附带的授权协议
6 // **************************************************************************
7 // 文档说明:可排序和分页的TableView
8 // ==========================================================================
9 // 开发日志:
10 // 日期 人员 说明
11 // --------------------------------------------------------------------------
12 // 2013.06.07 XChinux 建立
13 // ==========================================================================
15 // ==========================================================================
16 #ifndef TIANCHI_TCSORTPAGINATIONTABLEVIEW_H
17 #define TIANCHI_TCSORTPAGINATIONTABLEVIEW_H
18 
19 #include <tianchi/tcglobal.h>
20 #include <QTableView>
21 
22 class QLabel;
23 
24 class TcSortPaginationTableViewPrivate;
25 
108 class TIANCHI_API TcSortPaginationTableView : public QTableView
109 {
110  Q_OBJECT
111 public:
112  TcSortPaginationTableView(QWidget *parent = 0);
113  virtual ~TcSortPaginationTableView();
114 
116  int pageRowCount() const;
118  int page() const;
120  int sortSection() const;
122  Qt::SortOrder sortOrder() const;
123 
125  void setPageRowCount(int pageRowCount = -1);
126 
130  void setPageInfo(int page, int totalCount);
131 
133  void setPaginator(QLabel *label);
134 
136  void createTitleMenus();
137 Q_SIGNALS:
139  void fetchDataRequested();
140 public Q_SLOTS:
145  void fetchData(int page = -1, int section = -1,
146  Qt::SortOrder order = Qt::AscendingOrder);
147 private:
148  Q_DISABLE_COPY(TcSortPaginationTableView)
149  Q_DECLARE_PRIVATE(TcSortPaginationTableView)
150  Q_PRIVATE_SLOT(d_func(), void _q_sortIndicatorChanged(int, Qt::SortOrder))
151  Q_PRIVATE_SLOT(d_func(), void _q_paginatorClicked(const QString &))
152  Q_PRIVATE_SLOT(d_func(), void _q_onColumnShown(bool checked))
153  TcSortPaginationTableViewPrivate* const d_ptr;
154 };
155 
156 #endif // TIANCHI_TCSORTPAGETABLEVIEW_H