#include <aiselector.h>
Properties | |
bool | allowNull |
QString | defaultText |
QString | fieldName |
bool | showInactive |
QString | sourceName |
QString | title |
Public Slots | |
virtual void | clear () |
virtual void | setAllowNull (const bool pAllowNull) |
virtual void | setCode (const QString &pCode) |
virtual void | setData () |
virtual void | setData (const QString &text) |
virtual void | setDataWidgetMap (XDataWidgetMapper *m) |
virtual void | setDefaultText (QString p) |
virtual void | setFieldName (QString pName) override |
Set the field from the query used to populate the AISelector. | |
virtual void | setFull (const QString &pFull) |
Set the current record in the AISelector by its "full text" value. | |
virtual void | setId (const int pId) |
Set the current record in the AISelector by its internal id. | |
virtual void | setShowInactive (const bool pShowInactive) |
virtual bool | setSourceName (const QString &pSourceName) |
virtual void | setText (const QString &pText) |
virtual void | setText (const QVariant &pText) override |
virtual void | setTitle (const QString &pTitle) |
virtual void | setWhereValue (const int pPosition, const QVariant &pValue) |
virtual void | setWhereValue (const QString &pColumn, const QVariant &pValue) |
virtual void | sList () |
virtual void | sNew () |
virtual void | sOpen () |
virtual void | sUpdateMenu () |
Signals | |
void | clicked () |
void | doubleClicked () |
void | newId (int pId) |
void | requestAlias () |
void | requestInfo () |
void | requestList () |
void | requestSearch () |
void | requestShowInactive (bool pShowInactive) |
void | valid (bool pIsValid) |
Public Member Functions | |
AISelector (QWidget *pParent, const QString &pSchemaName, const QString &pTableName, const QString &pIdCol, const QString &pCodeCol, const QString &pFullCol=QString(), const QString &pActiveCol=QString(), const QString &pUiName=QString(), const QString &pEditPriv=QString(), const QString &pNewPriv=QString(), const QString &pViewPriv=QString(), const QString &pJoin=QString(), const QStringList &pOtherCols=QStringList(), const QString &pDefault=QString(), const QList< QPair< QString, bool > > &pOrderBy=QList< QPair< QString, bool > >(), const QList< QPair< QString, QVariant > > &pWhere=QList< QPair< QString, QVariant > >(), const QString &pQuery=QString()) | |
Create an AISelector using a query built from the given database structural information. | |
AISelector (QWidget *pParent, const QString &pSourceName) | |
Create an AISelector based on the source table. | |
AISelector (QWidget *pParent=0) | |
virtual | ~AISelector () |
virtual Q_INVOKABLE bool | allowNull () const |
virtual Q_INVOKABLE QString | code () const |
Get the code value of the current selection or a null string if there is no selection. | |
virtual QString | defaultText () const |
virtual QScriptEngine * | engine () |
virtual Q_INVOKABLE QString | field (const int pPosition) const |
Get the column name in the underlying model associated with the given column position. | |
virtual Q_INVOKABLE int | field (const QString &pName) const |
Get the column position in the underlying model associated with the given column number. | |
virtual QString | fieldName () const |
virtual Q_INVOKABLE QStringList | fields () const |
Get the list of column names in the underlying data model. | |
virtual Q_INVOKABLE QString | full () const |
Get the full value of the current selection or a null string if there is no selection. | |
virtual Q_INVOKABLE int | id () override |
Get the internal id of the current selection or -1 if there is no selection. | |
virtual Q_INVOKABLE int | id (const QString &pCode) const |
Find the id of the given pCode. | |
virtual Q_INVOKABLE bool | init (const QString &pSchemaName, const QString &pTableName, const QString &pIdCol, const QString &pCodeCol, const QString &pFullCol=QString(), const QString &pActiveCol=QString(), const QString &pUiName=QString(), const QString &pEditPriv=QString(), const QString &pNewPriv=QString(), const QString &pViewPriv=QString(), const QString &pJoin=QString(), const QStringList &pOtherCol=QStringList(), const QString &pDefault=QString(), const QList< QPair< QString, bool > > &pOrderBy=QList< QPair< QString, bool > >(), const QList< QPair< QString, QVariant > > &pWhere=QList< QPair< QString, QVariant > >(), const QString &pQuery=QString()) |
Set up the AISelector with a query based on the given database structural information. | |
virtual Q_INVOKABLE bool | isActive () const |
Get the active/inactive status of the current selection. | |
Q_INVOKABLE bool | isNull () |
virtual Q_INVOKABLE bool | isValid () override |
Get the status of the AISelector. | |
virtual void | loadScript (const QString &oName) |
virtual void | loadScript (const QStringList &list) |
virtual void | loadScriptEngine () |
virtual Q_INVOKABLE QMenu * | menu () const |
virtual Q_INVOKABLE QAbstractItemModel * | model () const |
virtual Q_INVOKABLE QString | nullStr () const |
virtual Q_INVOKABLE QString | queryStr () const |
virtual Q_INVOKABLE void | setDouble (const double, const int=-1) |
virtual Q_INVOKABLE void | setNullStr (const QString &text) |
virtual Q_INVOKABLE bool | setScriptableParams (ParameterList &) |
Q_INVOKABLE void | setValidator (QValidator *v) |
virtual Q_INVOKABLE bool | showInactive () const |
virtual Q_INVOKABLE QString | sourceName () const |
virtual Q_INVOKABLE QString | title () const |
Q_INVOKABLE double | toDouble (bool *=0) |
virtual Q_INVOKABLE QVariant | value (const int pPosition) const |
virtual Q_INVOKABLE QVariant | value (const QString &pName) const |
virtual Q_INVOKABLE ParameterList | values (const int pId) const |
virtual Q_INVOKABLE ParameterList | values (const QString &pCode) const |
virtual Q_INVOKABLE QVariant | whereValue (const int pPosition) const |
virtual Q_INVOKABLE QVariant | whereValue (const QString &pColumn) const |
virtual Q_INVOKABLE QList< QPair< QString, QVariant > > | whereValues () const |
Static Public Attributes | |
static GuiClientInterface * | _guiClientInterface |
Protected Types | |
enum | ColumnPosition { IdColumn , CodeColumn , FullColumn , ActiveColumn , DefaultColumn , OrderColumn } |
Protected Slots | |
virtual void | sHandleNullStr () override |
virtual void | sParse () override |
Protected Member Functions | |
virtual void | changeEvent (QEvent *pEvent) override |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
void | keyPressEvent (QKeyEvent *) |
void | mouseDoubleClickEvent (QMouseEvent *) |
void | mousePressEvent (QMouseEvent *) |
virtual void | resizeEvent (QResizeEvent *pEvent) override |
Protected Attributes | |
QAction * | _aliasAct |
QScriptEngineDebugger * | _debugger |
QScriptEngine * | _engine |
QString | _fieldName |
int | _id |
QAction * | _listAct |
QMenu * | _menu |
QAction * | _newAct |
QString | _nullStr |
QAction * | _openAct |
AISelectorPrivate * | _p |
bool | _parsed |
bool | _scriptLoaded |
QAction * | _searchAct |
QWidget * | _self |
bool | _valid |
Static Protected Attributes | |
static ScriptCache * | _cache |
|
protected |
|
readwrite |
|
readwriteinherited |
|
readwriteinherited |
|
readwrite |
|
readwrite |
|
readwrite |
AISelector::AISelector | ( | QWidget * | pParent = 0 | ) |
AISelector::AISelector | ( | QWidget * | pParent, |
const QString & | pSourceName ) |
Create an AISelector based on the source
table.
This constructor searches the source
table for a record matching the given pSourceName. If one is found, the query backing this AISelector is built using the information in the @source record.
pSourceName | is compared with the source_name column of source |
AISelector::AISelector | ( | QWidget * | pParent, |
const QString & | pSchemaName, | ||
const QString & | pTableName, | ||
const QString & | pIdCol, | ||
const QString & | pCodeCol, | ||
const QString & | pFullCol = QString(), | ||
const QString & | pActiveCol = QString(), | ||
const QString & | pUiName = QString(), | ||
const QString & | pEditPriv = QString(), | ||
const QString & | pNewPriv = QString(), | ||
const QString & | pViewPriv = QString(), | ||
const QString & | pJoin = QString(), | ||
const QStringList & | pOtherCols = QStringList(), | ||
const QString & | pDefaultCol = QString(), | ||
const QList< QPair< QString, bool > > & | pOrderBy = QList<QPair<QString, bool>>(), | ||
const QList< QPair< QString, QVariant > > & | pWhere = QList<QPair<QString, QVariant>>(), | ||
const QString & | pQuery = QString() ) |
Create an AISelector using a query built from the given database structural information.
This constructor builds a query using the given table and field names. The UI and privilege information control the actions in the widget's menu.
pSchemaName | Database schema containing the named table. If this is an empty or null string, the table is not schema-qualified in the query. |
pTableName | |
pIdCol | The name of the table column containing the id. |
pCodeCol | |
pFullCol | |
pActiveCol | |
pUiName | |
pEditPriv | |
pNewPriv | |
pViewPriv | |
pJoin | Optional join clause referring to auxilliary tables. This must include the SQL JOIN keyword. |
pOtherCols | Optional set of other columns to include in the query. |
pDefaultCol | Optional boolean column identifying a default record. The default record is pre-selected and the first listed. |
pOrderBy | List of pairs of columns to sort by and sort direction. * Sorted in sequence with true as ascending. |
pWhere | List of pairs of columns and values to filter on. The value can be changed to filter on a different value. |
pQuery | Query to use if too complex for above parameters. Takes the non-empty parameters as positional arguments. Columns and values from pWhere are separate arguments. |
|
virtual |
|
virtual |
|
overrideprotectedvirtual |
|
virtualslot |
|
signalinherited |
|
virtual |
Get the code value of the current selection or a null string if there is no selection.
|
inlinevirtualinherited |
|
signalinherited |
|
virtualinherited |
Reimplemented in ScriptablePrivate.
|
virtual |
Get the column name in the underlying model associated with the given column position.
|
virtual |
Get the column position in the underlying model associated with the given column number.
|
inlinevirtualinherited |
|
virtual |
Get the list of column names in the underlying data model.
|
protectedvirtualinherited |
Reimplemented in VirtualClusterLineEdit.
|
protectedvirtualinherited |
|
virtual |
Get the full value of the current selection or a null string if there is no selection.
|
overridevirtual |
Get the internal id of the current selection or -1 if there is no selection.
Reimplemented from XLineEdit.
|
virtual |
Find the id of the given pCode.
Search the data backing the AISelector for the internal id associated with the given pCode, regardless of active/inactive status. Try a raw match, then trimmed match.
|
virtual |
Set up the AISelector with a query based on the given database structural information.
pSchemaName | Database schema containing the named table. If this is an empty or null string, the table is not schema-qualified in the query. |
pTableName | |
pIdCol | The name of the table column containing the id. |
pCodeCol | |
pFullCol | |
pActiveCol | |
pUiName | The C++ class name or JavaScript uiform name of the window to open to view or edit the current record. |
pEditPriv | |
pNewPriv | |
pViewPriv | |
pJoin | Optional join clause referring to auxilliary tables. This must include the SQL JOIN keyword. |
pOtherCols | Optional set of other columns to include in the query. |
pDefaultCol | Optional boolean column identifying a default record. The default record is pre-selected and the first listed. |
pOrderBy | List of pairs of columns to sort by and sort direction. * Sorted in sequence with true as ascending. |
pWhere | List of pairs of columns and values to filter on. The value can be changed to filter on a different value. |
pQuery | Query to use if too complex for above parameters. Takes the non-empty parameters as positional arguments. Columns and values from pWhere are separate arguments. |
generates a query similar to this:
For a more complex query, you can use something like
generates a query similar to this:
The privileges control whether Open and Edit\ List are available in the widget's menu, and whether Open opens the named UI for editing or viewing.
|
virtual |
Get the active/inactive status of the current selection.
|
inherited |
|
overridevirtual |
Get the status of the AISelector.
Reimplemented from XLineEdit.
|
protectedinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtual |
|
virtual |
|
protectedinherited |
|
protectedinherited |
|
signal |
|
inlinevirtualinherited |
|
virtual |
|
signalinherited |
|
signalinherited |
|
signalinherited |
|
signalinherited |
|
signal |
|
overrideprotectedvirtual |
|
virtualslot |
|
virtualslot |
|
virtualslotinherited |
|
virtualslotinherited |
|
virtualslotinherited |
|
inlinevirtualslotinherited |
|
virtualinherited |
|
overridevirtualslot |
Set the field from the query used to populate the AISelector.
This names the query field used to populate the AISelector text and search through the completer. By default this is the code column. If the named field does not match the query, the field is set to the code column.
|
virtualslot |
Set the current record in the AISelector by its "full text" value.
The result is only predictable if the full column is unique. Otherwise the result depends on the order rows are returned by the query and stored in the underlying data model. You have been warned.
|
virtualslot |
Set the current record in the AISelector by its internal id.
This works whether the pertinent record is active or not and is one of the primary motivators for @i having the AISelector. If pId is not found, the AISelector is set to id -1. and the line edit is cleared. Emits newId(int)
and valid(bool)
.
|
virtualinherited |
|
virtualinherited |
|
virtualslot |
|
virtualslot |
|
virtualslot |
|
overridevirtualslot |
|
virtualslot |
|
inlineinherited |
|
virtualslot |
|
virtualslot |
|
overrideprotectedvirtualslot |
|
virtual |
|
virtualslot |
|
virtualslot |
|
virtualslot |
|
virtual |
|
overrideprotectedvirtualslot |
|
virtualslot |
|
virtual |
|
inherited |
|
signal |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Generated on Mon Feb 17 2025 | xTuple ERP Programmer Reference, Version 6.2.0 |
|