Changeset View
Changeset View
Standalone View
Standalone View
src/widget/tableview/kexicomboboxpopup.h
Show All 16 Lines | |||||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KEXICOMBOBOXPOPUP_H | 20 | #ifndef KEXICOMBOBOXPOPUP_H | ||
21 | #define KEXICOMBOBOXPOPUP_H | 21 | #define KEXICOMBOBOXPOPUP_H | ||
22 | 22 | | |||
23 | #include <QFrame> | 23 | #include <QFrame> | ||
24 | 24 | | |||
25 | class KDbConnection; | ||||
25 | class KDbField; | 26 | class KDbField; | ||
26 | class KDbRecordData; | 27 | class KDbRecordData; | ||
27 | class KDbTableViewColumn; | 28 | class KDbTableViewColumn; | ||
28 | class KDbTableViewData; | 29 | class KDbTableViewData; | ||
29 | class KexiComboBoxPopupPrivate; | 30 | class KexiComboBoxPopupPrivate; | ||
30 | class KexiTableScrollArea; | 31 | class KexiTableScrollArea; | ||
31 | 32 | | |||
32 | //! Internal class for displaying popup table view | 33 | //! Internal class for displaying popup table view | ||
33 | class KexiComboBoxPopup : public QFrame | 34 | class KexiComboBoxPopup : public QFrame | ||
34 | { | 35 | { | ||
35 | Q_OBJECT | 36 | Q_OBJECT | ||
36 | public: | 37 | public: | ||
37 | //! @todo js: more ctors! | 38 | //! @todo js: more ctors! | ||
38 | /*! Constructor for creating a popup using definition from \a column. | 39 | /*! Constructor for creating a popup using definition from \a column. | ||
39 | If the column is lookup column, it's definition is used to display | 40 | If the column is lookup column, its definition is used to display | ||
40 | one or more column within the popup. Otherwise column.field() is used | 41 | one or more column within the popup. Otherwise column.field() is used | ||
41 | to display single-column data. */ | 42 | to display single-column data. */ | ||
42 | KexiComboBoxPopup(QWidget* parent, KDbTableViewColumn *column); | 43 | KexiComboBoxPopup(QWidget* parent, KDbConnection *conn, KDbTableViewColumn *column); | ||
43 | 44 | | |||
44 | /*! Alternative constructor supporting lookup fields and enum hints. */ | 45 | /*! Alternative constructor supporting lookup fields and enum hints. */ | ||
45 | KexiComboBoxPopup(QWidget* parent, KDbField *field); | 46 | KexiComboBoxPopup(QWidget* parent, KDbField *field); | ||
46 | 47 | | |||
47 | virtual ~KexiComboBoxPopup(); | 48 | virtual ~KexiComboBoxPopup(); | ||
48 | 49 | | |||
49 | KexiTableScrollArea* tableView(); | 50 | KexiTableScrollArea* tableView(); | ||
50 | 51 | | |||
Show All 21 Lines | |||||
72 | 73 | | |||
73 | protected: | 74 | protected: | ||
74 | void init(); | 75 | void init(); | ||
75 | 76 | | |||
76 | virtual bool eventFilter(QObject *o, QEvent *e); | 77 | virtual bool eventFilter(QObject *o, QEvent *e); | ||
77 | 78 | | |||
78 | //! The main function for setting data; data can be set either by passing \a column or \a field. | 79 | //! The main function for setting data; data can be set either by passing \a column or \a field. | ||
79 | //! The second case is used for lookup | 80 | //! The second case is used for lookup | ||
80 | void setData(KDbTableViewColumn *column, KDbField *field); | 81 | void setData(KDbConnection *conn, KDbTableViewColumn *column, KDbField *field); | ||
81 | 82 | | |||
82 | //! used by setData() | 83 | //! used by setData() | ||
83 | void setDataInternal(KDbTableViewData *data, bool owner = true); //!< helper | 84 | void setDataInternal(KDbTableViewData *data, bool owner = true); //!< helper | ||
84 | 85 | | |||
85 | KexiComboBoxPopupPrivate * const d; | 86 | KexiComboBoxPopupPrivate * const d; | ||
86 | 87 | | |||
87 | friend class KexiComboBoxTableEdit; | 88 | friend class KexiComboBoxTableEdit; | ||
88 | }; | 89 | }; | ||
89 | 90 | | |||
90 | #endif | 91 | #endif | ||
91 | 92 | |