摘要: Approaches to Binding ValuesBelow we present the same example using each of the four different binding approaches, as well as one example of binding values to a stored procedure.Named binding using named placeholders: QSqlQuery query; query.prepare("INSERT INTO person (id, forename, surname) &q 阅读全文
posted @ 2013-01-24 09:57 wiessharling 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: 使用自定义的信号和槽,需要注意以下几点:1、类的声明和实现分别放在.h和.cpp文件中;2、类声明中包含Q_OBJECT宏;3、信号只要声明不要设计其的实现函数;4、发射信号用emit关键字;5、自定义槽的实现与普通成员函数的实现一样。当程序中所使用的类中具有用户自定义的槽和信号时,你需要使用moc(元对象编译器)对程序进行编译。编译方法一:你可以将moc文件编译为目标文件,之后把它与ClassDefinion.cpp和main.cpp一起链接,下面具体的操作步骤:#moc ClassDeclaration.h -o ClassDeclaration.cpp#g++ -c ClassDecla 阅读全文
posted @ 2013-01-24 09:49 wiessharling 阅读(2381) 评论(0) 推荐(0) 编辑