Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

SqlEsimerkki

Projektitiedosto tietokantaesimerkille

Code Block
TEMPLATE = app
QT += sql
HEADERS = scooterwindow.h \
        tietokanta.h
SOURCES = main.cpp \
    scooterwindow.cpp \
    tietokanta.cpp

Pääohjelma

Code Block

#include <QtGui>
#include <QtSql>
#include "tietokanta.h"
#include "scooterwindow.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    Tietokanta db;
    if (!db.LuoLiityntaTietokantaan()) return 1;
    db.LuoTietokantaTaulu(0);
    db.TaytaDemoDataa();
    ScooterWindow window;
    window.resize(800, 600);
    window.show();
    return app.exec();
}

...