FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlitebrowser/src/sqlitetablemodel.h at sqlb-3.2.x · sqlitebrowser/sqlitebrowser · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
sqlitebrowser
/
sqlitebrowser
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2.4k
Star
24.5k
Code
Issues
825
Pull requests
17
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlitebrowser
/
src
/
sqlitetablemodel.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (60 loc) · 2.47 KB
Breadcrumbs
sqlitebrowser
/
src
/
sqlitetablemodel.h
Copy path
File metadata and controls
79 lines (60 loc) · 2.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
ifndef
SQLITETABLEMODEL_H
#
define
SQLITETABLEMODEL_H
#
include
<
QAbstractTableModel
>
#
include
<
QStringList
>
class
DBBrowserDB
;
class
SqliteTableModel
:
public
QAbstractTableModel
{
Q_OBJECT
public:
explicit
SqliteTableModel
(QObject *parent =
0
, DBBrowserDB* db =
0
,
size_t
chunkSize =
50000
);
void
reset
();
int
rowCount
(
const
QModelIndex &parent = QModelIndex())
const
;
int
totalRowCount
()
const
;
int
columnCount
(
const
QModelIndex &parent = QModelIndex())
const
;
QVariant
headerData
(
int
section, Qt::Orientation orientation,
int
role = Qt::DisplayRole)
const
;
QVariant
data
(
const
QModelIndex &index,
int
role = Qt::DisplayRole)
const
;
bool
setData
(
const
QModelIndex& index,
const
QVariant& value,
int
role = Qt::EditRole);
bool
canFetchMore
(
const
QModelIndex &parent = QModelIndex())
const
;
void
fetchMore
(
const
QModelIndex &parent = QModelIndex());
size_t
queryMore
(
size_t
offset);
bool
insertRows
(
int
row,
int
count,
const
QModelIndex& parent = QModelIndex());
bool
removeRows
(
int
row,
int
count,
const
QModelIndex& parent = QModelIndex());
void
setQuery
(
const
QString&
sQuery
,
bool
dontClearHeaders =
false
);
QString
query
()
const
{
return
m_sQuery; }
void
setTable
(
const
QString& table);
void
setChunkSize
(
size_t
chunksize);
void
sort
(
int
column, Qt::SortOrder order = Qt::AscendingOrder);
Qt::ItemFlags
flags
(
const
QModelIndex& index)
const
;
bool
valid
()
const
{
return
m_valid; }
bool
isBinary
(
const
QModelIndex& index)
const
;
typedef
QList<QByteArray> QByteArrayList;
signals:
public slots:
void
updateFilter
(
int
column,
const
QString& value);
private:
void
fetchData
(
unsigned
int
from,
unsigned
to);
void
clearCache
();
void
buildQuery
();
int
getQueryRowCount
();
DBBrowserDB* m_db;
int
m_rowCount;
QStringList m_headers;
QList<QByteArrayList> m_data;
QString m_sQuery;
QString m_sTable;
int
m_iSortColumn;
QString m_sSortOrder;
QMap<
int
, QString> m_mWhere;
/*
*
* @brief m_chunkSize Size of the next chunk fetch more will try to fetch.
* This value should be rather high, because our query
* uses LIMIT and sqlite3 will still execute the whole query and
* just skip the not wanted rows, but the execution will
* still take nearly the same time as doing the query at all up
* to that row count.
*/
size_t
m_chunkSize;
bool
m_valid;
//
! tells if the current query is valid.
};
#
endif
//
SQLITETABLEMODEL_H
Back
|
FazBrowse Home
|
New Git URL