看板 C_and_CPP 關於我們 聯絡資訊
請問我使用 QT 的 Model/View Architecutre 時,我透過 QSqlQueryModel 向 database 查詢資料,使用 QTableView 來設定此 model,我知道 QT 的 model 裡面不會存放所有我查詢的資料(如果我查詢的資料太大的話), 只有當我在 QTableView 裡將 scroll bar 往下拉時,model 才會去向 database 要資料。 我想請問的是,是否有函數可以設定說,當此 model 查詢資料時,就會 回傳所有的資料在 model 裡面呢?因為我現在要將資料列印出來時, 只會列印目前 model 裡面的資料,我目前要將 QTableView 的 scroll bar 拉到最下面時,列印的資料才會完全。 麻煩大大了,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.104.50.15
Xphenomenon:查了一下 QT Assistant,可以使用 canFetchMore() 及 03/02 18:17
Xphenomenon:fetchMore() 完成。 03/02 18:17