class KTabListBox
|
A multi column listbox
Features:
- User resizeable columns. More... |
|
|
Public Members
- enum ColumnType {TextColumn, PixmapColumn, MixedColumn }
- enum OrderMode {Ascending, Descending }
- enum OrderType {NoOrder, SimpleOrder, ComplexOrder }
- KTabListBox (QWidget *parent=0, const char *name=0, int columns=1, WFlags f=0)
- virtual ~KTabListBox ()
- void enableKey (void)
- uint count (void) const
- virtual void insertItem (const char* string, int itemIndex=-1)
- void appendStrList ( QStrList const *strLst )
- void appendItem (const char* string)
- virtual void changeItem (const char* string, int itemIndex)
- virtual void changeItemPart (const char* string, int itemIndex, int column)
- virtual void changeItemColor (const QColor& color, int itemIndex=-1)
- int tabWidth (void) const
- virtual void setTabWidth (int)
- const QString& text (int idx, int col=-1) const
- virtual void removeItem (int itemIndex)
- virtual void clear (void)
- int currentItem (void) const
- virtual void setCurrentItem (int idx, int colId=-1)
- virtual void unmarkAll (void)
- virtual void markItem (int idx, int colId=-1)
- virtual void unmarkItem (int idx)
- virtual bool isMarked (int idx) const
- int findItem (int yPos) const
- int topItem (void) const
- void setTopItem (int idx)
- virtual void setNumCols (int)
- virtual void setNumRows (int)
- int numRows (void) const
- int numCols (void) const
- int cellWidth (int col)
- int totalWidth (void)
- int cellHeight (int row)
- int totalHeight (void)
- int topCell (void) const
- int leftCell (void) const
- int lastColVisible (void) const
- int lastRowVisible (void) const
- bool autoUpdate (void) const
- void setAutoUpdate (bool upd)
- void clearTableFlags (uint f=~0)
- uint tableFlags (void)
- bool testTableFlags (uint f)
- void setTableFlags (uint f)
- int findCol (int x)
- int findRow (int y)
- bool colXPos (int col, int* x)
- bool rowYPos (int row, int* y)
- virtual void reorderRows ()
- virtual void setColumn (int col, const char* caption, int width=0, ColumnType type=TextColumn, OrderType ordt=NoOrder, OrderMode omode=Descending, bool verticalLine=false, int (*compar) const
- virtual void setColumnWidth (int col, int width=0)
- int columnWidth (int col)
- virtual void setDefaultColumnWidth (int width0, ...)
- void changeMode (int col)
- void clearAllNum ()
- virtual void setSeparator (char sep)
- virtual char separator (void) const
- KTabListBoxDict& dict (void)
- void repaint (void)
- bool startDrag (int col, int row, const QPoint& mousePos)
- QPixmap& dndPixmap (void)
- virtual void readConfig (void)
- virtual void writeConfig (void)
- int colPosList (int num)
- int itemPosList (int num)
- const QFont& tableFont (void) const
- void setTableFont (const QFont& fnt)
Protected Members
- virtual KTabListBoxColumn* newKTabListBoxColumn (void)
- bool itemVisible (int idx)
- void updateItem (int idx, bool clear = TRUE)
- bool needsUpdate (int id)
- void setCItem (int idx)
- void adjustNumber (int num)
- void flushKeys ()
- bool recursiveSort (int level,int n,KTabListBoxColumn **c,int *iCol)
- KTabListBoxItem* getItem (int idx)
- const KTabListBoxItem* getItem (int idx) const
- virtual void keyPressEvent (QKeyEvent*)
- virtual void resizeEvent (QResizeEvent*)
- virtual void paintEvent (QPaintEvent*)
- virtual void mouseMoveEvent (QMouseEvent*)
- virtual void mousePressEvent (QMouseEvent*)
- virtual void mouseReleaseEvent (QMouseEvent*)
- virtual void resizeList (int newNumItems=-1)
- virtual bool prepareForDrag (int col, int row, char** data, int* size, int* type)
- virtual void doMouseResizeCol (QMouseEvent*)
- virtual void doMouseMoveCol (QMouseEvent*)
- KTabListBoxColumn** colList
- int * colShowList
- int * itemShowList
- KTabListBoxItem** itemList
- int current
- char sepChar
- KTabListBoxDict pixDict
- KTabListBoxTable lbox
- int labelHeight
- QPixmap dndDefaultPixmap
- int columnPadding
- QColor highlightColor
- int tabPixels
- bool mResizeCol
- bool stopOrdering
- bool needsSort
- int lastSelectedColumn
- int nMarked
- int mSortCol
- int mMouseCol
- int mMouseColLeft
- int mLastX
- int mMouseColWidth
- QPoint mMouseStart
- bool mMouseAction
- bool mMouseDragColumn
Protected Slots
- void horSbValue (int val)
- void horSbSlidingDone ()
Signals
Detailed Description
A multi column listbox
Features:
- User resizeable columns.
- The order of columns can be changed with drag&drop. (Alex)
- 3 modes: Standard, SimpleOrder, ComplexOrder. (Alex)
ToDo:
- Configurable vertical column divisor lines.
- Save all setting to config file.
- fix flickering into column headers.
This enable the key-bindings (and set StrongFocus!)
if you don't want StrongFocus you can implement your own keyPressEvent
and send an event to KTabListBox from there...
[const] Returns the number of rows
void insertItem (const char* string, int itemIndex=-1)
|
[virtual] Insert a line before given index, using the separator character to separate the fields. If no index is given the line is appended at the end. Returns index of inserted item.
void appendStrList ( QStrList const *strLst )
|
Append a QStrList
void appendItem (const char* string)
|
Same as insertItem, but always appends the new item.
void changeItem (const char* string, int itemIndex)
|
[virtual] Change contents of a line using the separator character to separate the fields.
void changeItemPart (const char* string, int itemIndex, int column)
|
[virtual] Change part of the contents of a line.
void changeItemColor (const QColor& color, int itemIndex=-1)
|
[virtual] Change color of line. Changes last inserted item when itemIndex==-1
[const] Get number of pixels one tab character stands for. Default: 10
[virtual] Set number of pixels one tab character stands for. Default: 10
const QString& text (int idx, int col=-1)
|
[const] Returns contents of given row/column. If col is not set the
contents of the whole row is returned, seperated with the current
seperation character. In this case the string returned is a
temporary string that will change on the next text() call on any
KTabListBox object.
void removeItem (int itemIndex)
|
[virtual] Remove one item from the list.
[virtual] Remove contents of listbox
[const] Return index of current item
void setCurrentItem (int idx, int colId=-1)
|
[virtual] Set the current (selected) column. colId is the value that
is transfered with the selected() signal that is emited.
[virtual] Unmark all items
void markItem (int idx, int colId=-1)
|
[virtual] Mark/unmark item with index idx.
[const virtual] Returns TRUE if item with given index is marked.
[const] Find item at given screen y position.
[const] Returns first item that is currently displayed in the widget.
void setTopItem (int idx)
|
Change first displayed item by repositioning the visible part
of the list.
[virtual] Set number of columns. Warning: this *deletes* the contents
of the listbox.
[virtual] Set number of rows in the listbox. The contents stays as it is.
[const] See the docs for the QTableView class.
[const] See the docs for the QTableView class.
See the docs for the QTableView class.
See the docs for the QTableView class.
See the docs for the QTableView class.
See the docs for the QTableView class.
[const] See the docs for the QTableView class.
[const] See the docs for the QTableView class.
int lastColVisible (void)
|
[const] See the docs for the QTableView class.
int lastRowVisible (void)
|
[const] See the docs for the QTableView class.
[const] See the docs for the QTableView class.
void setAutoUpdate (bool upd)
|
See the docs for the QTableView class.
void clearTableFlags (uint f=~0)
|
See the docs for the QTableView class.
See the docs for the QTableView class.
bool testTableFlags (uint f)
|
See the docs for the QTableView class.
void setTableFlags (uint f)
|
See the docs for the QTableView class.
See the docs for the QTableView class.
See the docs for the QTableView class.
bool colXPos (int col, int* x)
|
See the docs for the QTableView class.
bool rowYPos (int row, int* y)
|
See the docs for the QTableView class.
[virtual] This call the 'compar' functions if they were been defined in
setColumn or else use strcmp. (i.e. if you want a case-insensitive sort
put strcasecmp in setColumn call).
That compar function must take as arguments two char *, and must return
an integer less than, equal to, or greater than zero if the first
argument is considered to be respectively less than, equal to,
or greater than the second.
void setColumn (int col, const char* caption, int width=0, ColumnType type=TextColumn, OrderType ordt=NoOrder, OrderMode omode=Descending, bool verticalLine=false, int (*compar)
|
[const pure virtual] Set column caption, width, type,order-type and order-mode
void setColumnWidth (int col, int width=0)
|
[virtual] Set column width.
int columnWidth (int col)
|
Get column width.
void setDefaultColumnWidth (int width0, ...)
|
[virtual] Set default width of all columns.
void changeMode (int col)
|
change the Ascending/Descending mode of column col.
Clear all number-check-buttons (ComplexOrder only)
void setSeparator (char sep)
|
[virtual] Set separator character, e.g. '\t'.
[const virtual] Return separator character.
For convenient access to the dictionary of pictures that this listbox understands.
bool startDrag (int col, int row, const QPoint& mousePos)
|
Indicates that a drag has started with given item. Returns TRUE if we are dragging, FALSE if drag-start failed.
[virtual] Read the config file entries in the group with the name of the listbox and set the default column widths and those.
[virtual] Write the config file entries in the group with the name of the listbox
Return the actual position of the colum in the table.
int itemPosList (int num)
|
Return the actual positon of the row number num.
const QFont& tableFont (void)
|
[const] Get/set font of the table. font() and setFont() apply to the
caption only.
void highlighted (int Index, int column)
|
[signal] emited when the current item changes (either via setCurrentItem() or via mouse single-click).
void selected (int Index, int column)
|
[signal] emitted when the user double-clicks into a line.
void popupMenu (int Index, int column)
|
[signal] emitted when the user presses the right mouse button over a line.
void midClick (int Index, int column)
|
[signal] emitted when the user presses the middle mouse button over a line.
void headerClicked (int column)
|
[signal] emitted when the user clicks on a column header.
[protected virtual] Used to create new column objects. Overwrite this method
in a subclass to have your own column objects (e.g. with custom
data in it). You will then also need customData()/setCustomData()
methods in here that access the elememts in itemList[].
void resizeList (int newNumItems=-1)
|
[protected virtual] Resize item array. Per default enlarge it to double size.
bool prepareForDrag (int col, int row, char** data, int* size, int* type)
|
[protected virtual] Called to set drag data, size, and type. If this method returns FALSE then no drag occurs.
[protected virtual] Internal method that handles resizing of columns with the mouse.
[protected virtual] Internal method that handles moving of columns with the mouse.
Generated by: prospector@george.devel.redhat.com on Fri Apr 27 18:12:17 200. |