From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/sql-overview-subclass4-main-cpp.html | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'doc/html/sql-overview-subclass4-main-cpp.html') diff --git a/doc/html/sql-overview-subclass4-main-cpp.html b/doc/html/sql-overview-subclass4-main-cpp.html index 79bd7111..b5140d53 100644 --- a/doc/html/sql-overview-subclass4-main-cpp.html +++ b/doc/html/sql-overview-subclass4-main-cpp.html @@ -43,46 +43,46 @@ body { background: #ffffff; color: black; } *****************************************************************************/ #include "main.h" -#include <qdatatable.h> +#include <ntqdatatable.h> InvoiceItemCursor::InvoiceItemCursor() : - TQSqlCursor( "invoiceitem" ) + TQSqlCursor( "invoiceitem" ) { TQSqlFieldInfo productName( "productname", TQVariant::String ); - append( productName ); - setCalculated( productName.name(), TRUE ); + append( productName ); + setCalculated( productName.name(), TRUE ); TQSqlFieldInfo productPrice( "price", TQVariant::Double ); - append( productPrice ); - setCalculated( productPrice.name(), TRUE ); + append( productPrice ); + setCalculated( productPrice.name(), TRUE ); TQSqlFieldInfo productCost( "cost", TQVariant::Double ); - append( productCost ); - setCalculated( productCost.name(), TRUE ); + append( productCost ); + setCalculated( productCost.name(), TRUE ); } -TQVariant InvoiceItemCursor::calculateField( const TQString & name ) +TQVariant InvoiceItemCursor::calculateField( const TQString & name ) { if ( name == "productname" ) { - TQSqlQuery query( "SELECT name FROM prices WHERE id=" + - field( "pricesid" )->value().toString() ); - if ( query.next() ) - return query.value( 0 ); + TQSqlQuery query( "SELECT name FROM prices WHERE id=" + + field( "pricesid" )->value().toString() ); + if ( query.next() ) + return query.value( 0 ); } else if ( name == "price" ) { - TQSqlQuery query( "SELECT price FROM prices WHERE id=" + - field( "pricesid" )->value().toString() ); - if ( query.next() ) - return query.value( 0 ); + TQSqlQuery query( "SELECT price FROM prices WHERE id=" + + field( "pricesid" )->value().toString() ); + if ( query.next() ) + return query.value( 0 ); } else if ( name == "cost" ) { - TQSqlQuery query( "SELECT price FROM prices WHERE id=" + - field( "pricesid" )->value().toString() ); - if ( query.next() ) - return TQVariant( query.value( 0 ).toDouble() * - value( "quantity").toDouble() ); + TQSqlQuery query( "SELECT price FROM prices WHERE id=" + + field( "pricesid" )->value().toString() ); + if ( query.next() ) + return TQVariant( query.value( 0 ).toDouble() * + value( "quantity").toDouble() ); } return TQVariant( TQString::null ); @@ -91,25 +91,25 @@ TQVariant InvoiceItemCursor::calculateF int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { InvoiceItemCursor invoiceItemCursor; - TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); + TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); - invoiceItemTable->addColumn( "productname", "Product" ); - invoiceItemTable->addColumn( "price", "Price" ); - invoiceItemTable->addColumn( "quantity", "Quantity" ); - invoiceItemTable->addColumn( "cost", "Cost" ); - invoiceItemTable->addColumn( "paiddate", "Paid" ); + invoiceItemTable->addColumn( "productname", "Product" ); + invoiceItemTable->addColumn( "price", "Price" ); + invoiceItemTable->addColumn( "quantity", "Quantity" ); + invoiceItemTable->addColumn( "cost", "Cost" ); + invoiceItemTable->addColumn( "paiddate", "Paid" ); - invoiceItemTable->refresh(); - invoiceItemTable->show(); + invoiceItemTable->refresh(); + invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; -- cgit v1.2.1