casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes
casa::TBSorter Class Reference

Widget to configure a multi-field sort ordering. More...

#include <TBSorter.qo.h>

List of all members.

Signals

void sortEntered (vector< pair< String, bool > > &sort)
 sortEntered is emitted when the "Sort" button is clicked.

Public Member Functions

 TBSorter (vector< String > &cols, vector< pair< String, bool > > *sort=NULL, QWidget *parent=NULL)
 Constructor that takes the list of fields, an optional current sort order to display, and an optional parent.
 ~TBSorter ()

Private Slots

void add ()
 Slot for the "Add" button that adds the selected row in the field list to the bottom of the sort list.
void addAll ()
 Slot for the "Add All" button that adds all rows in the field list to the bottom of the sort list.
void remove ()
 Slot for the "Remove" button that removes the selected row from the sort list and returns it to its previous position in the field list.
void removeAll ()
 Slot for the "Remove All" button that removes all the rows from the sort list and returns them to the field list.
void tableIndexChanged (int row)
 Slot for when the currently selected index in the sort list is changed.
void moveUp ()
 Slot for the "Move Up" button that moves the selected row in the sort list up one position.
void moveDown ()
 Slot for the "Move Down" button that moves the selected row in the sort list down one position.
void acceptButton ()
 Slot for the button to accept the current sort order and emit the sortEntered() signal.

Private Member Functions

void add (int row, bool asc=true)
 Adds the specified field from the field list to the sort list.
void remove (int row)
 Removes the specified field from the sort list.
void swapRows (int r1, int r2)
 Swaps the two indicated rows in the sort list.

Private Attributes

vector< Stringcols
 The sortable fields.

Detailed Description

Widget to configure a multi-field sort ordering.

Synopsis

TBSorter allows the user to create an ordered list of fields for sorting. Each field in the list also has a checkbox to indicate whether the sort on that field should be ascending or not. Once a sort order has been entered a signal is emitted; it is the parent's/caller's responsibility to connect the signal and implement the sort.

Definition at line 53 of file TBSorter.qo.h.


Constructor & Destructor Documentation

casa::TBSorter::TBSorter ( vector< String > &  cols,
vector< pair< String, bool > > *  sort = NULL,
QWidget *  parent = NULL 
)

Constructor that takes the list of fields, an optional current sort order to display, and an optional parent.

If parent is NULL, the widget is displayed as a dialog; otherwise it is displayed in the parent.


Member Function Documentation

void casa::TBSorter::acceptButton ( ) [private, slot]

Slot for the button to accept the current sort order and emit the sortEntered() signal.

void casa::TBSorter::add ( int  row,
bool  asc = true 
) [private]

Adds the specified field from the field list to the sort list.

void casa::TBSorter::add ( ) [private, slot]

Slot for the "Add" button that adds the selected row in the field list to the bottom of the sort list.

void casa::TBSorter::addAll ( ) [private, slot]

Slot for the "Add All" button that adds all rows in the field list to the bottom of the sort list.

void casa::TBSorter::moveDown ( ) [private, slot]

Slot for the "Move Down" button that moves the selected row in the sort list down one position.

void casa::TBSorter::moveUp ( ) [private, slot]

Slot for the "Move Up" button that moves the selected row in the sort list up one position.

void casa::TBSorter::remove ( int  row) [private]

Removes the specified field from the sort list.

void casa::TBSorter::remove ( ) [private, slot]

Slot for the "Remove" button that removes the selected row from the sort list and returns it to its previous position in the field list.

void casa::TBSorter::removeAll ( ) [private, slot]

Slot for the "Remove All" button that removes all the rows from the sort list and returns them to the field list.

void casa::TBSorter::sortEntered ( vector< pair< String, bool > > &  sort) [signal]

sortEntered is emitted when the "Sort" button is clicked.

The sort parameter contains the ordered list of fields and ascending bools.

void casa::TBSorter::swapRows ( int  r1,
int  r2 
) [private]

Swaps the two indicated rows in the sort list.

void casa::TBSorter::tableIndexChanged ( int  row) [private, slot]

Slot for when the currently selected index in the sort list is changed.


Member Data Documentation

vector<String> casa::TBSorter::cols [private]

The sortable fields.

Definition at line 73 of file TBSorter.qo.h.


The documentation for this class was generated from the following file: