KexiDBImageBox Class Reference
#include <kexidbimagebox.h>
Inheritance diagram for KexiDBImageBox:

Detailed Description
A data-aware, editable image box.Can also act as a normal static image box.
Definition at line 35 of file kexidbimagebox.h.
Public Slots | |
| void | setPixmapId (uint id) |
| void | setStoredPixmapId (uint id) |
| virtual void | setDataSource (const QString &ds) |
| Sets the datasource to ds. | |
| void | setDataSourceMimeType (const QCString &ds) |
| virtual void | setReadOnly (bool set) |
| void | setScaledContents (bool set) |
| Sets pixmapData data for this widget. | |
| void | setAlignment (int alignment) |
| void | setKeepAspectRatio (bool set) |
| void | setDropDownButtonVisible (bool set) |
| void | insertFromFile () |
| Forces execution of "insert from file" action. | |
Signals | |
| void | idChanged (long id) |
| Used for db-aware mode. | |
Public Member Functions | |
| KexiDBImageBox (bool designMode, QWidget *parent, const char *name=0) | |
| virtual | ~KexiDBImageBox () |
| QString | dataSource () const |
| QCString | dataSourceMimeType () const |
| virtual QVariant | value () |
| QPixmap | pixmap () const |
| uint | pixmapId () const |
| uint | storedPixmapId () const |
| virtual void | setInvalidState (const QString &displayText) |
| virtual bool | valueIsNull () |
| virtual bool | valueIsEmpty () |
| virtual QWidget * | widget () |
| virtual bool | cursorAtStart () |
| always true | |
| virtual bool | cursorAtEnd () |
| always true | |
| virtual bool | isReadOnly () const |
| bool | hasScaledContents () const |
| int | alignment () const |
| bool | keepAspectRatio () const |
| virtual QSize | sizeHint () const |
| KexiImageContextMenu * | contextMenu () const |
| virtual void | setLineWidth (int width) |
| Reimplemented to override behaviour of "lineWidth" property. | |
| virtual void | setPaletteBackgroundColor (const QColor &color) |
| Reimplemented to override behaviour of "paletteBackgroundColor" property. | |
| bool | dropDownButtonVisible () const |
| int | lineWidth () const |
| For overridden property. | |
| FocusPolicy | focusPolicy () const |
| FocusPolicy | focusPolicyInternal () const |
| virtual void | setFocusPolicy (FocusPolicy policy) |
Protected Slots | |
| void | slotUpdateActionsAvailabilityRequested (bool &valueIsNull, bool &valueIsReadOnly) |
| void | handleInsertFromFileAction (const KURL &url) |
| void | handleAboutToSaveAsAction (QString &origFilename, QString &fileExtension, bool &dataIsEmpty) |
| void | handleSaveAsAction (const QString &fileName) |
| void | handleCutAction () |
| void | handleCopyAction () |
| void | handlePasteAction () |
| virtual void | clear () |
| void | handleShowPropertiesAction () |
Protected Member Functions | |
| QByteArray | data () const |
| virtual void | contextMenuEvent (QContextMenuEvent *e) |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| virtual void | paintEvent (QPaintEvent *) |
| virtual void | resizeEvent (QResizeEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *e) |
| virtual void | setValueInternal (const QVariant &add, bool removeOld) |
| Sets value value for a widget. | |
| void | setValueInternal (const QVariant &add, bool removeOld, bool loadPixmap) |
| void | updateActionStrings () |
| Updates i18n'd action strings after datasource change. | |
| void | updatePixmap () |
| void | setData (const KexiBLOBBuffer::Handle &handle) |
| bool | popupMenuAvailable () |
| virtual bool | keyPressed (QKeyEvent *ke) |
| int | realLineWidth () const |
| virtual bool | subwidgetStretchRequired (KexiDBAutoField *autoField) const |
| Implemented for KexiSubwidgetInterface. | |
Protected Attributes | |
| QPixmap | m_pixmap |
| QByteArray | m_value |
| for db-aware mode | |
| QString | m_valueMimeType |
| for db-aware mode | |
| KexiBLOBBuffer::Handle | m_data |
| KexiDropDownButton * | m_chooser |
| KexiImageContextMenu * | m_popupMenu |
| int | m_alignment |
| FocusPolicy | m_focusPolicyInternal |
| Used for focusPolicyInternal(). | |
| bool | m_designMode: 1 |
| bool | m_readOnly: 1 |
| bool | m_scaledContents: 1 |
| bool | m_keepAspectRatio: 1 |
| bool | m_insideSetData: 1 |
| bool | m_setFocusOnButtonAfterClosingPopup: 1 |
| bool | m_lineWidthChanged: 1 |
| bool | m_paletteBackgroundColorChanged: 1 |
| bool | m_paintEventEnabled: 1 |
| used to disable paintEvent() | |
| bool | m_dropDownButtonVisible: 1 |
Properties | |
| QString | dataSource |
| QCString | dataSourceMimeType |
| bool | readOnly |
| uint | pixmapId |
| uint | storedPixmapId |
| bool | scaledContents |
| bool | keepAspectRatio |
| Alignment | alignment |
| bool | dropDownButtonVisible |
Constructor & Destructor Documentation
|
||||||||||||||||
|
Definition at line 63 of file kexidbimagebox.cpp. References clear(), handleCopyAction(), handleCutAction(), handleInsertFromFileAction(), handlePasteAction(), handleSaveAsAction(), handleShowPropertiesAction(), m_chooser, m_designMode, m_popupMenu, setDataSource(), KexiFrame::setFrameColor(), and slotUpdateActionsAvailabilityRequested(). |
|
|
Definition at line 129 of file kexidbimagebox.cpp. |
Member Function Documentation
|
|
Definition at line 97 of file kexidbimagebox.h. |
|
|
Implements KexiDataItemInterface. Definition at line 433 of file kexidbimagebox.cpp. References dataSource(), isReadOnly(), setData(), setValueInternal(), and KexiDataItemInterface::signalValueChanged(). Referenced by handleCutAction(), and KexiDBImageBox(). |
|
|
Definition at line 133 of file kexidbimagebox.cpp. References m_popupMenu. Referenced by KexiDBFactory::createMenuActions(). |
|
|
Definition at line 489 of file kexidbimagebox.cpp. References m_popupMenu, and popupMenuAvailable(). |
|
|
always true
Implements KexiDataItemInterface. Definition at line 295 of file kexidbimagebox.cpp. |
|
|
always true
Implements KexiDataItemInterface. Definition at line 290 of file kexidbimagebox.cpp. |
|
|
Definition at line 300 of file kexidbimagebox.cpp. References KexiBLOBBuffer::Handle::data(), dataSource(), m_data, and m_value. Referenced by handleAboutToSaveAsAction(), and handleSaveAsAction(). |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 61 of file kexidbimagebox.h. References KexiFormDataItemInterface::dataSource(). Referenced by clear(), data(), focusPolicy(), handleAboutToSaveAsAction(), handleCutAction(), handleInsertFromFileAction(), handlePasteAction(), paintEvent(), pixmap(), popupMenuAvailable(), setDataSource(), setInvalidState(), slotUpdateActionsAvailabilityRequested(), updateActionStrings(), and value(). |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 62 of file kexidbimagebox.h. References KexiFormDataItemInterface::dataSourceMimeType(). |
|
|
|
|
||||||||||||
|
Definition at line 818 of file kexidbimagebox.cpp. References m_chooser. |
|
|
Overriden to change the policy behaviour a bit: NoFocus is returned regardless the real focus flag if the data source is empty (see dataSource()). Definition at line 828 of file kexidbimagebox.cpp. References dataSource(), and m_focusPolicyInternal. Referenced by setDataSource(), and setFocusPolicy(). |
|
|
Definition at line 835 of file kexidbimagebox.cpp. References m_focusPolicyInternal. |
|
||||||||||||||||
|
Definition at line 356 of file kexidbimagebox.cpp. References data(), dataSource(), m_data, KexiBLOBBuffer::Handle::mimeType(), and KexiBLOBBuffer::Handle::originalFileName(). |
|
|
Definition at line 396 of file kexidbimagebox.cpp. References KexiCSVExport::Clipboard, and pixmap(). Referenced by handleCutAction(), and KexiDBImageBox(). |
|
|
Definition at line 388 of file kexidbimagebox.cpp. References clear(), dataSource(), handleCopyAction(), and isReadOnly(). Referenced by KexiDBImageBox(). |
|
|
Definition at line 317 of file kexidbimagebox.cpp. References dataSource(), isReadOnly(), m_valueMimeType, KexiBLOBBuffer::self(), setData(), setValueInternal(), and KexiDataItemInterface::signalValueChanged(). Referenced by KexiDBImageBox(). |
|
|
Definition at line 401 of file kexidbimagebox.cpp. References KexiCSVExport::Clipboard, dataSource(), isReadOnly(), m_designMode, m_pixmap, KexiBLOBBuffer::self(), setData(), setValueInternal(), and KexiDataItemInterface::signalValueChanged(). Referenced by KexiDBImageBox(). |
|
|
Definition at line 372 of file kexidbimagebox.cpp. References data(). Referenced by KexiDBImageBox(). |
|
|
Definition at line 459 of file kexidbimagebox.cpp. Referenced by KexiDBImageBox(). |
|
|
Definition at line 257 of file kexidbimagebox.cpp. References m_scaledContents. |
|
|
Used for db-aware mode. Emitted when value has been changed. Actual value can be obtained using value(). Referenced by setData(). |
|
|
Forces execution of "insert from file" action.
Definition at line 312 of file kexidbimagebox.cpp. References KexiImageContextMenu::insertFromFile(), and m_popupMenu. Referenced by KexiDBFactory::startEditing(). |
|
|
Reimplemented from KexiDataItemInterface. Definition at line 205 of file kexidbimagebox.cpp. References m_readOnly. Referenced by clear(), handleCutAction(), handleInsertFromFileAction(), handlePasteAction(), setValueInternal(), and slotUpdateActionsAvailabilityRequested(). |
|
|
Definition at line 99 of file kexidbimagebox.h. |
|
|
Called by top-level form on key press event. Used for Key_Escape to if the popup is visible, so the key press won't be consumed to perform "cancel editing". Reimplemented from KexiFormDataItemInterface. Definition at line 765 of file kexidbimagebox.cpp. References m_popupMenu, and m_setFocusOnButtonAfterClosingPopup. |
|
|
For overridden property.
Definition at line 120 of file kexidbimagebox.h. Referenced by realLineWidth(). |
|
|
Definition at line 626 of file kexidbimagebox.cpp. References KexiUtils::contrastColor(), dataSource(), KexiFrame::drawFrame(), KexiUtils::drawPixmap(), KexiDBImageBox_pm, m_alignment, m_chooser, m_designMode, m_dropDownButtonVisible, m_keepAspectRatio, m_paintEventEnabled, m_scaledContents, pixmap(), realLineWidth(), size, and updatePixmap(). |
|
|
Definition at line 215 of file kexidbimagebox.cpp. References dataSource(), m_data, m_pixmap, and KexiBLOBBuffer::Handle::pixmap(). Referenced by handleCopyAction(), paintEvent(), sizeHint(), slotUpdateActionsAvailabilityRequested(), and updatePixmap(). |
|
|
|
|
|
Definition at line 575 of file kexidbimagebox.cpp. References dataSource(). Referenced by contextMenuEvent(), setDataSource(), and updateActionStrings(). |
|
|
Definition at line 618 of file kexidbimagebox.cpp. References lineWidth(). Referenced by paintEvent(), and resizeEvent(). |
|
|
Definition at line 728 of file kexidbimagebox.cpp. References m_chooser, realLineWidth(), size, and KexiDropDownButton::sizeHint(). |
|
|
Definition at line 710 of file kexidbimagebox.cpp. References m_alignment, m_keepAspectRatio, and m_scaledContents. |
|
|
Used internally to set database column information. Reimplement if you need to do additional actions, e.g. set data validator based on field type. Don't forget about calling superclass implementation. Reimplemented from KexiFormDataItemInterface. Definition at line 758 of file kexidbimagebox.cpp. References KexiFormDataItemInterface::setColumnInfo(), and updateActionStrings(). |
|
|
Definition at line 717 of file kexidbimagebox.cpp. References KexiBLOBBuffer::Handle::id(), idChanged(), m_data, and m_insideSetData. Referenced by clear(), handleInsertFromFileAction(), handlePasteAction(), setDataSource(), setPixmapId(), and setStoredPixmapId(). |
|
|
Sets the datasource to ds.
Reimplemented from KexiFormDataItemInterface. Definition at line 583 of file kexidbimagebox.cpp. References dataSource(), focusPolicy(), m_chooser, m_dropDownButtonVisible, m_lineWidthChanged, m_paletteBackgroundColorChanged, popupMenuAvailable(), setData(), KexiFormDataItemInterface::setDataSource(), and updateActionStrings(). Referenced by KexiDBImageBox(). |
|
|
Sets the mime type of the data source for this widget. Data source usually means here a "kexi/table" or "kexi/query".
Reimplemented from KexiFormDataItemInterface. Definition at line 142 of file kexidbimagebox.h. References KexiFormDataItemInterface::setDataSourceMimeType(). |
|
|
Definition at line 798 of file kexidbimagebox.cpp. References m_chooser, and m_dropDownButtonVisible. |
|
|
Sets the internal focus policy value. "Internal" means that if there is no data source set, real policy becomes NoFocus. Definition at line 840 of file kexidbimagebox.cpp. References focusPolicy(), and m_focusPolicyInternal. |
|
|
Implements KexiFormDataItemInterface. Definition at line 176 of file kexidbimagebox.cpp. References dataSource(), m_chooser, m_value, and setReadOnly(). |
|
|
Definition at line 276 of file kexidbimagebox.cpp. References m_keepAspectRatio, and m_scaledContents. |
|
|
Reimplemented to override behaviour of "lineWidth" property.
Definition at line 779 of file kexidbimagebox.cpp. References m_lineWidthChanged. |
|
|
Reimplemented to override behaviour of "paletteBackgroundColor" property.
Definition at line 785 of file kexidbimagebox.cpp. References m_chooser, and m_paletteBackgroundColorChanged. |
|
|
Definition at line 234 of file kexidbimagebox.cpp. References m_insideSetData, KexiBLOBBuffer::self(), and setData(). |
|
|
Changes 'read only' flag, for this widget. Typically this flag can be passed to a widget itself, e.g. KLineEdit::setReadOnly(bool). Implements KexiFormDataItemInterface. Definition at line 210 of file kexidbimagebox.cpp. References m_readOnly. Referenced by setInvalidState(). |
|
|
Sets pixmapData data for this widget. Sets original file name of image loaded from a file.
Definition at line 269 of file kexidbimagebox.cpp. References m_scaledContents. |
|
|
Definition at line 251 of file kexidbimagebox.cpp. References KexiBLOBBuffer::self(), and setData(). |
|
||||||||||||||||
|
unused (m_valueMimeType is not available unless the px is inserted) QString type( KImageIO::typeForMime(m_valueMimeType) ); ok = KImageIO::canRead( type );
Definition at line 149 of file kexidbimagebox.cpp. References isReadOnly(), KexiDataItemInterface::m_origValue, m_pixmap, m_value, and m_valueMimeType. |
|
||||||||||||
|
Sets value value for a widget.
Implements KexiDataItemInterface. Definition at line 203 of file kexidbimagebox.h. References KexiDataItemInterface::setValueInternal(). Referenced by clear(), handleInsertFromFileAction(), and handlePasteAction(). |
|
|
Definition at line 611 of file kexidbimagebox.cpp. References pixmap(). |
|
||||||||||||
|
Definition at line 464 of file kexidbimagebox.cpp. References dataSource(), isReadOnly(), m_designMode, pixmap(), and valueIsNull(). Referenced by KexiDBImageBox(). |
|
|
|
|
|
Implemented for KexiSubwidgetInterface.
Reimplemented from KexiSubwidgetInterface. Definition at line 812 of file kexidbimagebox.cpp. |
|
|
Updates i18n'd action strings after datasource change.
Definition at line 538 of file kexidbimagebox.cpp. References KexiFormDataItemInterface::columnInfo(), dataSource(), KexiFormPart::library(), m_chooser, m_designMode, m_popupMenu, popupMenuAvailable(), and KexiImageContextMenu::updateTitle(). Referenced by setColumnInfo(), and setDataSource(). |
|
|
Definition at line 691 of file kexidbimagebox.cpp. References KexiDBImageBox_pm, KexiDBImageBox_pmDeleter, m_designMode, and pixmap(). Referenced by paintEvent(). |
|
|
Implements KexiDataItemInterface. Definition at line 138 of file kexidbimagebox.cpp. References dataSource(), and m_value. |
|
|
Implements KexiDataItemInterface. Definition at line 200 of file kexidbimagebox.cpp. |
|
|
Implements KexiDataItemInterface. Definition at line 194 of file kexidbimagebox.cpp. References m_value. Referenced by slotUpdateActionsAvailabilityRequested(). |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 283 of file kexidbimagebox.cpp. |
Member Data Documentation
|
|
Definition at line 256 of file kexidbimagebox.h. Referenced by paintEvent(), and setAlignment(). |
|
|
Definition at line 250 of file kexidbimagebox.h. Referenced by eventFilter(), KexiDBImageBox(), paintEvent(), resizeEvent(), setDataSource(), setDropDownButtonVisible(), setInvalidState(), setPaletteBackgroundColor(), and updateActionStrings(). |
|
|
Definition at line 248 of file kexidbimagebox.h. Referenced by data(), handleAboutToSaveAsAction(), pixmap(), and setData(). |
|
|
Definition at line 258 of file kexidbimagebox.h. Referenced by handlePasteAction(), KexiDBImageBox(), paintEvent(), slotUpdateActionsAvailabilityRequested(), updateActionStrings(), and updatePixmap(). |
|
|
Definition at line 267 of file kexidbimagebox.h. Referenced by paintEvent(), setDataSource(), and setDropDownButtonVisible(). |
|
|
Used for focusPolicyInternal().
Definition at line 257 of file kexidbimagebox.h. Referenced by focusPolicy(), focusPolicyInternal(), and setFocusPolicy(). |
|
|
Definition at line 262 of file kexidbimagebox.h. Referenced by setData(), and setPixmapId(). |
|
|
Definition at line 261 of file kexidbimagebox.h. Referenced by paintEvent(), setAlignment(), and setKeepAspectRatio(). |
|
|
Definition at line 264 of file kexidbimagebox.h. Referenced by setDataSource(), and setLineWidth(). |
|
|
used to disable paintEvent()
Definition at line 266 of file kexidbimagebox.h. Referenced by paintEvent(). |
|
|
Definition at line 265 of file kexidbimagebox.h. Referenced by setDataSource(), and setPaletteBackgroundColor(). |
|
|
Definition at line 244 of file kexidbimagebox.h. Referenced by handlePasteAction(), pixmap(), and setValueInternal(). |
|
|
Definition at line 251 of file kexidbimagebox.h. Referenced by contextMenu(), contextMenuEvent(), insertFromFile(), KexiDBImageBox(), keyPressed(), and updateActionStrings(). |
|
|
Definition at line 259 of file kexidbimagebox.h. Referenced by isReadOnly(), and setReadOnly(). |
