casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
casa::QtIndexChooser Class Reference

Widget that allows the user to pick an index, with a number of choices on how the index can be chosen. More...

#include <QtIndexChooser.qo.h>

Inheritance diagram for casa::QtIndexChooser:

Public Types

enum  Type {
  NAME,
  ROW_COL,
  INDEX
}
 Static //. More...
 

Signals

void indexChanged (unsigned int newIndex)
 Emitted when the index changes, and contains the new index value. More...
 

Public Member Functions

 QtIndexChooser (Type type, QWidget *parent=NULL)
 Non-Static //. More...
 
 ~QtIndexChooser ()
 Destructor. More...
 
unsigned int index () const
 Returns the currently set index on the widget. More...
 
void setType (Type type, bool resizeToHint=true)
 Sets the type to the given, resizing if indicated. More...
 
void setName (unsigned int index, const casacore::String &name)
 Only valid if type is NAME. More...
 
void setNames (const std::vector< casacore::String > &names)
 Only valid if type is NAME. More...
 
void setNames (const std::vector< unsigned int > &indices, const std::vector< casacore::String > &names)
 
void setNames (const std::map< unsigned int, casacore::String > &names)
 
void setNames (const std::map< casacore::String, unsigned int > &names)
 
void setRowsCols (unsigned int nRows, unsigned int nCols)
 Only valid if type is ROW_COL. More...
 
void setMaxIndex (unsigned int maxIndex)
 Only valid if type is INDEX. More...
 

Private Slots

void indexChanged_ ()
 Slot for when the index changes. More...
 

Private Member Functions

void setupNameChooser ()
 Sets up the name chooser for the currently set name/index mappings. More...
 

Private Attributes

Type itsType_
 Type. More...
 
QMap< QString, unsigned int > itsNames_
 Name/Index map. More...
 

Detailed Description

Widget that allows the user to pick an index, with a number of choices on how the index can be chosen.

(See Type enum.)

Definition at line 40 of file QtIndexChooser.qo.h.

Member Enumeration Documentation

Static //.

The type of the chooser; i.e., how the user picks the index.

Enumerator
NAME 
ROW_COL 
INDEX 

Definition at line 47 of file QtIndexChooser.qo.h.

Constructor & Destructor Documentation

casa::QtIndexChooser::QtIndexChooser ( Type  type,
QWidget *  parent = NULL 
)

Non-Static //.

Constructor which takes the type and an optional parent widget.

casa::QtIndexChooser::~QtIndexChooser ( )

Destructor.

Member Function Documentation

unsigned int casa::QtIndexChooser::index ( ) const

Returns the currently set index on the widget.

Referenced by indexChanged_().

void casa::QtIndexChooser::indexChanged ( unsigned int  newIndex)
signal

Emitted when the index changes, and contains the new index value.

Referenced by indexChanged_().

void casa::QtIndexChooser::indexChanged_ ( )
inlineprivateslot

Slot for when the index changes.

Definition at line 105 of file QtIndexChooser.qo.h.

References index(), and indexChanged().

void casa::QtIndexChooser::setMaxIndex ( unsigned int  maxIndex)

Only valid if type is INDEX.

Sets the maximum index (inclusive).

void casa::QtIndexChooser::setName ( unsigned int  index,
const casacore::String name 
)

Only valid if type is NAME.

Sets the name for the given index and makes it available in the GUI.

void casa::QtIndexChooser::setNames ( const std::vector< casacore::String > &  names)

Only valid if type is NAME.

Sets the available names to the given.

void casa::QtIndexChooser::setNames ( const std::vector< unsigned int > &  indices,
const std::vector< casacore::String > &  names 
)
void casa::QtIndexChooser::setNames ( const std::map< unsigned int, casacore::String > &  names)
void casa::QtIndexChooser::setNames ( const std::map< casacore::String, unsigned int > &  names)
void casa::QtIndexChooser::setRowsCols ( unsigned int  nRows,
unsigned int  nCols 
)

Only valid if type is ROW_COL.

Sets the number of rows and columns.

void casa::QtIndexChooser::setType ( Type  type,
bool  resizeToHint = true 
)

Sets the type to the given, resizing if indicated.

void casa::QtIndexChooser::setupNameChooser ( )
private

Sets up the name chooser for the currently set name/index mappings.

Member Data Documentation

QMap<QString, unsigned int> casa::QtIndexChooser::itsNames_
private

Name/Index map.

Definition at line 97 of file QtIndexChooser.qo.h.

Type casa::QtIndexChooser::itsType_
private

Type.

Definition at line 94 of file QtIndexChooser.qo.h.


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