diff options
Diffstat (limited to 'tqtinterface/qt4/tools/designer/examples/book')
43 files changed, 0 insertions, 3254 deletions
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book.sql b/tqtinterface/qt4/tools/designer/examples/book/book.sql deleted file mode 100644 index a92daac..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book.sql +++ /dev/null @@ -1,42 +0,0 @@ --- The following SQL generates the database --- used by the 'book' example programs ---** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. --- --- This file is part of an example program for Qt. This example --- program may be used, distributed and modified without limitation. - -DROP TABLE author; -DROP TABLE book; -DROP TABLE sequence; - -CREATE TABLE author -( id integer primary key, -forename varchar(40), -surname varchar(40) ); - -CREATE TABLE book -( id integer primary key, -title varchar(40), -price numeric(10,2), -authorid integer, -notes varchar(255) ); - -create index book_authorid_idx on book( authorid ); - -CREATE TABLE sequence -( tablename varchar(10), -sequence numeric); - -INSERT INTO author VALUES ( 0, 'Philip K', 'Dick' ); -INSERT INTO author VALUES ( 1, 'Robert', 'Heinlein' ); -INSERT INTO author VALUES ( 2, 'Sarah', 'Paretsky' ); - -INSERT INTO book VALUES ( 0, 'The Man Who Japed', 6.99, 0, 'A good book' ); -INSERT INTO book VALUES ( 1, 'The Man in the High Castle', 9.99, 0, 'Worth reading' ); -INSERT INTO book VALUES ( 2, 'The Number of the Beast', 8.99, 1, 'Get this!' ); -INSERT INTO book VALUES ( 3, 'Indemnity Only', 9.99, 2, 'Cool' ); -INSERT INTO book VALUES ( 4, 'Burn Marks', 9.99, 2, 'Need to make notes' ); -INSERT INTO book VALUES ( 5, 'Deadlock', 9.99, 2, 'Hmmm..' ); - -INSERT INTO sequence VALUES ( 'author', 2 ); -INSERT INTO sequence VALUES ( 'book', 5 ); diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui deleted file mode 100644 index 40fac0e..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui +++ /dev/null @@ -1,71 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>584</width> - <height>472</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorcDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - </vbox> -</widget> -<connections> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h deleted file mode 100644 index d727860..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h +++ /dev/null @@ -1,5 +0,0 @@ -void BookForm::primeInsertAuthor( TQSqlRecord * ) -{ - -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro b/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro deleted file mode 100644 index a7e1f7b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui deleted file mode 100644 index 1e91d13..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui +++ /dev/null @@ -1,77 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>576</width> - <height>468</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorcDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>AuthorcDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h deleted file mode 100644 index 3295581..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h +++ /dev/null @@ -1,10 +0,0 @@ -void BookForm::primeInsertAuthor( TQSqlRecord * buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro b/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro deleted file mode 100644 index a7e1f7b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui deleted file mode 100644 index ece1235..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui +++ /dev/null @@ -1,141 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>566</width> - <height>464</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h deleted file mode 100644 index 707ee90..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h +++ /dev/null @@ -1,16 +0,0 @@ -void BookForm::newCurrentAuthor( TQSqlRecord *author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord *buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro b/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro deleted file mode 100644 index a7e1f7b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp deleted file mode 100644 index 1e0f042..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui deleted file mode 100644 index d39d271..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui +++ /dev/null @@ -1,179 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>546</width> - <height>532</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - <widget class="TQLayoutWidget"> - <property name="name"> - <cstring>Layout2</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>EditPushButton</cstring> - </property> - <property name="text"> - <string>&Edit Books</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>QuitPushButton</cstring> - </property> - <property name="text"> - <string>&Quit</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>QuitPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>accept()</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h deleted file mode 100644 index 730cafe..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h +++ /dev/null @@ -1,16 +0,0 @@ -void BookForm::newCurrentAuthor( TQSqlRecord * author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord * buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro b/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro deleted file mode 100644 index a7e1f7b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp deleted file mode 100644 index f611d3d..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} - - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui deleted file mode 100644 index 399e7fd..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui +++ /dev/null @@ -1,188 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="local" impldecl="in declaration">qdatabrowser.h</include> -<include location="local" impldecl="in declaration">editbook.h</include> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>530</width> - <height>524</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - <widget class="TQLayoutWidget"> - <property name="name"> - <cstring>Layout5</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>EditPushButton</cstring> - </property> - <property name="text"> - <string>&Edit Books</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>QuitPushButton</cstring> - </property> - <property name="text"> - <string>&Quit</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>QuitPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>EditPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>editClicked()</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h deleted file mode 100644 index c41fa17..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h +++ /dev/null @@ -1,23 +0,0 @@ -void BookForm::editClicked() -{ - EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE ); - dialog->exec(); - delete dialog; -} - -void BookForm::newCurrentAuthor( TQSqlRecord *author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord *buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro b/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro deleted file mode 100644 index 030db5f..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui editbook.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui deleted file mode 100644 index 70a6df0..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui +++ /dev/null @@ -1,291 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>EditBookForm</class> -<widget class="TQDialog"> - <property name="name"> - <cstring>EditBookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>568</width> - <height>301</height> - </rect> - </property> - <property name="caption"> - <string>Edit Books</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataBrowser"> - <property name="name"> - <cstring>BookDataBrowser</cstring> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - <property name="frameworkCode" stdset="0"> - <bool>false</bool> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLayoutWidget" row="0" column="0"> - <property name="name"> - <cstring>Layout2</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel" row="1" column="0"> - <property name="name"> - <cstring>labelPrice</cstring> - </property> - <property name="text"> - <string>Price</string> - </property> - </widget> - <widget class="TQLabel" row="0" column="0"> - <property name="name"> - <cstring>labelTitle</cstring> - </property> - <property name="text"> - <string>Title</string> - </property> - </widget> - <widget class="TQLineEdit" row="0" column="1"> - <property name="name"> - <cstring>QLineEditTitle</cstring> - </property> - <property name="text"> - <string></string> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>title</string> - </stringlist> - </property> - </widget> - <widget class="TQLineEdit" row="1" column="1"> - <property name="name"> - <cstring>QLineEditPrice</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>price</string> - </stringlist> - </property> - </widget> - </grid> - </widget> - <widget class="TQLayoutWidget" row="1" column="0"> - <property name="name"> - <cstring>Layout3</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonFirst</cstring> - </property> - <property name="text"> - <string>|< &First</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonPrev</cstring> - </property> - <property name="text"> - <string><< &Prev</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonNext</cstring> - </property> - <property name="text"> - <string>&Next >></string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonLast</cstring> - </property> - <property name="text"> - <string>&Last >|</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="2" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonInsert</cstring> - </property> - <property name="text"> - <string>&Insert</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonUpdate</cstring> - </property> - <property name="text"> - <string>&Update</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonDelete</cstring> - </property> - <property name="text"> - <string>&Delete</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonClose</cstring> - </property> - <property name="text"> - <string>&Close</string> - </property> - </widget> - </hbox> - </widget> - </grid> - </widget> - </vbox> -</widget> -<connections> - <connection> - <sender>PushButtonFirst</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>first()</slot> - </connection> - <connection> - <sender>BookDataBrowser</sender> - <signal>firstRecordAvailable( bool )</signal> - <receiver>PushButtonFirst</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>PushButtonPrev</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>prev()</slot> - </connection> - <connection> - <sender>BookDataBrowser</sender> - <signal>prevRecordAvailable( bool )</signal> - <receiver>PushButtonPrev</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>PushButtonNext</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>next()</slot> - </connection> - <connection> - <sender>BookDataBrowser</sender> - <signal>nextRecordAvailable( bool )</signal> - <receiver>PushButtonNext</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>PushButtonLast</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>last()</slot> - </connection> - <connection> - <sender>BookDataBrowser</sender> - <signal>lastRecordAvailable( bool )</signal> - <receiver>PushButtonLast</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>PushButtonInsert</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>insert()</slot> - </connection> - <connection> - <sender>PushButtonUpdate</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>update()</slot> - </connection> - <connection> - <sender>PushButtonDelete</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>del()</slot> - </connection> -</connections> -<includes> - <include location="local" impldecl="in implementation">editbook.ui.h</include> -</includes> -<Q_SLOTS> - <slot>init()</slot> - <slot>destroy()</slot> -</Q_SLOTS> -<layoutdefaults spacing="6" margin="11"/> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h deleted file mode 100644 index 4a8a636..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h +++ /dev/null @@ -1,10 +0,0 @@ -void EditBookForm::init() -{ - -} - -void EditBookForm::destroy() -{ - -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui deleted file mode 100644 index 9fc5992..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui +++ /dev/null @@ -1,189 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" impldecl="in declaration">editbook.h</include> -<include location="global" impldecl="in declaration">qdatabrowser.h</include> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>494</width> - <height>506</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - <widget class="TQLayoutWidget"> - <property name="name"> - <cstring>Layout5</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>EditPushButton</cstring> - </property> - <property name="text"> - <string>&Edit Books</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>QuitPushButton</cstring> - </property> - <property name="text"> - <string>&Quit</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>QuitPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>EditPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>editClicked()</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h deleted file mode 100644 index fe0b39d..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h +++ /dev/null @@ -1,33 +0,0 @@ -void BookForm::editClicked() -{ - EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE ); - TQSqlCursor cur( "book" ); - dialog->BookDataBrowser->setSqlCursor( &cur ); - dialog->BookDataBrowser->setFilter( BookDataTable->filter() ); - dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList( - BookDataTable->sort(), &cur ) ); - dialog->BookDataBrowser->refresh(); - int i = BookDataTable->currentRow(); - if ( i == -1 ) i = 0; // Always use the first row - dialog->BookDataBrowser->seek( i ); - dialog->exec(); - delete dialog; - BookDataTable->refresh(); -} - -void BookForm::newCurrentAuthor( TQSqlRecord * author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord * buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro b/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro deleted file mode 100644 index 030db5f..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui editbook.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui deleted file mode 100644 index abbab27..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui +++ /dev/null @@ -1,300 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>EditBookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" implDecl="in declaration">editbook.ui.h</include> -<forward>class QSqlRecord;</forward> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>EditBookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>536</width> - <height>285</height> - </rect> - </property> - <property name="caption"> - <string>Edit Books</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataBrowser"> - <property name="name"> - <cstring>BookDataBrowser</cstring> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - <property name="frameworkCode" stdset="0"> - <bool>false</bool> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLayoutWidget" row="0" column="0"> - <property name="name"> - <cstring>Layout2</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel" row="1" column="0"> - <property name="name"> - <cstring>labelPrice</cstring> - </property> - <property name="text"> - <string>Price</string> - </property> - </widget> - <widget class="TQLabel" row="0" column="0"> - <property name="name"> - <cstring>labelTitle</cstring> - </property> - <property name="text"> - <string>Title</string> - </property> - </widget> - <widget class="TQLineEdit" row="0" column="1"> - <property name="name"> - <cstring>QLineEditTitle</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>title</string> - </stringlist> - </property> - </widget> - <widget class="TQLineEdit" row="1" column="1"> - <property name="name"> - <cstring>QLineEditPrice</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>price</string> - </stringlist> - </property> - </widget> - </grid> - </widget> - <widget class="TQLayoutWidget" row="1" column="0"> - <property name="name"> - <cstring>Layout3</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonFirst</cstring> - </property> - <property name="text"> - <string>|< &First</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonPrev</cstring> - </property> - <property name="text"> - <string><< &Prev</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonNext</cstring> - </property> - <property name="text"> - <string>&Next >></string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonLast</cstring> - </property> - <property name="text"> - <string>&Last >|</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="2" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonInsert</cstring> - </property> - <property name="text"> - <string>&Insert</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonUpdate</cstring> - </property> - <property name="text"> - <string>&Update</string> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonDelete</cstring> - </property> - <property name="text"> - <string>&Delete</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonClose</cstring> - </property> - <property name="text"> - <string>&Close</string> - </property> - </widget> - </hbox> - </widget> - </grid> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>PushButtonFirst</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>first()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>firstRecordAvailable( bool )</signal> - <receiver>PushButtonFirst</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonPrev</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>prev()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>prevRecordAvailable( bool )</signal> - <receiver>PushButtonPrev</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonNext</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>next()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>nextRecordAvailable( bool )</signal> - <receiver>PushButtonNext</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonLast</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>last()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>lastRecordAvailable( bool )</signal> - <receiver>PushButtonLast</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonInsert</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>insert()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonUpdate</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>update()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonDelete</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>del()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeInsertBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonClose</sender> - <signal>clicked()</signal> - <receiver>EditBookForm</receiver> - <slot>accept()</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h deleted file mode 100644 index 28d5035..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h +++ /dev/null @@ -1,10 +0,0 @@ -void EditBookForm::primeInsertBook( TQSqlRecord * buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='book';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui deleted file mode 100644 index cc6f1d8..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui +++ /dev/null @@ -1,189 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" impldecl="in declaration">editbook.h</include> -<include location="global" impldecl="in declaration">qdatabrowser.h</include> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>490</width> - <height>504</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - <widget class="TQLayoutWidget"> - <property name="name"> - <cstring>Layout5</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>EditPushButton</cstring> - </property> - <property name="text"> - <string>&Edit Books</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>QuitPushButton</cstring> - </property> - <property name="text"> - <string>&Quit</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>QuitPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>EditPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>editClicked()</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h deleted file mode 100644 index 1cb2f0b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h +++ /dev/null @@ -1,33 +0,0 @@ -void BookForm::editClicked() -{ - EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE ); - TQSqlCursor cur( "book" ); - dialog->BookDataBrowser->setSqlCursor( &cur ); - dialog->BookDataBrowser->setFilter( BookDataTable->filter() ); - dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList( - BookDataTable->sort(), &cur ) ); - dialog->BookDataBrowser->refresh(); - int i = BookDataTable->currentRow(); - if ( i == -1 ) i = 0; // Always use the first row - dialog->BookDataBrowser->seek( i ); - dialog->exec(); - delete dialog; - BookDataTable->refresh(); -} - -void BookForm::newCurrentAuthor( TQSqlRecord *author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord *buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro b/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro deleted file mode 100644 index 22c7e9b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -CONFIG += qt warn_on release -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui editbook.ui -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui deleted file mode 100644 index c8bf0bf..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui +++ /dev/null @@ -1,384 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>EditBookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" implDecl="in declaration">editbook.ui.h</include> -<forward>class QSqlRecord;</forward> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>EditBookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>528</width> - <height>305</height> - </rect> - </property> - <property name="caption"> - <string>Edit Books</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataBrowser"> - <property name="name"> - <cstring>BookDataBrowser</cstring> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - <property name="frameworkCode" stdset="0"> - <bool>true</bool> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLayoutWidget" row="0" column="0"> - <property name="name"> - <cstring>Layout2</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel" row="1" column="0"> - <property name="name"> - <cstring>labelPrice</cstring> - </property> - <property name="text"> - <string>Price</string> - </property> - </widget> - <widget class="TQLabel" row="0" column="0"> - <property name="name"> - <cstring>labelTitle</cstring> - </property> - <property name="text"> - <string>Title</string> - </property> - </widget> - <widget class="TQLineEdit" row="0" column="1"> - <property name="name"> - <cstring>QLineEditTitle</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>title</string> - </stringlist> - </property> - </widget> - <widget class="TQLineEdit" row="1" column="1"> - <property name="name"> - <cstring>QLineEditPrice</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>price</string> - </stringlist> - </property> - </widget> - </grid> - </widget> - <widget class="TQLayoutWidget" row="3" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonInsert</cstring> - </property> - <property name="text"> - <string>&Insert</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonUpdate</cstring> - </property> - <property name="text"> - <string>&Update</string> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonDelete</cstring> - </property> - <property name="text"> - <string>&Delete</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonClose</cstring> - </property> - <property name="text"> - <string>&Close</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="2" column="0"> - <property name="name"> - <cstring>Layout3</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonFirst</cstring> - </property> - <property name="text"> - <string>|< &First</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonPrev</cstring> - </property> - <property name="text"> - <string><< &Prev</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonNext</cstring> - </property> - <property name="text"> - <string>&Next >></string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonLast</cstring> - </property> - <property name="text"> - <string>&Last >|</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="1" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel"> - <property name="name"> - <cstring>TextLabel1</cstring> - </property> - <property name="text"> - <string>Author</string> - </property> - </widget> - <widget class="TQComboBox"> - <property name="name"> - <cstring>ComboBoxAuthor</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author_view</string> - <string>name</string> - </stringlist> - </property> - </widget> - </hbox> - </widget> - </grid> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>PushButtonFirst</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>first()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>firstRecordAvailable( bool )</signal> - <receiver>PushButtonFirst</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonPrev</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>prev()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>prevRecordAvailable( bool )</signal> - <receiver>PushButtonPrev</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonNext</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>next()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>nextRecordAvailable( bool )</signal> - <receiver>PushButtonNext</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonLast</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>last()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>lastRecordAvailable( bool )</signal> - <receiver>PushButtonLast</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonInsert</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>insert()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonUpdate</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>update()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonDelete</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>del()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonClose</sender> - <signal>clicked()</signal> - <receiver>EditBookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeUpdate(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>beforeUpdate(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>beforeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>beforeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>beforeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeInsertBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeInsertBook(QSqlRecord*)</slot> - </connection> - <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">beforeUpdateBook( QSqlRecord * buffer )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeUpdateBook( QSqlRecord * buffer )</slot> -</connections> -<tabstops> - <tabstop>QLineEditTitle</tabstop> - <tabstop>QLineEditPrice</tabstop> - <tabstop>ComboBoxAuthor</tabstop> - <tabstop>PushButtonFirst</tabstop> - <tabstop>PushButtonPrev</tabstop> - <tabstop>PushButtonNext</tabstop> - <tabstop>PushButtonLast</tabstop> - <tabstop>PushButtonInsert</tabstop> - <tabstop>PushButtonUpdate</tabstop> - <tabstop>PushButtonDelete</tabstop> - <tabstop>PushButtonClose</tabstop> -</tabstops> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h deleted file mode 100644 index 0bedf8b..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h +++ /dev/null @@ -1,42 +0,0 @@ -void EditBookForm::init() -{ - TQSqlQuery query( "SELECT surname FROM author ORDER BY surname;" ); - while ( query.next() ) - ComboBoxAuthor->insertItem( query.value( 0 ).toString()); -} - -void EditBookForm::beforeUpdateBook( TQSqlRecord * buffer ) -{ - TQSqlQuery query( "SELECT id FROM author WHERE surname ='" + - ComboBoxAuthor->currentText() + "';" ); - if ( query.next() ) - buffer->setValue( "authorid", query.value( 0 ) ); -} - -void EditBookForm::primeInsertBook( TQSqlRecord * buffer ) -{ - TQSqlQuery query; - query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" ); - query.exec( "SELECT sequence FROM sequence WHERE tablename='book';" ); - if ( query.next() ) { - buffer->setValue( "id", query.value( 0 ) ); - } -} - -void EditBookForm::primeUpdateBook( TQSqlRecord * buffer ) -{ - // Who is this book's author? - TQSqlQuery query( "SELECT surname FROM author WHERE id='" + - buffer->value( "authorid" ).toString() + "';" ); - TQString author = ""; - if ( query.next() ) - author = query.value( 0 ).toString(); - // Set the ComboBox to the right author - for ( int i = 0; i < ComboBoxAuthor->count(); i++ ) { - if ( ComboBoxAuthor->text( i ) == author ) { - ComboBoxAuthor->setCurrentItem( i ) ; - break; - } - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui deleted file mode 100644 index cc6f1d8..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui +++ /dev/null @@ -1,189 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>BookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" impldecl="in declaration">editbook.h</include> -<include location="global" impldecl="in declaration">qdatabrowser.h</include> -<include location="local" implDecl="in declaration">book.ui.h</include> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>BookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>490</width> - <height>504</height> - </rect> - </property> - <property name="caption"> - <string>Book</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQSplitter"> - <property name="name"> - <cstring>Splitter1</cstring> - </property> - <property name="frameShape"> - <enum>MShape</enum> - </property> - <property name="frameShadow"> - <enum>MShadow</enum> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Surname</string> - </property> - <property name="field"> - <string>surname</string> - </property> - </column> - <column> - <property name="text"> - <string>Forename</string> - </property> - <property name="field"> - <string>forename</string> - </property> - </column> - <property name="name"> - <cstring>AuthorDataTable</cstring> - </property> - <property name="confirmDelete"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>surname ASC</string> - <string>forename ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author</string> - </stringlist> - </property> - </widget> - <widget class="TQDataTable"> - <column> - <property name="text"> - <string>Title</string> - </property> - <property name="field"> - <string>title</string> - </property> - </column> - <column> - <property name="text"> - <string>Price</string> - </property> - <property name="field"> - <string>price</string> - </property> - </column> - <column> - <property name="text"> - <string>Notes</string> - </property> - <property name="field"> - <string>notes</string> - </property> - </column> - <property name="name"> - <cstring>BookDataTable</cstring> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - </widget> - </widget> - <widget class="TQLayoutWidget"> - <property name="name"> - <cstring>Layout5</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>EditPushButton</cstring> - </property> - <property name="text"> - <string>&Edit Books</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>QuitPushButton</cstring> - </property> - <property name="text"> - <string>&Quit</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>QuitPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>EditPushButton</sender> - <signal>clicked()</signal> - <receiver>BookForm</receiver> - <slot>editClicked()</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>primeInsertAuthor(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>AuthorDataTable</sender> - <signal>currentChanged(QSqlRecord*)</signal> - <receiver>BookForm</receiver> - <slot>newCurrentAuthor(QSqlRecord*)</slot> - </connection> - <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot> -</connections> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h deleted file mode 100644 index 24bb69c..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h +++ /dev/null @@ -1,33 +0,0 @@ -void BookForm::editClicked() -{ - EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE ); - TQSqlCursor cur( "book" ); - dialog->BookDataBrowser->setSqlCursor( &cur ); - dialog->BookDataBrowser->setFilter( BookDataTable->filter() ); - dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList( - BookDataTable->sort(), &cur ) ); - dialog->BookDataBrowser->refresh(); - int i = BookDataTable->currentRow(); - if ( i == -1 ) i = 0; // Always use the first row - dialog->BookDataBrowser->seek( i ); - dialog->exec(); - delete dialog; - BookDataTable->refresh(); -} - -void BookForm::newCurrentAuthor( TQSqlRecord *author ) -{ - BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() ); - BookDataTable->refresh(); -} - -void BookForm::primeInsertAuthor( TQSqlRecord *buffer ) -{ - TQSqlQuery q; - q.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" ); - q.exec( "SELECT sequence FROM sequence WHERE tablename='author';" ); - if ( q.next() ) { - buffer->setValue( "id", q.value( 0 ) ); - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro b/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro deleted file mode 100644 index e4bdf75..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main.cpp ../connection.cpp -FORMS = book.ui editbook.ui -CONFIG += qt warn_on release -DBFILE = book.db diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui deleted file mode 100644 index f4c2cba..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui +++ /dev/null @@ -1,386 +0,0 @@ -<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>EditBookForm</class> -<include location="global" impldecl="in declaration">qsqlrecord.h</include> -<include location="local" implDecl="in declaration">editbook.ui.h</include> -<forward>class QSqlRecord;</forward> -<variable>QMap<QString,int> authorMap;</variable> -<layoutdefaults spacing="6" margin="11"/> -<widget class="TQDialog"> - <property name="name"> - <cstring>EditBookForm</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>520</width> - <height>369</height> - </rect> - </property> - <property name="caption"> - <string>Edit Books</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQDataBrowser"> - <property name="name"> - <cstring>BookDataBrowser</cstring> - </property> - <property name="sort"> - <stringlist> - <string>title ASC</string> - </stringlist> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - </stringlist> - </property> - <property name="frameworkCode" stdset="0"> - <bool>true</bool> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLayoutWidget" row="0" column="0"> - <property name="name"> - <cstring>Layout2</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel" row="1" column="0"> - <property name="name"> - <cstring>labelPrice</cstring> - </property> - <property name="text"> - <string>Price</string> - </property> - </widget> - <widget class="TQLabel" row="0" column="0"> - <property name="name"> - <cstring>labelTitle</cstring> - </property> - <property name="text"> - <string>Title</string> - </property> - </widget> - <widget class="TQLineEdit" row="0" column="1"> - <property name="name"> - <cstring>QLineEditTitle</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>title</string> - </stringlist> - </property> - </widget> - <widget class="TQLineEdit" row="1" column="1"> - <property name="name"> - <cstring>QLineEditPrice</cstring> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>book</string> - <string>price</string> - </stringlist> - </property> - </widget> - </grid> - </widget> - <widget class="TQLayoutWidget" row="3" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonInsert</cstring> - </property> - <property name="text"> - <string>&Insert</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonUpdate</cstring> - </property> - <property name="text"> - <string>&Update</string> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonDelete</cstring> - </property> - <property name="text"> - <string>&Delete</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonClose</cstring> - </property> - <property name="text"> - <string>&Close</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="2" column="0"> - <property name="name"> - <cstring>Layout3</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonFirst</cstring> - </property> - <property name="text"> - <string>|< &First</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonPrev</cstring> - </property> - <property name="text"> - <string><< &Prev</string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonNext</cstring> - </property> - <property name="text"> - <string>&Next >></string> - </property> - </widget> - <widget class="TQPushButton"> - <property name="name"> - <cstring>PushButtonLast</cstring> - </property> - <property name="text"> - <string>&Last >|</string> - </property> - </widget> - </hbox> - </widget> - <widget class="TQLayoutWidget" row="1" column="0"> - <property name="name"> - <cstring>Layout6</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="TQLabel"> - <property name="name"> - <cstring>TextLabel1</cstring> - </property> - <property name="text"> - <string>Author</string> - </property> - </widget> - <widget class="TQComboBox"> - <property name="name"> - <cstring>ComboBoxAuthor</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="database" stdset="0"> - <stringlist> - <string>(default)</string> - <string>author_view</string> - <string>name</string> - </stringlist> - </property> - </widget> - </hbox> - </widget> - </grid> - </widget> - </vbox> -</widget> -<connections> - <connection language="C++"> - <sender>PushButtonFirst</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>first()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>firstRecordAvailable( bool )</signal> - <receiver>PushButtonFirst</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonPrev</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>prev()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>prevRecordAvailable( bool )</signal> - <receiver>PushButtonPrev</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonNext</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>next()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>nextRecordAvailable( bool )</signal> - <receiver>PushButtonNext</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonLast</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>last()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>lastRecordAvailable( bool )</signal> - <receiver>PushButtonLast</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection language="C++"> - <sender>PushButtonInsert</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>insert()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonUpdate</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>update()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonDelete</sender> - <signal>clicked()</signal> - <receiver>BookDataBrowser</receiver> - <slot>del()</slot> - </connection> - <connection language="C++"> - <sender>PushButtonClose</sender> - <signal>clicked()</signal> - <receiver>EditBookForm</receiver> - <slot>accept()</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeUpdate(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>beforeUpdate(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>beforeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>beforeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>beforeUpdateBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeInsertBook(QSqlRecord*)</slot> - </connection> - <connection language="C++"> - <sender>BookDataBrowser</sender> - <signal>primeInsert(QSqlRecord*)</signal> - <receiver>EditBookForm</receiver> - <slot>primeInsertBook(QSqlRecord*)</slot> - </connection> - <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">beforeUpdateBook( QSqlRecord * buffer )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">mapAuthor( const QString & name, int & id, bool populate )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot> - <slot access="public" specifier="virtual" language="C++" returnType="void">primeUpdateBook( QSqlRecord * buffer )</slot> -</connections> -<tabstops> - <tabstop>QLineEditTitle</tabstop> - <tabstop>QLineEditPrice</tabstop> - <tabstop>ComboBoxAuthor</tabstop> - <tabstop>PushButtonFirst</tabstop> - <tabstop>PushButtonPrev</tabstop> - <tabstop>PushButtonNext</tabstop> - <tabstop>PushButtonLast</tabstop> - <tabstop>PushButtonInsert</tabstop> - <tabstop>PushButtonUpdate</tabstop> - <tabstop>PushButtonDelete</tabstop> - <tabstop>PushButtonClose</tabstop> -</tabstops> -</UI> diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h deleted file mode 100644 index 45876fe..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h +++ /dev/null @@ -1,47 +0,0 @@ -void EditBookForm::init() -{ - TQSqlQuery query( "SELECT surname, id FROM author ORDER BY surname;" ); - while ( query.next() ) { - ComboBoxAuthor->insertItem( query.value( 0 ).toString() ); - int id = query.value( 1 ).toInt(); - mapAuthor( query.value( 0 ).toString(), id, TRUE ); - } -} - -void EditBookForm::beforeUpdateBook( TQSqlRecord * buffer ) -{ - int id; - mapAuthor( ComboBoxAuthor->currentText(), id, FALSE ); - buffer->setValue( "authorid", id ); -} - -void EditBookForm::mapAuthor( const TQString & name, int & id, bool populate ) -{ - if ( populate ) - authorMap[ name ] = id; - else - id = authorMap[ name ]; -} - -void EditBookForm::primeInsertBook( TQSqlRecord * buffer ) -{ - TQSqlQuery q; - q.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" ); - q.exec( "SELECT sequence FROM sequence WHERE tablename='book';" ); - if ( q.next() ) { - buffer->setValue( "id", q.value( 0 ) ); - } -} - -void EditBookForm::primeUpdateBook( TQSqlRecord * buffer ) -{ - int id = buffer->value( "authorid" ).toInt(); - for ( int i = 0; i < ComboBoxAuthor->count(); i++ ) { - TQString author = ComboBoxAuthor->text( i ); - if ( authorMap.contains( author ) && authorMap[author] == id ) { - ComboBoxAuthor->setCurrentItem( i ) ; - break; - } - } -} - diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp deleted file mode 100644 index d244790..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -#include <tqapplication.h> -#include <tqsqldatabase.h> -#include "book.h" -#include "../connection.h" - -int main( int argc, char *argv[] ) -{ - TQApplication app( argc, argv ); - - if ( ! createConnections() ) - return 1; - - BookForm bookForm; - app.setMainWidget( &bookForm ); - bookForm.show(); - - return app.exec(); -} diff --git a/tqtinterface/qt4/tools/designer/examples/book/connection.cpp b/tqtinterface/qt4/tools/designer/examples/book/connection.cpp deleted file mode 100644 index 190d4fc..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/connection.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ -#include <tqsqldatabase.h> -#include "connection.h" - -bool createConnections() -{ - // create the default database connection - TQSqlDatabase *defaultDB = TQSqlDatabase::addDatabase( DB_BOOKS_DRIVER ); - defaultDB->setDatabaseName( DB_BOOKS ); - defaultDB->setUserName( DB_BOOKS_USER ); - defaultDB->setPassword( DB_BOOKS_PASSWD ); - defaultDB->setHostName( DB_BOOKS_HOST ); - if ( ! defaultDB->open() ) { - qWarning( "Failed to open books database: " + - defaultDB->lastError().driverText() ); - qWarning( defaultDB->lastError().databaseText() ); - return FALSE; - } - - TQSqlQuery q(TQString(), defaultDB); - q.exec("CREATE TABLE author ( id integer primary key, " - "forename varchar(40), surname varchar(40) )"); - q.exec("CREATE TABLE book ( id integer primary key, " - "title varchar(40), price numeric(10,2), authorid integer, notes varchar(255) )"); - - q.exec("CREATE TABLE sequence ( tablename varchar(10), sequence numeric)"); - - q.exec("INSERT INTO author VALUES ( 0, 'Philip K', 'Dick' )"); - q.exec("INSERT INTO author VALUES ( 1, 'Robert', 'Heinlein' )"); - q.exec("INSERT INTO author VALUES ( 2, 'Sarah', 'Paretsky' )"); - - q.exec("INSERT INTO book VALUES (0, 'The Man Who Japed', 6.99, 0, 'A good book' )"); - q.exec("INSERT INTO book VALUES (1, 'The Man in the High Castle', 9.99, 0, 'Worth reading' )"); - q.exec("INSERT INTO book VALUES ( 2, 'The Number of the Beast', 8.99, 1, 'Get this!' )"); - q.exec("INSERT INTO book VALUES ( 3, 'Indemnity Only', 9.99, 2, 'Cool' )"); - q.exec("INSERT INTO book VALUES ( 4, 'Burn Marks', 9.99, 2, 'Need to make notes' )"); - q.exec("INSERT INTO book VALUES ( 5, 'Deadlock', 9.99, 2, 'Hmmm..' )"); - - q.exec("INSERT INTO sequence VALUES ( 'author', 2 )"); - q.exec("INSERT INTO sequence VALUES ( 'book', 5 )"); - - return TRUE; -} - - diff --git a/tqtinterface/qt4/tools/designer/examples/book/connection.h b/tqtinterface/qt4/tools/designer/examples/book/connection.h deleted file mode 100644 index dc71cb4..0000000 --- a/tqtinterface/qt4/tools/designer/examples/book/connection.h +++ /dev/null @@ -1,18 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA. -** -** This file is part of an example program for TQt. This example -** program may be used, distributed and modified without limitation. -** -*****************************************************************************/ - -// Add your own connection parameters here -#define DB_BOOKS_DRIVER "TQSQLITE" -#define DB_BOOKS ":memory:" -#define DB_BOOKS_USER "" -#define DB_BOOKS_PASSWD "" -#define DB_BOOKS_HOST "" - -bool createConnections(); - |