From 5fffa30386502b5423e45c2ed5e6af756b11c7b4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 28 May 2024 10:17:01 +0900 Subject: Rename nt* sql related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/sqltable-example.html | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'doc/html/sqltable-example.html') diff --git a/doc/html/sqltable-example.html b/doc/html/sqltable-example.html index d84b9fe30..f64e0b984 100644 --- a/doc/html/sqltable-example.html +++ b/doc/html/sqltable-example.html @@ -33,7 +33,7 @@ body { background: #ffffff; color: black; }

-This example shows how to use a TQDataTable to browse data in a SQL database. +This example shows how to use a TQDataTable to browse data in a SQL database.


Implementation:

/****************************************************************************
@@ -46,9 +46,9 @@ This example shows how to use a TQDataTable to b
 *****************************************************************************/
 
 #include <ntqapplication.h>
-#include <ntqsqldatabase.h>
-#include <ntqdatatable.h>
-#include <ntqsqlcursor.h>
+#include <tqsqldatabase.h>
+#include <tqdatatable.h>
+#include <tqsqlcursor.h>
 #include <ntqmessagebox.h>
 
 /* Modify the following to match your environment */
@@ -58,18 +58,18 @@ This example shows how to use a TQDataTable to b
 #define PASSWORD     ""   /* password for USER */
 #define HOST         "" /* host on which the database is running */
 
-class SimpleCursor : public TQSqlCursor
+class SimpleCursor : public TQSqlCursor
 {
 public:
-    SimpleCursor () : TQSqlCursor( "simpletable" ) {}
+    SimpleCursor () : TQSqlCursor( "simpletable" ) {}
 protected:
-    TQSqlRecord* primeInsert()
+    TQSqlRecord* primeInsert()
     {
         /* a real-world application would use sequences, or the like */
-        TQSqlRecord* buf = TQSqlCursor::primeInsert();
-        TQSqlQuery q( "select max(id)+1 from simpletable" );
-        if ( q.next() )
-               buf->setValue( "id", q.value(0) );
+        TQSqlRecord* buf = TQSqlCursor::primeInsert();
+        TQSqlQuery q( "select max(id)+1 from simpletable" );
+        if ( q.next() )
+               buf->setValue( "id", q.value(0) );
         return buf;
     }
 };
@@ -78,31 +78,31 @@ int main( int argc, char ** argv )
 {
     TQApplication a( argc, argv );
 
-    TQSqlDatabase * db = TQSqlDatabase::addDatabase( DRIVER );
-    db->setDatabaseName( DATABASE );
-    db->setUserName( USER );
-    db->setPassword( PASSWORD );
-    db->setHostName( HOST );
+    TQSqlDatabase * db = TQSqlDatabase::addDatabase( DRIVER );
+    db->setDatabaseName( DATABASE );
+    db->setUserName( USER );
+    db->setPassword( PASSWORD );
+    db->setHostName( HOST );
 
-    if( !db->open() ){
-        db->lastError().showMessage( "An error occured. Please read the README file in the sqltable"
+    if( !db->open() ){
+        db->lastError().showMessage( "An error occured. Please read the README file in the sqltable"
                                      "dir for more information.\n\n" );
         return 1;
     }
 
-    if (!db->tables().contains("simpletable")) {
-        TQSqlQuery q("create table simpletable(id int, name varchar(20), address varchar(20))", db);
+    if (!db->tables().contains("simpletable")) {
+        TQSqlQuery q("create table simpletable(id int, name varchar(20), address varchar(20))", db);
     }
 
     SimpleCursor cursor;
 
-    TQDataTable table( &cursor ); /* data table uses our cursor */
-    table.addColumn( "name", "Name" );
-    table.addColumn( "address", "Address" );
+    TQDataTable table( &cursor ); /* data table uses our cursor */
+    table.addColumn( "name", "Name" );
+    table.addColumn( "address", "Address" );
     table.setSorting( TRUE );
 
     a.setMainWidget( &table );
-    table.refresh(); /* load data */
+    table.refresh(); /* load data */
     table.show();    /* show widget */
 
     return a.exec();
-- 
cgit v1.2.3