|
LibEngsas
|
A delegate to display and edit foreign keys from SQL tables. More...
#include <edelegateforeignkey.h>
Inheritance diagram for EDelegateForeignKey:
Collaboration diagram for EDelegateForeignKey:Public Member Functions | |
| EDelegateForeignKey (QString table, QString matchColumn, QString resultColumn, QWidget *parent=0) | |
| EDelegateForeignKey (QString table, QString matchColumn, QString resultColumn, QString(*translator)(const QString), QWidget *parent=0) | |
| Constructor to supply an translator callback. More... | |
| void | setTranslator (QString(*translator)(const QString)) |
| void | reloadForeignKeys () |
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
Private Slots | |
| void | commitAndCloseEditor () |
| void | doCloseEditor () |
| void | updateCompleter () |
Private Member Functions | |
| void | init (QString table, QString matchColumn, QString resultColumn) |
Private Attributes | |
| QMap< QString, unsigned int > | mapOutIn |
| QString | resTable |
| QString | matchCol |
| QString | resCol |
| QSqlQueryModel * | resultModel |
| int | maxComboItems |
| int | maxCompleteItems |
| bool | useComboBox |
| bool | useCompleter |
| bool | useExtendedCompleter |
| QTimer * | timer |
| QString(* | translator )(const QString) |
A delegate to display and edit foreign keys from SQL tables.
If there are more than maxComboItems, it switches to QLineEdit with autocompletion if there are more than maxCompleteItems, it loads the completer after 3 inserted characters to reduce load.
To translate the mapped function, set the translator callback to an apropriate function with setTranslator() or the related constructor.
last one is not useable right now
use ESqlDatabase if it is available
The completer model does not support translations yet
| EDelegateForeignKey::EDelegateForeignKey | ( | QString | table, |
| QString | matchColumn, | ||
| QString | resultColumn, | ||
| QWidget * | parent = 0 |
||
| ) |
| table | the table where the foreignkey points to |
| matchColumn | the column which is the same in showed table and foreignkey table (at table table) |
| resultColumn | the column at the foreignkey table which holds the content to be displayed |
Here is the call graph for this function:| EDelegateForeignKey::EDelegateForeignKey | ( | QString | table, |
| QString | matchColumn, | ||
| QString | resultColumn, | ||
| QString(*)(const QString) | translator, | ||
| QWidget * | parent = 0 |
||
| ) |
Constructor to supply an translator callback.
Here is the call graph for this function:
|
privateslot |
Here is the call graph for this function:
Here is the caller graph for this function:| QWidget * EDelegateForeignKey::createEditor | ( | QWidget * | parent, |
| const QStyleOptionViewItem & | , | ||
| const QModelIndex & | |||
| ) | const |
Here is the call graph for this function:
|
privateslot |
Here is the caller graph for this function:
|
private |
Here is the call graph for this function:
Here is the caller graph for this function:| void EDelegateForeignKey::paint | ( | QPainter * | painter, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | const |
| void EDelegateForeignKey::reloadForeignKeys | ( | ) |
Here is the call graph for this function:
Here is the caller graph for this function:| void EDelegateForeignKey::setEditorData | ( | QWidget * | editor, |
| const QModelIndex & | index | ||
| ) | const |
| void EDelegateForeignKey::setModelData | ( | QWidget * | editor, |
| QAbstractItemModel * | model, | ||
| const QModelIndex & | index | ||
| ) | const |
| void EDelegateForeignKey::setTranslator | ( | QString(*)(const QString) | translator | ) |
Here is the call graph for this function:
|
privateslot |
|
private |
the QString, int order is needed, because the entries should be ordered after the string's
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Function callback to translate QString into QString.
|
private |
|
private |
|
private |
1.8.8