OpendTect 8.0
Loading...
Searching...
No Matches
uiTableView Class Reference

#include <uitableview.h>

Inheritance diagram for uiTableView:
[legend]

Public Types

enum  ResizeMode { Interactive =0 , Fixed =2 , Stretch =1 , ResizeToContents =3 }
 
enum  SelectionBehavior { SelectItems , SelectRows , SelectColumns }
 
enum  SelectionMode { SingleSelection =1 , ExtendedSelection =3 , NoSelection =0 }
 
- Public Types inherited from ObjectWithName
typedef OD::String name_type
 

Public Member Functions

 uiTableView (uiParent *, const char *nm)
 
 ~uiTableView ()
 
void beginUndoGroup ()
 
void clearSelection ()
 
void clearUndo ()
 
const RowCol & currentCell () const
 
void enableUndo (bool yn)
 
void endUndoGroup ()
 
TableModel::CellType getCellType (int col) const
 
TableModel * getModel ()
 
const TableModel * getModel () const
 
RowCol getNotifCell () const
 
bool getSelectedCells (TypeSet< RowCol > &, bool mappedtosource) const
 
bool getSelectedColumns (TypeSet< int > &) const
 
bool getSelectedColumns (TypeSet< int > &, bool mappedtosource) const
 
bool getSelectedRows (TypeSet< int > &) const
 
bool getSelectedRows (TypeSet< int > &, bool mappedtosource) const
 
SelectionBehavior getSelectionBehavior () const
 
SelectionMode getSelectionMode () const
 
void getVisibleColumns (TypeSet< int > &, bool mappedtosource) const
 
void getVisibleRows (TypeSet< int > &, bool mappedtosource) const
 
bool hasAlternatingRowColors () const
 
bool isCellSelected (const RowCol &, bool mapfromsource=true) const
 
bool isColumnHidden (int col) const
 
bool isHeaderVisible (OD::Orientation) const
 
bool isRowHidden (int row) const
 
bool isSortingEnabled () const
 
bool isUndoEnabled () const
 
Notifier< uiTableView > & leftClicked ()
 
RowCol mapFromSource (const RowCol &) const
 
RowCol mapToSource (const RowCol &) const
 
void markUndoBaseline ()
 
int maxNrOfSelections () const
 
 mOD_DisableCopy (uiTableView) void setModel(TableModel *)
 
void moveColumn (int from, int to)
 
void redo ()
 
void removeAllSelections ()
 
void removeSelection (const TypeSet< RowCol > &)
 
void resetHorizontalHeader ()
 
void resizeColumnsToContents ()
 
void resizeColumnToContents (int column)
 
void saveHorizontalHeaderState ()
 
void scrollTo (const RowCol &)
 Needs model RowCol.
 
void selectAll ()
 
void selectColumn (int col)
 
void selectRow (int row)
 
void setAlternatingRowColor (const OD::Color &)
 Default is a grey.
 
void setAlternatingRowColors (bool yn)
 
void setCellSelected (const RowCol &, bool yn, bool mapfromsource=true)
 
void setColumnHidden (int col, bool)
 
void setColumnResizeMode (ResizeMode)
 Default is Stretch.
 
void setColumnsHidden (const TypeSet< int > &, bool)
 
void setColumnStretchable (int, bool)
 
void setColumnsVisibility (const TypeSet< int > &showcols, const TypeSet< int > &hidecols)
 
void setColumnValueType (int col, TableModel::CellType, char format='g', int precision=6)
 
void setColumnWidth (int col, int width)
 
void setContextMenuEnabled (bool)
 
void setCurrentCell (const RowCol &, bool noselection=false)
 
void setHeaderVisible (OD::Orientation, bool yn)
 
void setNotifCell (const RowCol &)
 
void setNrFrozenColumns (int nrcols)
 
void setRowHeight (int height)
 
void setRowHeight (int row, int height)
 
void setRowHidden (int row, bool)
 
void setRowResizeMode (ResizeMode)
 Default is ResizeToContents.
 
void setRowsAndColsHidden (const TypeSet< int > &rows, const TypeSet< int > &cols, bool)
 
void setRowsHidden (const TypeSet< int > &, bool)
 
void setRowsVisibility (const TypeSet< int > &showrows, const TypeSet< int > &hiderows)
 
void setSectionsMovable (bool)
 
void setSelectedCells (const TypeSet< RowCol > &)
 
void setSelectedCells (const TypeSet< RowCol > &, bool mapfromsource)
 
void setSelectionBehavior (SelectionBehavior)
 
void setSelectionMode (SelectionMode)
 
void setSortingEnabled (bool)
 
void setWordWrap (bool)
 
void sortByColumn (int col, bool asc=true)
 
void undo ()
 
Notifier< uiTableView > & undoRedoHappened ()
 
bool wordWrap () const
 
- Public Member Functions inherited from uiObject
 ~uiObject ()
 
uiSize actualSize (bool include_border=true) const
 
void attach (ConstraintType, int margin=-1)
 attaches object to another In case the stretched... options are used, margin=-1 (default) stretches the object not to cross the border. margin=-2 stretches the object to fill the parent's border. This looks nice with separators.
 
void attach (ConstraintType, uiObject *, int margin=-1, bool reciprocal=true)
 
void attach (ConstraintType, uiParent *, int margin=-1, bool reciprocal=true)
 
virtual OD::Color backgroundColor () const
 
virtual const ObjectSet< uiBaseObject > * childList () const
 
void close ()
 
void deepRedraw ()
 
void disabFocus ()
 
void display (bool yn, bool shrink=false, bool maximized=false)
 
const uiFont * font () const
 
QWidget * getWidget () override
 
virtual bool handleLongTabletPress ()
 
bool hasFocus () const
 
virtual int height () const
 Actual size in pixels.
 
bool isCursorInside () const
 
bool isDisplayed () const
 
virtual bool isEmpty () const
 
bool isSensitive () const
 
uiMainWin * mainwin ()
 
 mOD_DisableCopy (uiObject) enum SzPolicy
 How should the object's size behave? Undef : use default. Small : 1 base sz. Medium : 2* base sz + 1. Wide : 4* base sz + 3. The xxVar options specify that the element may have a bigger internal preferred size. In that case, the maximum is taken. The xxMax options specify that the element should take all available space ( stretch = 2 )
 
uiParent * parent ()
 
const uiParent * parent () const
 
int prefHNrPics () const
 
int prefVNrPics () const
 
QWidget * qwidget ()
 
const QWidget * qwidget () const
 
void reDraw (bool deep)
 
void reParent (uiParent *)
 
OD::Color roBackgroundColor () const
 
bool sensitive () const
 
virtual void setBackgroundColor (const OD::Color &)
 
virtual void setBackgroundPixmap (const uiPixmap &)
 
void setCaption (const uiString &)
 
virtual void setCursor (const MouseCursor &)
 
void setFocus ()
 
void setFont (const uiFont &)
 
void setHSzPol (SzPolicy)
 
void setMaximumHeight (int)
 
void setMaximumHeightInChar (int)
 
void setMaximumWidth (int)
 
void setMaximumWidthInChar (int)
 
void setMinimumHeight (int)
 
void setMinimumHeightInChar (int)
 
void setMinimumWidth (int)
 
void setMinimumWidthInChar (int)
 
virtual void setName (const char *) override
 
virtual void setPrefHeight (int)
 
void setPrefHeightInChar (float)
 
virtual void setPrefHeightInChar (int)
 
virtual void setPrefWidth (int)
 
void setPrefWidthInChar (float)
 
virtual void setPrefWidthInChar (int)
 
void setSensitive (bool yn=true)
 
void setStretch (int hor, int ver)
 Sets stretch factors for object If stretch factor is > 1, then object will already grow at pop-up.
 
virtual void setStyleSheet (const char *)
 
virtual void setTextColor (const OD::Color &)
 
void setToolTip (const uiString &)
 
void setVSzPol (SzPolicy)
 
void shallowRedraw ()
 
int stretch (bool hor) const
 
SzPolicy szPol (bool hor=true) const
 
const uiString & toolTip () const
 
void translateText () override
 
bool visible () const
 
virtual int width () const
 Actual size in pixels.
 
- Public Member Functions inherited from uiBaseObject
virtual ~uiBaseObject ()
 
int beginCmdRecEvent (const BufferString &msg)
 
int beginCmdRecEvent (const char *msg=0)
 
int beginCmdRecEvent (od_uint64 id, const char *msg=0)
 
uiBody * body ()
 
const uiBody * body () const
 
void clear ()
 
void endCmdRecEvent (int refnr, const char *msg=0)
 
void endCmdRecEvent (od_uint64 id, int refnr, const char *msg=0)
 
void finalise ()
 
bool finalised () const
 
bool finalized () const
 
const QWidget * getWidget () const
 
 mOD_DisableCopy (uiBaseObject) void final ize()
 
virtual Notifier< uiBaseObject > & postFinalise ()
 
virtual Notifier< uiBaseObject > & postFinalize ()
 
virtual Notifier< uiBaseObject > & preFinalise ()
 
virtual Notifier< uiBaseObject > & preFinalize ()
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=nullptr)
 
 NamedCallBacker (const NamedCallBacker &)=delete
 
 ~NamedCallBacker ()
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
NamedCallBacker & operator= (const NamedCallBacker &)=delete
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object.
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use.
 
CallBacker & operator= (const CallBacker &)=delete
 
void stopReceivingNotifications () const
 
virtual CallBacker * trueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_type & name () const override
 
NamedObject & operator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 

Public Attributes

CNotifier< uiTableView, int > columnClicked
 
Notifier< uiTableView > doubleClicked
 
Notifier< uiTableView > rightClicked
 
CNotifier< uiTableView, int > rowClicked
 
Notifier< uiTableView > selectionChanged
 
- Public Attributes inherited from uiObject
Notifier< uiObject > closed
 Triggered when object closes.
 
CNotifier< uiObject, uiRect & > setGeometry
 triggered when getting a new geometry A reference to the new geometry is passed which can be manipulated, before the geometry is actually set to the QWidget.
 

Protected Member Functions

virtual ODStyledItemDelegate * createColumnDelegate (int col, TableModel::CellType, char format='g', int precision=6)
 
void doHideColumn (int col, bool, ODUndoCommand *parent)
 
void doHideRow (int row, bool, ODUndoCommand *parent)
 
void editRequestCB (CallBacker *)
 
ODStyledItemDelegate * getColumnDelegate (int col, TableModel::CellType, char format='g', int precision=6)
 
ODTableView & mkView (uiParent *, const char *)
 
- Protected Member Functions inherited from uiObject
 uiObject (uiParent *, const char *nm)
 
 uiObject (uiParent *, const char *nm, uiObjectBody &)
 
virtual bool closeOK ()
 hook. Accepts/denies closing of window.
 
uiObjectBody * objBody ()
 
const uiObjectBody * objBody () const
 
void triggerSetGeometry (const i_LayoutItem *, uiRect &)
 setGeometry should be triggered by this's layoutItem
 
void updateToolTip (CallBacker *=nullptr)
 
- Protected Member Functions inherited from uiBaseObject
 uiBaseObject (const char *nm, uiBody *=nullptr)
 
void setBody (uiBody *b)
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 

Protected Attributes

ObjectSet< ODStyledItemDelegate > columndelegates_
 
QByteArray * horizontalheaderstate_ = nullptr
 
ODTableView * odtableview_
 
QSortFilterProxyModel * qproxymodel_ = nullptr
 
TableModel * tablemodel_ = nullptr
 
- Protected Attributes inherited from uiObject
uiString tooltip_
 
uiObjEventFilter * uiobjeventfilter_
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBacker > delnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Friends

class i_tableViewMessenger
 

Additional Inherited Members

- Static Public Member Functions inherited from uiObject
static int baseFldSize ()
 
static int iconSize ()
 
static void setTabOrder (uiObject *first, uiObject *second)
 
static void updateToolTips ()
 
- Static Public Member Functions inherited from uiBaseObject
static void addCmdRecorder (const CallBack &)
 
static void removeCmdRecorder (const CallBack &)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Member Enumeration Documentation

◆ ResizeMode

Enumerator
Interactive 
Fixed 
Stretch 
ResizeToContents 

◆ SelectionBehavior

Enumerator
SelectItems 
SelectRows 
SelectColumns 

◆ SelectionMode

Enumerator
SingleSelection 
ExtendedSelection 
NoSelection 

Constructor & Destructor Documentation

◆ uiTableView()

uiTableView::uiTableView ( uiParent * ,
const char * nm )

◆ ~uiTableView()

uiTableView::~uiTableView ( )

Member Function Documentation

◆ beginUndoGroup()

void uiTableView::beginUndoGroup ( )

◆ clearSelection()

void uiTableView::clearSelection ( )

◆ clearUndo()

void uiTableView::clearUndo ( )

◆ createColumnDelegate()

virtual ODStyledItemDelegate * uiTableView::createColumnDelegate ( int col,
TableModel::CellType ,
char format = 'g',
int precision = 6 )
protectedvirtual

◆ currentCell()

const RowCol & uiTableView::currentCell ( ) const

◆ doHideColumn()

void uiTableView::doHideColumn ( int col,
bool ,
ODUndoCommand * parent )
protected

◆ doHideRow()

void uiTableView::doHideRow ( int row,
bool ,
ODUndoCommand * parent )
protected

◆ editRequestCB()

void uiTableView::editRequestCB ( CallBacker * )
protected

◆ enableUndo()

void uiTableView::enableUndo ( bool yn)

◆ endUndoGroup()

void uiTableView::endUndoGroup ( )

◆ getCellType()

TableModel::CellType uiTableView::getCellType ( int col) const

◆ getColumnDelegate()

ODStyledItemDelegate * uiTableView::getColumnDelegate ( int col,
TableModel::CellType ,
char format = 'g',
int precision = 6 )
protected

◆ getModel() [1/2]

TableModel * uiTableView::getModel ( )
inline

◆ getModel() [2/2]

const TableModel * uiTableView::getModel ( ) const
inline

◆ getNotifCell()

RowCol uiTableView::getNotifCell ( ) const

◆ getSelectedCells()

bool uiTableView::getSelectedCells ( TypeSet< RowCol > & ,
bool mappedtosource ) const

◆ getSelectedColumns() [1/2]

bool uiTableView::getSelectedColumns ( TypeSet< int > & ) const

◆ getSelectedColumns() [2/2]

bool uiTableView::getSelectedColumns ( TypeSet< int > & ,
bool mappedtosource ) const

◆ getSelectedRows() [1/2]

bool uiTableView::getSelectedRows ( TypeSet< int > & ) const

◆ getSelectedRows() [2/2]

bool uiTableView::getSelectedRows ( TypeSet< int > & ,
bool mappedtosource ) const

◆ getSelectionBehavior()

SelectionBehavior uiTableView::getSelectionBehavior ( ) const

◆ getSelectionMode()

SelectionMode uiTableView::getSelectionMode ( ) const

◆ getVisibleColumns()

void uiTableView::getVisibleColumns ( TypeSet< int > & ,
bool mappedtosource ) const

◆ getVisibleRows()

void uiTableView::getVisibleRows ( TypeSet< int > & ,
bool mappedtosource ) const

◆ hasAlternatingRowColors()

bool uiTableView::hasAlternatingRowColors ( ) const

◆ isCellSelected()

bool uiTableView::isCellSelected ( const RowCol & ,
bool mapfromsource = true ) const

◆ isColumnHidden()

bool uiTableView::isColumnHidden ( int col) const

◆ isHeaderVisible()

bool uiTableView::isHeaderVisible ( OD::Orientation ) const

◆ isRowHidden()

bool uiTableView::isRowHidden ( int row) const

◆ isSortingEnabled()

bool uiTableView::isSortingEnabled ( ) const

◆ isUndoEnabled()

bool uiTableView::isUndoEnabled ( ) const

◆ leftClicked()

Notifier< uiTableView > & uiTableView::leftClicked ( )

◆ mapFromSource()

RowCol uiTableView::mapFromSource ( const RowCol & ) const

◆ mapToSource()

RowCol uiTableView::mapToSource ( const RowCol & ) const

◆ markUndoBaseline()

void uiTableView::markUndoBaseline ( )

◆ maxNrOfSelections()

int uiTableView::maxNrOfSelections ( ) const

◆ mkView()

ODTableView & uiTableView::mkView ( uiParent * ,
const char *  )
protected

◆ mOD_DisableCopy()

uiTableView::mOD_DisableCopy ( uiTableView )

◆ moveColumn()

void uiTableView::moveColumn ( int from,
int to )

◆ redo()

void uiTableView::redo ( )

◆ removeAllSelections()

void uiTableView::removeAllSelections ( )
inline

◆ removeSelection()

void uiTableView::removeSelection ( const TypeSet< RowCol > & )

◆ resetHorizontalHeader()

void uiTableView::resetHorizontalHeader ( )

◆ resizeColumnsToContents()

void uiTableView::resizeColumnsToContents ( )

◆ resizeColumnToContents()

void uiTableView::resizeColumnToContents ( int column)

◆ saveHorizontalHeaderState()

void uiTableView::saveHorizontalHeaderState ( )

◆ scrollTo()

void uiTableView::scrollTo ( const RowCol & )

Needs model RowCol.

◆ selectAll()

void uiTableView::selectAll ( )

◆ selectColumn()

void uiTableView::selectColumn ( int col)

◆ selectRow()

void uiTableView::selectRow ( int row)

◆ setAlternatingRowColor()

void uiTableView::setAlternatingRowColor ( const OD::Color & )

Default is a grey.

◆ setAlternatingRowColors()

void uiTableView::setAlternatingRowColors ( bool yn)

Follows the displayed row order, thus also after sorting or hiding rows

◆ setCellSelected()

void uiTableView::setCellSelected ( const RowCol & ,
bool yn,
bool mapfromsource = true )

◆ setColumnHidden()

void uiTableView::setColumnHidden ( int col,
bool  )

◆ setColumnResizeMode()

void uiTableView::setColumnResizeMode ( ResizeMode )

Default is Stretch.

◆ setColumnsHidden()

void uiTableView::setColumnsHidden ( const TypeSet< int > & ,
bool  )

◆ setColumnStretchable()

void uiTableView::setColumnStretchable ( int ,
bool  )

◆ setColumnsVisibility()

void uiTableView::setColumnsVisibility ( const TypeSet< int > & showcols,
const TypeSet< int > & hidecols )

◆ setColumnValueType()

void uiTableView::setColumnValueType ( int col,
TableModel::CellType ,
char format = 'g',
int precision = 6 )

◆ setColumnWidth()

void uiTableView::setColumnWidth ( int col,
int width )

◆ setContextMenuEnabled()

void uiTableView::setContextMenuEnabled ( bool )

◆ setCurrentCell()

void uiTableView::setCurrentCell ( const RowCol & ,
bool noselection = false )

◆ setHeaderVisible()

void uiTableView::setHeaderVisible ( OD::Orientation ,
bool yn )

◆ setNotifCell()

void uiTableView::setNotifCell ( const RowCol & )

◆ setNrFrozenColumns()

void uiTableView::setNrFrozenColumns ( int nrcols)

◆ setRowHeight() [1/2]

void uiTableView::setRowHeight ( int height)

◆ setRowHeight() [2/2]

void uiTableView::setRowHeight ( int row,
int height )

◆ setRowHidden()

void uiTableView::setRowHidden ( int row,
bool  )

◆ setRowResizeMode()

void uiTableView::setRowResizeMode ( ResizeMode )

Default is ResizeToContents.

◆ setRowsAndColsHidden()

void uiTableView::setRowsAndColsHidden ( const TypeSet< int > & rows,
const TypeSet< int > & cols,
bool  )

◆ setRowsHidden()

void uiTableView::setRowsHidden ( const TypeSet< int > & ,
bool  )

◆ setRowsVisibility()

void uiTableView::setRowsVisibility ( const TypeSet< int > & showrows,
const TypeSet< int > & hiderows )

◆ setSectionsMovable()

void uiTableView::setSectionsMovable ( bool )

◆ setSelectedCells() [1/2]

void uiTableView::setSelectedCells ( const TypeSet< RowCol > & )

◆ setSelectedCells() [2/2]

void uiTableView::setSelectedCells ( const TypeSet< RowCol > & ,
bool mapfromsource )

◆ setSelectionBehavior()

void uiTableView::setSelectionBehavior ( SelectionBehavior )

◆ setSelectionMode()

void uiTableView::setSelectionMode ( SelectionMode )

◆ setSortingEnabled()

void uiTableView::setSortingEnabled ( bool )

◆ setWordWrap()

void uiTableView::setWordWrap ( bool )

◆ sortByColumn()

void uiTableView::sortByColumn ( int col,
bool asc = true )

◆ undo()

void uiTableView::undo ( )

◆ undoRedoHappened()

Notifier< uiTableView > & uiTableView::undoRedoHappened ( )

◆ wordWrap()

bool uiTableView::wordWrap ( ) const

Friends And Related Symbol Documentation

◆ i_tableViewMessenger

friend class i_tableViewMessenger
friend

Member Data Documentation

◆ columnClicked

CNotifier<uiTableView,int> uiTableView::columnClicked

◆ columndelegates_

ObjectSet<ODStyledItemDelegate> uiTableView::columndelegates_
protected

◆ doubleClicked

Notifier<uiTableView> uiTableView::doubleClicked

◆ horizontalheaderstate_

QByteArray* uiTableView::horizontalheaderstate_ = nullptr
protected

◆ odtableview_

ODTableView* uiTableView::odtableview_
protected

◆ qproxymodel_

QSortFilterProxyModel* uiTableView::qproxymodel_ = nullptr
protected

◆ rightClicked

Notifier<uiTableView> uiTableView::rightClicked

◆ rowClicked

CNotifier<uiTableView,int> uiTableView::rowClicked

◆ selectionChanged

Notifier<uiTableView> uiTableView::selectionChanged

◆ tablemodel_

TableModel* uiTableView::tablemodel_ = nullptr
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2026