ICS

QicsTable Documentation Set

QicsColumnHeader Class Reference

The column header object for the table. More...

#include <QicsColumnHeader.h>

Inherits QicsHeader.

List of all members.

Column Header Properties

int numRows

Common Header Properties

bool allowUserResize
bool allowHeaderResize
bool allowUserMove
QString autoHeaderNamingMask

Public Slots

void setNumRows (int num)
void setAllowUserResize (bool b)
void setAllowUserMove (bool b)
void setAllowHeaderResize (bool b)
void setAutoHeaderNamingMask (QString mask)

Signals

void sizeChange (int idx, int old_size, int new_size, QicsHeaderType type)
void resizeInProgress (int idx, int position, QicsHeaderType type)
void gripDoubleClicked (int idx, int button, QicsHeaderType type)

Public Member Functions

 QicsColumnHeader (QicsTable *table)
virtual ~QicsColumnHeader ()
int numRows (void) const
void setDefaultRowHeightInPixels (int height)
void setDefaultRowHeightInChars (int height)
void setDefaultColumnWidthInPixels (int width)
void setDefaultColumnWidthInChars (int width)
bool allowUserResize (void) const
bool allowHeaderResize (void) const
bool allowUserMove (void) const
QString autoHeaderNamingMask (void) const
virtual QicsRowrowRef (int rownum) const
virtual QicsRowrow (int idx, bool follow_model=true) const
virtual QicsColumncolumnRef (int colnum) const
virtual QicsColumncolumn (int idx, bool follow_model=true) const
virtual QicsCellcellRef (int rownum, int colnum) const
virtual QicsCellcell (int row, int col, bool follow_model=true) const

Protected Slots

void connectGrid (QicsScreenGrid *grid)

Protected Member Functions

 QicsColumnHeader (QicsGridInfo *info, QObject *parent=0, bool forward_signals=false)

Protected Attributes

QicsCellmyCell
QicsRowmyRow
QicsColumnmyColumn

Friends

class QicsTableCommon


Detailed Description

The column header object for the table.

QicsRowHeader is the the programmer's interface to the header object that appears at the top and/or bottom of each row in the QicsTable widget. All attributes of individual cells can be set using this class.

QicsRowHeader is a flyweight class representing a single header in the table. These objects are created directly (via the public constructor) or indirectly (via QicsTable::rowHeader() or QicsTable::rowHeaderRef()) when needed.

Persistent objects, created by the public constructor or by QicsTable::rowHeader() are valid until they are explicitly destroyed, or until the table itself is destroyed.

If you wish to modify or query a row, column, or cell in the column header, you must first obtain a reference to the object by calling cellRef(), rowRef(), or columnRef() (or, if you need a newly allocated object, cell(), row(), or column()).

 // We want to set the label of the first cell in the column header

 table->columnHeaderRef().cellRef(0,0).setLabel(QString("The Label"));

Column headers can have more than one row. To change the number of rows in a column header, use setNumRows(). Once you have added rows to the column header, you may add data to the new cells, set labels, and otherwise modify the cells.

 // We want to add a row to the column header, and set the new row's
 // background color to red

 table->columnHeaderRef().setNumRows(2);
 table->columnHeaderRef().rowRef(1).setBackgroundColor(red);


Constructor & Destructor Documentation

QicsColumnHeader::QicsColumnHeader ( QicsTable table  ) 

Constructor for the class.

Parameters:
table the cell's table
Note:
The macro CREATE_OBJS_WITH_QICSTABLE must be defined in order to use this constructor. If you are using qmake, you can add "DEFINES=CREATE_OBJS_WITH_QICSTABLE" to your application's .pro file.

virtual QicsColumnHeader::~QicsColumnHeader (  )  [virtual]

Virtual destructor for the class


Member Function Documentation

bool QicsHeader::allowHeaderResize ( void   )  const [inherited]

Returns the header's current policy regarding row or column header resizing. If true, users may resize row or column headers(row header horizontally and column header vertically). If false, no resizing is allowed.

See also:
setAllowHeaderResize()

bool QicsHeader::allowUserMove ( void   )  const [inherited]

Returns the header's current policy regarding user row or column movement. If true, users may move rows or columns (depending on the type of header). If false, no movement is allowed.

See also:
setAllowUserMove()

bool QicsHeader::allowUserResize ( void   )  const [inherited]

Returns the header's current policy regarding user resizing. If true, users may resize rows or columns (depending on the type of header). If false, no resizing is allowed.

See also:
setAllowUserResize()

QString QicsHeader::autoHeaderNamingMask ( void   )  const [inline, inherited]

Returns the header's current auto naming mask.

See also:
setAutoHeaderNamingMask()

virtual QicsCell* QicsHeader::cell ( int  row,
int  col,
bool  follow_model = true 
) const [virtual, inherited]

Returns a newly allocated cell object for cell (row, col ) of the header. If follow_model is true, the cell object will always refer to the cell in the data model that is currently being displayed in cell (rownum, colnum), even if rows and columns of the table are reordered. If follow_model is false, the cell will always refer to the visual cell (rownum, colnum), but the underlying cell in the data model may change.

virtual QicsCell& QicsHeader::cellRef ( int  rownum,
int  colnum 
) const [virtual, inherited]

Returns a reference to an internal flyweight QicsCell object that refers to cell (rownum, colnum) of the header.

virtual QicsColumn* QicsHeader::column ( int  idx,
bool  follow_model = true 
) const [virtual, inherited]

Returns a newly allocated column object for column idx of the header. If follow_model is true, the column object will always refer to the column in the data model that is currently being displayed in column colnum, even if columns of the table are reordered. If follow_model is false, the column will always refer to the visual column colnum, but the underlying column in the data model may change.

virtual QicsColumn& QicsHeader::columnRef ( int  colnum  )  const [virtual, inherited]

Returns a reference to an internal flyweight QicsColumn object that refers to row colnum of the header.

void QicsHeader::gripDoubleClicked ( int  idx,
int  button,
QicsHeaderType  type 
) [signal, inherited]

Signals when the user double clicks in the "grip" area between two cells.

Parameters:
idx the index of the row or column to the top/left of the grip that was double clicked in
button the button that was clicked
type row or column header

int QicsColumnHeader::numRows ( void   )  const

Returns the number of rows in the column header.

void QicsHeader::resizeInProgress ( int  idx,
int  position,
QicsHeaderType  type 
) [signal, inherited]

Signals when the user is in the process of interactively resizing a cell by dragging the mouse.

Parameters:
idx the index of the row or column that is being resized
position the X (if a column header) or Y (if a row header) location of the cursor in the grid
type row or column header

virtual QicsRow* QicsHeader::row ( int  idx,
bool  follow_model = true 
) const [virtual, inherited]

Returns a newly allocated row object for row idx of the header. If follow_model is true, the row object will always refer to the row in the data model that is currently being displayed in row rownum, even if rows of the table are reordered. If follow_model is false, the row will always refer to the visual row rownum, but the underlying row in the data model may change.

virtual QicsRow& QicsHeader::rowRef ( int  rownum  )  const [virtual, inherited]

Returns a reference to an internal flyweight QicsRow object that refers to row rownum of the header.

void QicsHeader::setAllowHeaderResize ( bool  b  )  [slot, inherited]

Sets the header's current policy regarding header resizing. If true, users may resize row or column headers (depending on the type of header). If false, no resizing is allowed.

See also:
allowHeaderResize()

void QicsHeader::setAllowUserMove ( bool  b  )  [slot, inherited]

Sets the header's current policy regarding user row or column movement. If true, user may move rows or columns (depending on the type of header).User move operations work like all drag&drop operations in QicsTable - with Middle button of mouse. If false, no movement is allowed.

See also:
allowUserMove()

void QicsHeader::setAllowUserResize ( bool  b  )  [slot, inherited]

Sets the header's current policy regarding user resizing. If true, users may resize rows or columns (depending on the type of header). If false, no resizing is allowed.

See also:
allowUserResize()

void QicsHeader::setAutoHeaderNamingMask ( QString  mask  )  [inline, slot, inherited]

Sets the header's current auto naming mask

See also:
autoHeaderNamingMask()

void QicsColumnHeader::setDefaultColumnWidthInChars ( int  width  ) 

Sets the default column width for collumn header to width character units for the the entire table.

void QicsColumnHeader::setDefaultColumnWidthInPixels ( int  width  ) 

Sets the default column width for collumn header to width pixels for the the entire table.

void QicsColumnHeader::setDefaultRowHeightInChars ( int  height  ) 

Sets the default row height for collumn header to height character units (i.e. lines) for the the entire table.

void QicsColumnHeader::setDefaultRowHeightInPixels ( int  height  ) 

Sets the default row height for collumn header to height pixels for the the entire table.

void QicsColumnHeader::setNumRows ( int  num  )  [slot]

Sets the number of rows in the column header object.

void QicsHeader::sizeChange ( int  idx,
int  old_size,
int  new_size,
QicsHeaderType  type 
) [signal, inherited]

Signals when the user has finished resizing a row or column.

Parameters:
idx the index of the row or column that was resized
old_size the old height/width of the row/column
new_size the new height/width of the row/column
type row or column header


Member Data Documentation

bool QicsHeader::allowHeaderResize [inherited]

Specifies the header's current policy regarding header resizing. If true, users may resize row or column headers (depending on the type of header). If false, no resizing is allowed.

The default value of this property is true.

bool QicsHeader::allowUserMove [inherited]

Specifies the header's current policy regarding user movement of rows or columns. User move operations work like all drag&drop operations in QicsTable - with Middle button of mouse. If true, user may move rows or columns (depending on the type of header). If false, no movement is allowed. The default value of this property is false.

bool QicsHeader::allowUserResize [inherited]

Specifies the header's current policy regarding user resizing. If true, users may resize rows or columns (depending on the type of header). If false, no resizing is allowed.

The default value of this property is true.

QString QicsHeader::autoHeaderNamingMask [inherited]

Specifies the header cells default appearance if the name isn't specified. The possible special values user might want to use is column%, row% - inserts column and row indexes respectively mcolumn%, mrow% - inserts model column and model row indexes respectively The default value of this property is column% for column header and row% for row header.

int QicsColumnHeader::numRows

Specifies the number of rows in the column header.

The default value of this property is 1.


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

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.