开发者

Databases and Qt

I am building an application in Qt/QML. I have a table view of the database (PostgreSQL). Is there a way to dynamically refresh my table if there is any change in the database.

One no-so-efficient way to do it is to keep sending periodic SQL queries.

Is there any automatic way to keep my view refreshed? I am open to use any o开发者_开发知识库ther Database also if required.


Qt seems to support the NOTIFY mechanism of PostgreSQL databases. Googling for it it found some bug reports, so not sure of well implemented that is. Since I've never used it, I'll have to refer you to google.


If you use QSqlTableModel (or an editable subclass of QSqlQueryModel) with QTableView, any edits made will immediately be visible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜