C++ Qt 和 Sqlite 示例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1429782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 19:56:48  来源:igfitidea点击:

Qt and Sqlite examples

c++qtsqlite

提问by Saulius ?emaitaitis

I am looking for some example code using Qt and it's SQL module with Sqlite driver. Main reason I need examples for is that I've prior experience with Qt's database interface and Sqlite has some weird behavior with field types (types are stored per-field, not per-column).

我正在寻找一些使用 Qt 的示例代码,它是带有 Sqlite 驱动程序的 SQL 模块。我需要示例的主要原因是我之前有使用 Qt 数据库接口的经验,而 Sqlite 对字段类型有一些奇怪的行为(类型按字段存储,而不是按列存储)。

回答by Dirk Eddelbuettel

The Qt 5 SQL examplesuse SQLite as this does not require a database server. You should be able to go from the supplied examples to your own sample code pretty quickly.

Qt的5 SQL实例使用SQLite,因为这并不需要一个数据库服务器。您应该能够很快地从提供的示例转到您自己的示例代码。