This is the abstract base class of all the table widgets. (details) (complete member list)
#include <qtablew.h>
Inherits QFrame.
Inherited by QListBox and QPopupMenu.
It provides table and scrolling functionality along both axes. The behavior of the widget can be finely tuned using setTableFlags(); child classes like QListBox are little more than a call to setTableFlags() and some table content manipulation.
Create a new table widget. All the arguments are passed to the QFrame constructor.
The Tbl_autoVScrollBar, Tbl_autoHScrollBar and Tbl_clipCellPainting flags are set, all other flags are reset.
setCellHeight() and setCellWidth() are set to 0.
Destroys the table and frees all occupied memory.
Returns TRUE if the widget updates itself automatically whenever it has changed in some way (e.g. when a flag has been changed).
See also: setAutoUpdate().
Returns the height of each row, in pixels. If the rows are different in height, this function returns 0.
See also: setCellHeight(), cellWidth().
Returns the height of row row, in pixels. This function is virtual, so each child class can implement it sensibly.
See also: setCellHeight(), cellWidth().
Returns the width of each column, in pixels. If the columns are different in width, this function returns 0.
See also: setCellWidth(), cellHeight().
Returns the width of column col, in pixels. This function is virtual, so each child class can implement it sensibly.
See also: setCellWidth(), cellHeight().
Clears the table flags that are set in f. To clear Tbl_snapToGrid, you do
t->clearTableFlags( Tbl_snapToGrid );
The default argument is to clear all flags.
See also: setTableFlags(), testTableFlags(), tableFlags().
Returns TRUE if col is at least partially visible.
See also: rowIsVisible().
Called when both scrollbars are active at the same time. Covers the bottom left corner between the two scrollbars with an empty widget.
horSbSliding temporarily disables Tbl_snapToHGrid and horSbSlidingDone reenables it. The table internally connects the horizontal scrollbar's sliderPressed() and sliderReleased() signals to these slots.
See also: QScrollBar.
horSbSliding temporarily disables Tbl_snapToHGrid and horSbSlidingDone reenables it. The table internally connects the horizontal scrollbar's sliderPressed() and sliderReleased() signals to these slots.
See also: QScrollBar.
Moves the table horizontally to offset val without updating the scrollbar. The table internally connects the horizontal scrollbar's valueChanged() to this slot.
Returns the index of the last drawn column. The index of the first column is 0.
If no columns can be drawn it returns -1. This can happen if the widget is too narrow for the first column and Tbl_cutCellsH is set.
See also: lastRowVisible().
Returns the index of the last drawn row. The index of the first row is 0.
If no rows can be drawn it returns -1. This can happen if the widget is too small for the first row and Tbl_cutCellsV is set.
See also: lastColumnVisible().
Returns the index of the first column in the table that's visible on the screen.
See also: topCell(), setLeftCell().
Returns the number of columns in the table.
See also: numRows(), setNumCols().
Returns the number of rows in the table.
See also: numCols(), setNumRows().
This event handler repaints the widget. It is fairly clever about only repainting the area of the screen that needs it.
Repaints the widget's contents. If erase is TRUE, the widget is cleared to the background color first.
See also: repaintEvent().
Repaints part of the widget's contents. The (w,h) pixels big rectangle at (x,y) is repainted, and the rest of the widget is left alone. If erase is TRUE, the widget is cleared to the background color first.
See also: repaintEvent().
Repaints the table. If erase is TRUE, the window is cleared to the background color first.
This event handler handles resizing of the widget.
The scroll bars are moved and cells repainted as necessary.
Returns TRUE if row is at least partially visible.
See also: colIsVisible().
If b is TRUE (this is the default) then the widget will update itself automatically whenever it has changed in some way (e.g. when a flag has been changed).
If b is FALSE, the widget won't.
See also: autoUpdate().
Reimplemented from QWidget, sets the background colors of the scrollbars and the corner square.
Sets the height in pixels of the idividual cells. Setting it to zero means that the height of rows in the table vary. When set to 0 (this is the default) QTableWidget will call the virtual function cellHeight() to fetch the height.
See also: cellHeight(), cellWidth(), setCellWidth(), totalHeight(), numRows().
Sets the width in pixels of the idividual cells. Setting it to zero means that the width of columns in the table vary. When set to 0 (this is the default) QTableWidget will call the virtual function cellWidth() to fetch the width.
See also: cellHeight(), setCellHeight(), cellWidth(), totalWidth(), numCols().
This slot scrolls the table such that col becomes the leftmost column.
See also: setXOffset(), setTopLeftCell(), setTopCell().
Sets the number of columns of the table to cols. The number must be positive.
The table will repaint itself automatically if autoUpdate() is set.
See also: numCols(), numRows(), setNumRows(), setAutoUpdate(), autoUpdate().
Sets the number of rows of the table to rows. The number must be positive.
The table will repaint itself automatically if autoUpdate is set.
See also: numCols(), setNumCols(), numRows(), setAutoUpdate(), autoUpdate().
This slot scrolls the table such that (x,y) becomes the top left pixel. The interaction with Tbl_snapTo*Grid is tricky. If updateScrBars is TRUE, the scrollbars are updated.
See also: setTopLeftCell(), setXOffset(), setYOffset().
Sets the table flags to f. If a flag setting changes the appearance of the table it will be repainted if autoUpdate() is TRUE.
The table flags are mostly single bits, though there are some multibit flags for convenience. Here is a complete list:
You can specify more than one flag at a time using bitwise OR:
t->setTableFlags( Tbl_smoothScrolling | Tbl_autoScrollBars );
See also: tableFlags()
This slot scrolls the table such that row becomes the top row.
See also: setYOffset(), setTopLeftCell(), setLeftCell().
Scrolls the table such that the cell at row row and colum col becomes the top left cell shown.
See also: setLeftCell(), setTopCell(), setOffset().
This slot scrolls the table such that x becomes the leftmost pixel. The interaction with Tbl_snapToHGrid is tricky.
See also: setLeftCell(), setYOffset(), setOffset().
This slot scrolls the table such that y becomes the top pixel. The interaction with Tbl_snapToVGrid is tricky.
See also: setTopCell(), setXOffset(), setOffset().
This virtual function is called before painting of table cells is started. It can be reimplemented by subclasses that want to to set up the painter in a special way and that do not want to do so for each cell.
The default implementation does nothing.
Scroll the widget to a position such that:
If horizontal is TRUE, the leftmost column shown fits snugly with the left edge of the window.
If vertical is TRUE, the top row shown fits snugly with the top of the window.
You can achieve the same effect automatically by setting any of the Tbl_snapTo*Grid table flags.
Returns the union of the table flags that are currently in effect.
See also: setTableFlags().
Returns TRUE if any of the table flags in f are currently set.
See also: setTableFlags().
Returns the index of the first line in the table that's visible on the screen.
See also: leftCell(), setTopCell().
Returns the total height of the table in pixels. This function is virtual and should be reimplmented in subclasses that have varying cell heights and a non-trivial cellHeight() function or a large amount of rows in the table.
See also: cellHeight()
Returns the total witdth of the table in pixels. This function is virtual and should be reimplmented in subclasses that have varying cell heights and a non-trivial cellHeight() function or a large amount of rows in the table.
See also: cellWidth()
If the cell at row row, column col is visible, repaints that cell. If erase is TRUE, the relevant part of the window will be cleared to the background color/pixmap before the contents are repainted.
This slot scrolls the table smoothly vertically even if Tbl_snapToVGrid is set. The table connects this to the vertical scrollbar's sliderMoved() signal.
See also: QScrollBar.
The table connects this to the vertical scrollbar's sliderReleased() signal.
Moves the table vertically to offset val without updating the scrollbar. The table internally connects the vertical scrollbar's valueChanged() to this slot.
Returns the rectangle which is the actual table, in the widget's own coordinate system. Somewhat similar to clientRect(), but doesn't include any frames.
Returns the coordinate in pixels of the table which is currently on the left edge of the shown part.
See also: yOffset(), the setXOffset() slot and leftCell().
Returns the coordinate in pixels of the table which is currently on the top edge of the shown part.
See also: xOffset(), the setYOffset() slot and topCell().
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: