The ParameterWidget provides a consistent user and programming interface for managing query criteria. More...
#include <parameterwidget.h>
Public Types | |
enum | ParameterWidgetTypes { Crmacct, User, Text, Date, XComBox, Contact, Multiselect, GLAccount, Exists, CheckBox, Project, Customer, Site, Vendor, Item, Employee, Shipto, SalesOrder, WorkOrder, PurchaseOrder, TransferOrder } |
Public Slots | |
void | addParam () |
void | append (QString pName, QString pParam, enum ParameterWidgetTypes pType=Text, QVariant pDefault=QVariant(), bool pRequired=false, QString pExtraInfo=QString()) |
Add a new filter to the set of available filters. More... | |
void | appendComboBox (QString pName, QString pParam, int pType, QVariant pDefault=QVariant(), bool pRequired=false) |
Add a new XComboBox-based filter to the set of available filters. More... | |
void | appendComboBox (QString pName, QString pParam, QString pQuery, QVariant pDefault=QVariant(), bool pRequired=false) |
Add a new XComboBox-based filter to the set of available filters. More... | |
void | applySaved (int pId=0, int filter_id=0) |
void | changeFilterObject (int index) |
void | clearFilters () |
void | removeParam (int) |
void | save () |
void | setDefault (QString pName, QVariant pDefault=QVariant(), bool pAutoApply=false) |
void | setEnabled (QString pName, bool pEnabled) |
void | setFiltersDefault () |
void | setFiltersVisabiltyPreference () |
void | setFiltersVisible (bool visible) |
void | setSavedFilters (int defaultId=-1) |
void | setSavedFiltersIndex (QString) |
void | setType (QString, QString, ParameterWidgetTypes=Text, QVariant pDefault=QVariant(), QVariant extraInfo=QVariant()) |
void | setXComboBoxType (QString, QString, enum XComboBox::XComboBoxTypes, QVariant pDefault=QVariant()) |
void | setXComboBoxType (QString, QString, QString, QVariant pDefault=QVariant()) |
void | sManageFilters () |
void | storeFilterValue (int pId=-1, QObject *filter=0) |
void | toggleSave () |
Signals | |
void | cleared () |
void | filterChanged () |
void | filterSetSaved () |
void | updated () |
Public Member Functions | |
ParameterWidget (QWidget *pParent, const char *=0) | |
Create a new Parameter Widget. More... | |
~ParameterWidget () | |
void | appendValue (ParameterList &) |
Add name/value pairs to the input ParameterList to reflect the current user selections. More... | |
Q_INVOKABLE void | applyDefaultFilterSet () |
Find the default filter set for the ParameterWidget with the current parent and apply it. More... | |
Q_INVOKABLE QString | filter () |
Q_INVOKABLE ParameterList | parameters () |
Q_INVOKABLE int | paramIndex (QString pName) |
void | retranslateUi (QWidget *ParameterWidget) |
void | retranslateUi (QWidget *ParameterWidget) |
void | setupUi (QWidget *ParameterWidget) |
void | setupUi (QWidget *ParameterWidget) |
Public Attributes | |
QToolButton * | _addFilterRow |
QPushButton * | _filterButton |
QFrame * | _filterGroup |
XComboBox * | _filterList |
QLabel * | _filterListLit |
QGridLayout * | _filtersLayout |
QHBoxLayout * | _footerLayout |
QSpacerItem * | _footerSpacer |
QHBoxLayout * | _headerLayout |
QSpacerItem * | _headerSpacer |
QPushButton * | _manageButton |
QPushButton * | _saveButton |
QGridLayout * | gridLayout |
QGridLayout * | gridLayout_2 |
QVBoxLayout * | verticalLayout |
QSpacerItem * | verticalSpacer |
Protected Slots | |
void | resetMultiselect (QTableWidgetItem *item) |
Protected Member Functions | |
bool | containsUsedType (QString) |
int | getFilterIndex (const QWidget *filterwidget) |
QWidget * | getFilterWidget (const int index) |
QString | getParameterTypeKey (QString) |
virtual QString | preferencePrefix () const |
void | setSelectedFilter (int filter_id) |
virtual void | showEvent (QShowEvent *) |
The ParameterWidget provides a consistent user and programming interface for managing query criteria.
The ParameterWidget can be used to set filtering criteria to apply to MetaSQL queries. The application developer defines what criteria can be used (e.g. filter by a date range), what the default values should be, if any, and which criteria are mandatory. The user then chooses which criteria to actually use at runtime and supplies values (e.g. 'January 1, 2010' through 'December 31, 2010').
It is the application developer's responsibility to ensure that the user's selections are honored by the query.
Specific sets of filtering criteria can be saved, reused, and shared between users. The details of the filter can be hidden from view or made visible, allowing for efficient use of screen real estate.
If application preferences are available, the most recently selected filter will saved when the parent window closes and will be reselected when the window is next opened.
ParameterWidget::ParameterWidget | ( | QWidget * | pParent, |
const char * | pName = 0 |
||
) |
Create a new Parameter Widget.
pParent | The parent of this widget |
pName | The object name to assign to this widget |
ParameterWidget::~ParameterWidget | ( | ) |
|
slot |
|
slot |
Add a new filter to the set of available filters.
pName | The user-visible name for this filter to distinguish it from other filters in the same set |
pParam | The name to use for the parameter in the ParameterList |
pType | The type of widget for the user to enter a criterion in |
pDefault | The default value to use for this parameter |
pRequired | Required parameters cannot be removed from the filter set |
pExtraInfo | A query string to use if pType indicates a combo box or multiselect |
|
slot |
Add a new XComboBox-based filter to the set of available filters.
pName | The user-visible name for this filter to distinguish it from other filters in the same set |
pParam | The name to use for the parameter in the ParameterList |
pType | Set the XComboBox to use the corresponding XComboBox::XComboBoxTypes value |
pDefault | The default internal id to select for this XComboBox |
pRequired | Required parameters cannot be removed from the filter set |
|
slot |
Add a new XComboBox-based filter to the set of available filters.
pName | The user-visible name for this filter to distinguish it from other filters in the same set |
pParam | The name to use for the parameter in the ParameterList |
pQuery | Set the XComboBox to populate itself with this query |
pDefault | The default internal id to select for this XComboBox |
pRequired | Required parameters cannot be removed from the filter set |
void ParameterWidget::appendValue | ( | ParameterList & | pParams | ) |
Add name/value pairs to the input ParameterList to reflect the current user selections.
The ParameterList passed in to this method is modified to reflect the current selections. Parameters already in the list have their associated values changed and parameters not in the list are added. No name/value pairs are removed from the list.
This should be used carefully, as cached ParameterLists may have name/value pairs that the caller does not expect.
[in,out] | pParams | The ParameterList to modify |
void ParameterWidget::applyDefaultFilterSet | ( | ) |
Find the default filter set for the ParameterWidget with the current parent and apply it.
This method searches for the default filter set based on the QObject::objectName of the parent and the QObject::objectName of this ParameterWidget instance. If it is found, then this filter set is applied.
|
slot |
|
slot |
|
signal |
|
slot |
|
protected |
QString ParameterWidget::filter | ( | ) |
Returns a text based list separated by line feeds of parameter names and selected values. Can be useful when passed to printed reports as a header description of what filter has been applied to the presented data.
|
signal |
|
signal |
|
protected |
|
protected |
|
protected |
ParameterList ParameterWidget::parameters | ( | ) |
int ParameterWidget::paramIndex | ( | QString | pName | ) |
Returns the index of an appended parameter definition of pName.
|
protectedvirtual |
|
slot |
|
protectedslot |
|
inlineinherited |
|
inlineinherited |
|
slot |
|
slot |
Set the default value on an existing parameter pName to pDefault. If pDefault is not passed or 0 then the previous default, if any, will be removed. if pAutoApply is true, then the default filter set will be automatically applied.
|
slot |
Enable or disable an existing parameter pName to pEnabled. Useful if you want a specific value to be forced based on privilege control or some other specific criteria that would limit the user's selection ability. Is effective the next time a user instantiates the parameter.
|
slot |
Sets the current filter as the default for the parent object it resides in.
|
slot |
|
slot |
|
slot |
Sets a saved filter set with Id defaultId to the currently selected filter. If no pDefaultId is provided the default filter will be used.
|
slot |
|
protected |
|
slot |
|
inlineinherited |
|
inlineinherited |
|
slot |
|
slot |
|
protectedvirtual |
|
slot |
|
slot |
|
slot |
|
signal |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Generated on Mon May 3 2021 | xTuple ERP Programmer Reference, Version 4.12.0 | 1.8.17 |