source: trunk/examples/sql/overview/table4/main.h

Last change on this file was 202, checked in by rudi, 14 years ago

Added SQL examples

File size: 1.5 KB
Line 
1/****************************************************************************
2** $Id: main.h 2051 2007-02-21 10:04:20Z chehrlic $
3**
4** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
5**
6** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation.
8**
9*****************************************************************************/
10
11#include <qapplication.h>
12#include <qcombobox.h>
13#include <qmap.h>
14#include <qpainter.h>
15#include <qsqldatabase.h>
16#include <qsqlcursor.h>
17#include <qsqleditorfactory.h>
18#include <qsqlpropertymap.h>
19#include <qdatatable.h>
20#include "../connection.h"
21
22class StatusPicker : public QComboBox
23{
24 Q_OBJECT
25 Q_PROPERTY( int statusid READ statusId WRITE setStatusId )
26public:
27 StatusPicker( QWidget *parent=0, const char *name=0 );
28 int statusId() const;
29 void setStatusId( int id );
30private:
31 QMap< int, int > index2id;
32};
33
34
35class CustomTable : public QDataTable
36{
37 Q_OBJECT
38public:
39 CustomTable(
40 QSqlCursor *cursor, bool autoPopulate = FALSE,
41 QWidget * parent = 0, const char * name = 0 ) :
42 QDataTable( cursor, autoPopulate, parent, name ) {}
43 void paintField(
44 QPainter * p, const QSqlField* field, const QRect & cr, bool );
45
46};
47
48
49class CustomSqlEditorFactory : public QSqlEditorFactory
50{
51 Q_OBJECT
52public:
53 QWidget *createEditor( QWidget *parent, const QSqlField *field );
54};
Note: See TracBrowser for help on using the repository browser.