Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxqListDlog Class Reference

The TxqListDlog is a QDialog class used to contstruct a dialog frame around a QListBox to list text. More...

#include <TxqListDlog.h>

Inheritance diagram for TxqListDlog::

QDialog List of all members.

Public Slots

virtual bool close (bool alsoDelete)
 Close the dialog frame. More...


Signals

virtual void itemSelected (int idNumber)
 signal emitted whenver a item is selected. More...

virtual void cancelButtonPressed ()
 signal emitted whenever the Cancel button is pressed. More...

virtual void okButtonPressed ()
 Signal emitted whenever the Ok button is pressed. More...

virtual void applyButtonPressed ()
 Signal emitted whenever the Apply button is pressed. More...

virtual void applyButtonPressed (int)
 Signal emitted whenever the Apply button is pressed. More...


Public Methods

 TxqListDlog (QWidget *parent=0, const QString &okButtonText="&Ok", const QString &applyButtonText="&Apply", const QString &cancelButtonText="&Cancel", const char *name=0, bool modal=FALSE, WFlags fl=0)
 Constructs a TxqListDlog which is a child of 'parent', with the name 'name' and widget flags set to 'f'. More...

 ~TxqListDlog ()
 The destructor will destroy the object and free any allocated resources. More...

void insertItem (const QString s, bool bold=false)
 Insert a new item into the QListBox. More...

void selectItem (int idNumber, bool bold=false)
 Select the item with given id number and set its properties to bold. More...

void sort (bool order=true)
 Sort the list box in ascending or descending order. More...


Protected Slots

virtual void selectItem (QListBoxItem *listItem)
 Slot used whenver the return or mouse click is heard on an item. More...

virtual void okClicked ()
 Slot used whenever the Ok button is clicked. More...

virtual void applyClicked ()
 Slot used whenever the Apply button is clicked. More...

virtual void cancelClicked ()
 Slot used whenever the Cancel button is clicked. More...

virtual void closeWindow ()
 Slot used to close the window. More...


Protected Methods

QListBox* getListBox ()
 Get the list box. More...


Protected Attributes

QVBoxLayout* dlogLayout
 The layout for this QDialog class. More...

QHBoxLayout* buttonLayout
 The layout for the buttons. More...

QListBox* listBox
 The QListBox to set the text items. More...

QPushButton* buttonCancel
 The Cancel button. More...

QPushButton* buttonOk
 The Ok button. More...

QPushButton* buttonApply
 The Apply button. More...


Private Attributes

TXSTD::map<QString, int, less<
QString> > 
nameMap
 The index map of name and id number to be used in sorting. More...

TXSTD::map<int, int> idMap
 The index map of un-sorted id number and sorted id number such that int id = idMap[number] will return the sorted id number. More...

int masterIdNumber
 The master id number before sorting. More...

bool sorted
 The bool flag for sorting Set to true if the QListBox is sorted. More...


Detailed Description

The TxqListDlog is a QDialog class used to contstruct a dialog frame around a QListBox to list text.

The text is set to bold when highlighted by clicking on the text or hitting return. It adds a Ok, Apply, and Cancel button to the dialog frame. The text for these buttons can be changed.

Definition at line 40 of file TxqListDlog.h.


Constructor & Destructor Documentation

TxqListDlog::TxqListDlog ( QWidget * parent = 0,
const QString & okButtonText = "&Ok",
const QString & applyButtonText = "&Apply",
const QString & cancelButtonText = "&Cancel",
const char * name = 0,
bool modal = FALSE,
WFlags fl = 0 )
 

Constructs a TxqListDlog which is a child of 'parent', with the name 'name' and widget flags set to 'f'.

The dialog will by default be modeless, unless you set 'modal' to TRUE to construct a modal dialog.

Parameters:
parent   the TxqListDlog parent, default is 0
okButtonText   the text for the Ok button. Set to 0 for no button.
applyButtonText   the text for the Apply button. Set to 0 for no button.
cancelButtonText   the text for the Cancel button. Set to 0 for no button.
name   the name of this TxqListDlog.
model   flag to determine if dialog should be modal, default is false
wflags   the window flags are defaulted to 0

TxqListDlog::~TxqListDlog ( )
 

The destructor will destroy the object and free any allocated resources.


Member Function Documentation

void TxqListDlog::applyButtonPressed ( int ) [virtual, signal]
 

Signal emitted whenever the Apply button is pressed.

Signal includes the window Id number.

void TxqListDlog::applyButtonPressed ( ) [virtual, signal]
 

Signal emitted whenever the Apply button is pressed.

void TxqListDlog::applyClicked ( ) [protected, virtual, slot]
 

Slot used whenever the Apply button is clicked.

void TxqListDlog::cancelButtonPressed ( ) [virtual, signal]
 

signal emitted whenever the Cancel button is pressed.

void TxqListDlog::cancelClicked ( ) [protected, virtual, slot]
 

Slot used whenever the Cancel button is clicked.

bool TxqListDlog::close ( bool alsoDelete ) [virtual, slot]
 

Close the dialog frame.

void TxqListDlog::closeWindow ( ) [protected, virtual, slot]
 

Slot used to close the window.

QListBox * TxqListDlog::getListBox ( ) [inline, protected]
 

Get the list box.

Returns:
the QListBox object

Definition at line 164 of file TxqListDlog.h.

void TxqListDlog::insertItem ( const QString s,
bool bold = false )
 

Insert a new item into the QListBox.

Parameters:
bold   set to true if this item is bold

void TxqListDlog::itemSelected ( int idNumber ) [virtual, signal]
 

signal emitted whenver a item is selected.

Parameters:
idNum   the id number of the item.

void TxqListDlog::okButtonPressed ( ) [virtual, signal]
 

Signal emitted whenever the Ok button is pressed.

void TxqListDlog::okClicked ( ) [protected, virtual, slot]
 

Slot used whenever the Ok button is clicked.

void TxqListDlog::selectItem ( QListBoxItem * listItem ) [protected, virtual, slot]
 

Slot used whenver the return or mouse click is heard on an item.

Parameters:
listItem   the list item selected.

void TxqListDlog::selectItem ( int idNumber,
bool bold = false )
 

Select the item with given id number and set its properties to bold.

Parameters:
idNumber   the ID number of the item to select.
bold   set true if the item text is bold.

void TxqListDlog::sort ( bool order = true )
 

Sort the list box in ascending or descending order.

Parameters:
order   if TRUE sorts the items in ascending order, otherwise sorts in descending order.


Member Data Documentation

QPushButton * TxqListDlog::buttonApply [protected]
 

The Apply button.

Definition at line 194 of file TxqListDlog.h.

QPushButton * TxqListDlog::buttonCancel [protected]
 

The Cancel button.

Definition at line 184 of file TxqListDlog.h.

QHBoxLayout * TxqListDlog::buttonLayout [protected]
 

The layout for the buttons.

Definition at line 174 of file TxqListDlog.h.

QPushButton * TxqListDlog::buttonOk [protected]
 

The Ok button.

Definition at line 189 of file TxqListDlog.h.

QVBoxLayout * TxqListDlog::dlogLayout [protected]
 

The layout for this QDialog class.

Definition at line 169 of file TxqListDlog.h.

TXSTD::map< int, int > TxqListDlog::idMap [private]
 

The index map of un-sorted id number and sorted id number such that int id = idMap[number] will return the sorted id number.

Definition at line 208 of file TxqListDlog.h.

QListBox * TxqListDlog::listBox [protected]
 

The QListBox to set the text items.

Definition at line 179 of file TxqListDlog.h.

int TxqListDlog::masterIdNumber [private]
 

The master id number before sorting.

Definition at line 213 of file TxqListDlog.h.

TXSTD::map< QString, int, less< QString > > TxqListDlog::nameMap [private]
 

The index map of name and id number to be used in sorting.

Definition at line 202 of file TxqListDlog.h.

bool TxqListDlog::sorted [private]
 

The bool flag for sorting Set to true if the QListBox is sorted.

Definition at line 219 of file TxqListDlog.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.