Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxTable Class Reference

#include <QtxTable.h>

Inheritance diagram for QtxTable:
Inheritance graph

Public Slots

virtual void hide ()
 
virtual void setHeaderEditable (Orientation, bool)
 

Signals

void headerEdited (QHeader *, int)
 
void headerEdited (Orientation, int)
 

Public Member Functions

 QtxTable (QWidget *=0, const char *=0)
 
 QtxTable (int, int, QWidget *=0, const char *=0)
 
virtual ~QtxTable ()
 
bool headerEditable (Orientation) const
 
bool editHeader (Orientation, const int)
 
void endEditHeader (const bool=true)
 
virtual bool eventFilter (QObject *, QEvent *)
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *)
 
virtual bool beginHeaderEdit (Orientation, const int)
 
virtual void endHeaderEdit (const bool=true)
 
bool isHeaderEditing () const
 
virtual QWidgetcreateHeaderEditor (QHeader *, const int, const bool=true)
 
virtual void setHeaderContentFromEditor (QHeader *, const int, QWidget *)
 
QHeader * header (Orientation o) const
 

Private Slots

void onScrollBarMoved (int)
 
void onHeaderSizeChange (int, int, int)
 

Private Member Functions

void updateHeaderEditor ()
 
void beginHeaderEdit (Orientation, const QPoint &)
 
QRect headerSectionRect (QHeader *, const int) const
 

Private Attributes

QWidgetmyHeaderEditor
 
QHeader * myEditedHeader
 
int myEditedSection
 
QMap< int, bool > myHeaderEditable
 

Constructor & Destructor Documentation

QtxTable::QtxTable ( QWidget parent = 0,
const char *  name = 0 
)

Constructor

References onHeaderSizeChange(), and onScrollBarMoved().

QtxTable::QtxTable ( int  numRows,
int  numCols,
QWidget parent = 0,
const char *  name = 0 
)

Constructor

References onHeaderSizeChange(), and onScrollBarMoved().

QtxTable::~QtxTable ( )
virtual

Destructor

Member Function Documentation

bool QtxTable::beginHeaderEdit ( Orientation  o,
const int  section 
)
protectedvirtual

Starts edition of header

Parameters
o- header orientation
sec- column/row

References createHeaderEditor(), endHeaderEdit(), header(), headerEditable(), headerSectionRect(), Horizontal, myEditedHeader, myEditedSection, myHeaderEditor, and updateHeaderEditor().

void QtxTable::beginHeaderEdit ( Orientation  o,
const QPoint &  p 
)
private

Starts edition of header

Parameters
o- header orientation
p- point

References beginHeaderEdit(), header(), and Horizontal.

QWidget * QtxTable::createHeaderEditor ( QHeader *  hdr,
const int  sec,
const bool  init = true 
)
protectedvirtual

Creates and

Returns
header editor
Parameters
hdr- header
sec- column/row
init- init editor with value

Reimplemented in QDS_Table.

bool QtxTable::editHeader ( Orientation  o,
const int  sec 
)

Starts edition of header

Parameters
o- header orientation
sec- column/row

References beginHeaderEdit().

void QtxTable::endEditHeader ( const bool  accept = true)

Finishes edition of header

Parameters
accept- whether new value must be accepted

References endHeaderEdit().

void QtxTable::endHeaderEdit ( const bool  accept = true)
protectedvirtual

Finishes edition of header

Parameters
accept- whether new value must be accepted

References headerEdited(), Horizontal, isHeaderEditing(), myEditedHeader, myEditedSection, myHeaderEditor, setHeaderContentFromEditor(), and Vertical.

bool QtxTable::eventFilter ( QObject o,
QEvent e 
)
virtual

Custom event filter Starts edition of header by double click Finishes edition by escape/return/enter pressing

References beginHeaderEdit(), endHeaderEdit(), Horizontal, isHeaderEditing(), myHeaderEditor, and Vertical.

QHeader * QtxTable::header ( Orientation  o) const
protected
Returns
header
Parameters
o- orientation

References Horizontal.

bool QtxTable::headerEditable ( Orientation  o) const
Returns
true if header is editable
Parameters
o- header orientation

References myHeaderEditable.

void QtxTable::headerEdited ( QHeader *  ,
int   
)
signal
void QtxTable::headerEdited ( Orientation  ,
int   
)
signal
QRect QtxTable::headerSectionRect ( QHeader *  hdr,
const int  sec 
) const
private
Returns
rectangle of header section
Parameters
hdr- header
sec- column/row
void QtxTable::hide ( )
virtualslot

Finishes edition and hides table

References endHeaderEdit().

bool QtxTable::isHeaderEditing ( ) const
protected
Returns
true if header is being edited

References myEditedHeader, myEditedSection, and myHeaderEditor.

void QtxTable::onHeaderSizeChange ( int  ,
int  ,
int   
)
privateslot

SLOT: called on header size changing

References myEditedHeader, and updateHeaderEditor().

void QtxTable::onScrollBarMoved ( int  )
privateslot

SLOT: called on scroll

References updateHeaderEditor().

void QtxTable::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Custom resize event handler

References updateHeaderEditor().

void QtxTable::setHeaderContentFromEditor ( QHeader *  hdr,
const int  sec,
QWidget editor 
)
protectedvirtual

Initialize editor with value

Parameters
hdr- header
sec- column/row
editor- editor

Reimplemented in QDS_Table.

void QtxTable::setHeaderEditable ( Orientation  o,
bool  on 
)
virtualslot

Changes editable state of header

Parameters
o- header orientation
on- new state

References endHeaderEdit(), header(), headerEditable(), myEditedHeader, and myHeaderEditable.

void QtxTable::updateHeaderEditor ( )
private

Updates header editor

References headerSectionRect(), myEditedHeader, myEditedSection, and myHeaderEditor.

Member Data Documentation

QHeader* QtxTable::myEditedHeader
private
int QtxTable::myEditedSection
private
QMap<int, bool> QtxTable::myHeaderEditable
private
QWidget* QtxTable::myHeaderEditor
private

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