cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
QuComboBox derives from Qt QComboBox to display values. When the option is activated explicitly, it can write either the current text or the current index. More...
#include <qucombobox.h>
Public Slots | |
void | setTarget (const QString &target, CuContext *ctx=nullptr) |
Connect the reader to the specified source. | |
void | clearTarget () |
virtual bool | ctxSwap (CumbiaPool *cu_p, const CuControlsFactoryPool &fpool) |
void | write (int i) |
write an integer to the target | |
void | write (const QString &s) |
write a string to the target | |
void | setIndexMode (bool im) |
enable or disable index mode | |
void | setExecuteOnIndexChanged (bool exe) |
change the executeOnIndexChanged property | |
void | onAnimationValueChanged (const QVariant &v) |
Signals | |
void | newData (const CuData &) |
void | linkStatsRequest (QWidget *myself, CuContextI *myself_as_cwi) |
Public Member Functions | |
QuComboBox (QWidget *w, Cumbia *cumbia, const CuControlsWriterFactoryI &r_fac) | |
Constructor with the parent widget, an engine specific Cumbia implementation and a CuControlsReaderFactoryI interface. | |
QuComboBox (QWidget *w, CumbiaPool *cumbia_pool, const CuControlsFactoryPool &fpool) | |
Constructor with the parent widget, CumbiaPool and CuControlsFactoryPool | |
virtual | ~QuComboBox () |
QString | target () const |
returns the target of the writer | |
CuContext * | getContext () const |
returns the pointer to the CuContext | |
bool | indexMode () const |
returns index mode enabled or not | |
bool | executeOnIndexChanged () const |
returns the value of the property executeOnIndexChanged | |
QString | getData () const |
void | onUpdate (const CuData &d) |
![]() | |
virtual | ~CuContextI () |
Protected Member Functions | |
void | contextMenuEvent (QContextMenuEvent *e) |
void | paintEvent (QPaintEvent *pe) |
Properties | |
QString | target |
QString | source |
bool | indexMode |
bool | executeOnIndexChanged |
QString | data |
QuComboBox derives from Qt QComboBox to display values. When the option is activated explicitly, it can write either the current text or the current index.
Connection is initiated with setTarget. The values property, if available from the underlying engine, is used to initialize the items at configuration time.
getContext returns a pointer to the CuContext used as a delegate for the connection.
If the object is used to provide input arguments to other writers (e.g. QuPushButton), the data property provides a string representation of either the current text or index, according to indexMode.
QuComboBox::QuComboBox | ( | QWidget * | w, |
Cumbia * | cumbia, | ||
const CuControlsWriterFactoryI & | r_factory ) |
Constructor with the parent widget, an engine specific Cumbia implementation and a CuControlsReaderFactoryI interface.
Please refer to md_src_cumbia_qtcontrols_widget_constructors documentation.
QuComboBox::QuComboBox | ( | QWidget * | w, |
CumbiaPool * | cumbia_pool, | ||
const CuControlsFactoryPool & | fpool ) |
Constructor with the parent widget, CumbiaPool and CuControlsFactoryPool
Please refer to md_src_cumbia_qtcontrols_widget_constructors documentation.
|
virtual |
|
slot |
|
protected |
References CuContextMenu::popup().
|
virtualslot |
References CuEngineSwap::ok(), and CuEngineSwap::replace().
bool QuComboBox::executeOnIndexChanged | ( | ) | const |
returns the value of the property executeOnIndexChanged
|
virtual |
returns the pointer to the CuContext
CuContext sets up the connection and is used as a mediator to send and get data to and from the reader.
Implements CuContextI.
QString QuComboBox::getData | ( | ) | const |
bool QuComboBox::indexMode | ( | ) | const |
returns index mode enabled or not
When index mode is enabled, the current item is chosen by its index at configuration time and the value used for writing is the QComboBox currentIndex. When it is disabled, currentText is used for writings and the current item at configuration time is searched by the source value (string comparison).
|
signal |
|
signal |
Referenced by onUpdate().
|
slot |
void QuComboBox::onUpdate | ( | const CuData & | d | ) |
References newData(), and QuLogImpl::showPopupOnMessage().
|
protected |
|
slot |
change the executeOnIndexChanged property
exe | true: write on index change according to indexMode |
exe | false (default) noop on index change |
|
slot |
enable or disable index mode
im | true index mode enabled |
im | false index mode disabled |
|
slot |
Connect the reader to the specified source.
If a reader with a different source is configured, it is deleted. If options have been set with QuContext::setOptions, they are used to set up the reader as desired.
References CuControlsWriterA::setTarget(), and target.
QString QuComboBox::target | ( | ) | const |
returns the target of the writer
References CuControlsWriterA::target().
|
slot |
write a string to the target
s | the string to be written on the target |
|
slot |
write an integer to the target
i | the value to be written on the target |
|
read |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
Referenced by setTarget().