oberschlingel hat geschrieben:Hallo,
Ich verwende Qt 4.1.1
Hatte auch komische dinge mit 4.1.1... window besonder mit sqlite und qlocale....
als ich 4.1.2 gebuildet habe ist es viel besser....
hingegen auf meinen mac lauft alles einfach alles rund mit qt ... egal !version...
probier mal die kolonne zu zaehlen ....
oder ein dump export...
Code: Alles auswählen
void Gui_Starter::TablesDump(QString t,QString file)
{
QString tablequery ="SELECT * FROM "+t;
QString line;
QString rowone;
QSqlQuery query;
query.exec(tablequery);
QSqlRecord rec = query.record(); /* nummer col */
int numcol = rec.count();
int loop;
while (query.next()) {
line="";
for(loop=0; loop < numcol; loop++) {
rowone = query.value(loop).toString();
rowone.replace(QString("'"), QString("\'"));
if (!is_numeric(rowone)){
rowone = QString( "'%1'" ).arg( rowone );
}
if (loop !=numcol-1) {
line = line+QString( "%1," ).arg( rowone );
} else {
line = line+rowone;
}
rowone="";
}
line.prepend("INSERT INTO "+t+" VALUES (");
line.append(");");
file_put_contents_append(file,line);
}
}
alles linken....
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QSqlRelationalTableModel>
#include <QSqlRelationalDelegate>
#include <QHeaderView>
#include <QSqlRecord>
QT += sql ... im pro