Qt:Документация 4.3.2/q3sqlselectcursor

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь



Главная · Все классы · Основные классы · Классы по группам · Модули · Функции



[править] Q3SqlSelectCursor Class Reference
[модуль Qt3Support ]

The Q3SqlSelectCursor class provides browsing of general SQL SELECT statements. More...

 #include <Q3SqlSelectCursor>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Note to Qt Desktop Light Edition users: This class is only available in the Qt Desktop Edition.

Inherits Q3SqlCursor.

[править] Открытые функции

  • 43 открытых функций унаследованных от Q3SqlCursor
  • 28 открытых функций унаследованных от QSqlRecord
  • 37 открытых функций унаследованных от QSqlQuery

[править] Защищенные функции

  • virtual int update ( const QString & filter, bool invalidate = true )
  • 7 защищенных функций унаследованных от Q3SqlCursor

[править] Подробное описание

The Q3SqlSelectCursor class provides browsing of general SQL SELECT statements.

Q3SqlSelectCursor is a convenience class that makes it possible to display result sets from general SQL SELECT statements in data-aware Qt widgets. Q3SqlSelectCursor is read-only and does not support INSERT, UPDATE or DELETE operations.

Pass the query in at construction time, or use the Q3SqlSelectCursor::exec() function.


 Q3SqlSelectCursor* cur = new Q3SqlSelectCursor("SELECT id, firstname, lastname FROM author");
 Q3DataTable* table = new Q3DataTable(this);
 table->setSqlCursor(cur, true, true);
 cur->exec("SELECT * FROM books");

[править] Описание функций-членов

Q3SqlSelectCursor::Q3SqlSelectCursor ( const QString & query = QString(), QSqlDatabase db = QSqlDatabase() )

Constructs a read only cursor on database db using the query query.

Q3SqlSelectCursor::Q3SqlSelectCursor ( const Q3SqlSelectCursor & other )

Constructs a copy of other

Q3SqlSelectCursor::~Q3SqlSelectCursor ()

Destroys the object and frees any allocated resources

int Q3SqlSelectCursor::update ( const QString & filter, bool invalidate = true ) [virtual protected]

Updates the database with the current contents of the cursor edit buffer using the specified filter. Returns the number of records which were updated. For error information, use lastError().

Only records which meet the filter criteria are updated, otherwise all records in the table are updated.

If invalidate is true (the default), the cursor can no longer be navigated. A new select() call must be made before you can move to a valid record.

Reimplemented from Q3SqlCursor.

See also Q3SqlCursor::update(), primeUpdate(), setMode(), and lastError().

Copyright © 2007 Trolltech Trademarks
Qt 4.3.2