Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/forms/widgets/kexidbcombobox.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 43 | Private() | |||
---|---|---|---|---|---|
46 | , isEditable(false) | 46 | , isEditable(false) | ||
47 | , buttonPressed(false) | 47 | , buttonPressed(false) | ||
48 | , mouseOver(false) | 48 | , mouseOver(false) | ||
49 | , dataEnteredByHand(true) { | 49 | , dataEnteredByHand(true) { | ||
50 | } | 50 | } | ||
51 | ~Private() { | 51 | ~Private() { | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | KDbConnection *connection = nullptr; | ||||
54 | KexiComboBoxPopup *popup; | 55 | KexiComboBoxPopup *popup; | ||
55 | KComboBox *paintedCombo; //!< fake combo used only to pass it as 'this' for QStyle (because styles use <static_cast>) | 56 | KComboBox *paintedCombo; //!< fake combo used only to pass it as 'this' for QStyle (because styles use <static_cast>) | ||
56 | QSize sizeHint; //!< A cache for KexiDBComboBox::sizeHint(), | 57 | QSize sizeHint; //!< A cache for KexiDBComboBox::sizeHint(), | ||
57 | //!< rebuilt by a font change event and style change event | 58 | //!< rebuilt by a font change event and style change event | ||
58 | KDbQueryColumnInfo* visibleColumnInfo; | 59 | KDbQueryColumnInfo* visibleColumnInfo; | ||
59 | //! used for collecting subwidgets and their childrens (if isEditable is false) | 60 | //! used for collecting subwidgets and their childrens (if isEditable is false) | ||
60 | QList<QWidget*> subWidgetsWithDisabledEvents; | 61 | QList<QWidget*> subWidgetsWithDisabledEvents; | ||
61 | bool isEditable; //!< true if the combo box is editable | 62 | bool isEditable; //!< true if the combo box is editable | ||
▲ Show 20 Lines • Show All 401 Lines • ▼ Show 20 Line(s) | |||||
463 | } | 464 | } | ||
464 | 465 | | |||
465 | bool KexiDBComboBox::valueChanged() | 466 | bool KexiDBComboBox::valueChanged() | ||
466 | { | 467 | { | ||
467 | //qDebug() << KexiDataItemInterface::originalValue().toString() << " ? " << value().toString(); | 468 | //qDebug() << KexiDataItemInterface::originalValue().toString() << " ? " << value().toString(); | ||
468 | return KexiDataItemInterface::originalValue() != value(); | 469 | return KexiDataItemInterface::originalValue() != value(); | ||
469 | } | 470 | } | ||
470 | 471 | | |||
471 | void | 472 | void KexiDBComboBox::setColumnInfo(KDbConnection *conn, KDbQueryColumnInfo* cinfo) | ||
472 | KexiDBComboBox::setColumnInfo(KDbQueryColumnInfo* cinfo) | | |||
473 | { | 473 | { | ||
474 | KexiFormDataItemInterface::setColumnInfo(cinfo); | 474 | d->connection = conn; | ||
475 | KexiFormDataItemInterface::setColumnInfo(conn, cinfo); | ||||
475 | } | 476 | } | ||
476 | 477 | | |||
477 | void KexiDBComboBox::setVisibleColumnInfo(KDbQueryColumnInfo* cinfo) | 478 | void KexiDBComboBox::setVisibleColumnInfo(KDbQueryColumnInfo* cinfo) | ||
478 | { | 479 | { | ||
479 | d->visibleColumnInfo = cinfo; | 480 | d->visibleColumnInfo = cinfo; | ||
480 | // we're assuming we already have columnInfo() | 481 | // we're assuming we already have columnInfo() | ||
481 | setColumnInfoInternal(columnInfo(), d->visibleColumnInfo); | 482 | setColumnInfoInternal(columnInfo(), d->visibleColumnInfo); | ||
482 | } | 483 | } | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | |||||
602 | } | 603 | } | ||
603 | 604 | | |||
604 | void KexiDBComboBox::undoChanges() | 605 | void KexiDBComboBox::undoChanges() | ||
605 | { | 606 | { | ||
606 | KexiDBAutoField::undoChanges(); | 607 | KexiDBAutoField::undoChanges(); | ||
607 | KexiComboBoxBase::undoChanges(); | 608 | KexiComboBoxBase::undoChanges(); | ||
608 | } | 609 | } | ||
609 | 610 | | |||
611 | KDbConnection *KexiDBComboBox::connection() | ||||
612 | { | ||||
613 | return d->connection; | ||||
614 | } |