首页| 论坛| 消息

标题:ScimInputContextPlugin()问题
作者:kenvi
日期:2006-04-11 23:44
内容:

我用QT做了一个很简单的东西,编译成功了,但是在我使用这个东西的时候就出现:
# ./lib
ScimInputContextPlugin()
段错误
#
有没有人告诉我怎样解决这个问题阿??


#1 [kenvi 04-12 10:42]
这个是在FC5下的,出现了什么问题阿,有没有有人回答阿??
我很需要这个问题的正确的答案阿
#2 [kenvi 04-13 10:48]
#include
#include
#include "../lib/connection.h"
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
if(!createConnections())
return 1;
QSqlQuery query;
//query.exec("CREATE DATABASE library;");
query.exec("DROP TABLE book;");
query.exec("DROP TABLE loanbook;");
query.exec("DROP TABLE reader;");
query.exec("DROP TABLE subject;");
query.exec("DROP TABLE sysmange;");
query.exec("CREATE TABLE book("
"bISBN VARCHAR(10) NOT NULL,"
"sorted VARCHAR(30) NOT NULL,"
"code VARCHAR(10) NOT NULL)");
query.exec("CREATE TABLE loanbook("
"lbnum VARCHAR(10) NOT NULL,"
"lbnam VARCHAR(40) NOT NULL,"
"loandat VARCHAR(50) NOT NULL,"
"lrtndate VARCHAR(50) NOT NULL,"
"lcount INTEGER,"
"lbrwcount INTEGER)");
query.exec("CREATE TABLE sysmange("
"snum VARCHAR(10) NOT NULL,"
"snam VARCHAR(40) NOT NULL,"
"popedom VARCHAR(2) NOT NULL,"
"pwd VARCHAR(10) NOT NULL)");
query.exec("CREATE TABLE subject("
"sISBN INTEGER NOT NULL,"
"sbnum VARCHAR(10) NOT NULL,&quot ..
#3 [ywchen2000 04-13 11:13]
看上面的代码好像没有问题
#4 [kenvi 04-13 11:20]
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#include "readerform.h"
#include "bookform.h"
#include "mainform.h"
MainForm::MainForm(QWidget *parent, const char *name)
: QDialog(parent, name)
{
setCaption(tr("LibSYS"));
splitter = new QSplitter(Vertical, this);
QSqlSelectCursor *readerCursor = new QSqlSelectCursor(
"SELECT DISTINCT rnum, rbnum, rnam, sex, age, rbrwcount, bckcount "
"FROM reader, loanbook "
"WHERE reader.rbnum = loanbook.lbnum");
if (!readerCursor->isActive()) {
QMessageBox::critical(this, tr("libSYS"),
tr("The database has not been created.\n"
"Run the libtable example to create a sample\n "
"database, then copy library into\n "
"this directory and restart this application."));
qApp->quit();
}
readerTable = new QDataTable(readerCursor, false, splitter);
readerTable->addColumn("rnum", tr("Number"));
readerTable->addColumn("rbnum",tr("Book_name"));
readerTable->addColumn("rnam", tr("Name"));
readerTable->addColumn("rbrwcount", tr("Borrowed_count"));
readerTable->addColumn("bckcount",tr("Returing_count"));
readerTable ..
#5 [kenvi 04-13 11:21]
第一次贴的代码是建立数据库的
是没问题啊
但是在主界面使用按钮的时候,就出问了
主界面的代码是上面的代码

<< 1 2 >> (1/2)

回复 发表
主题 版块