#include <q3listview.h>
Inheritance diagram for Q3ListView:


It can display and control a hierarchy of multi-column items, and provides the ability to add new items at any time. The user may select one or many items (depending on the SelectionMode) and sort the list in increasing or decreasing order by any column.
The simplest pattern of use is to create a Q3ListView, add some column headers using addColumn() and create one or more Q3ListViewItem or Q3CheckListItem objects with the Q3ListView as parent.
Further nodes can be added to the list view object (the root of the tree) or as child nodes to Q3ListViewItems.
The main setup functions are: Function Action addColumn() Adds a column with a text label and perhaps width. Columns are counted from the left starting with column 0. setColumnWidthMode() Sets the column to be resized automatically or not. setAllColumnsShowFocus() Sets whether items should show keyboard focus using all columns or just column 0. The default is to show focus just using column 0. setRootIsDecorated() Sets whether root items can be opened and closed by the user and have open/close decoration to their left. The default is false. setTreeStepSize() Sets how many pixels an item's children are indented relative to their parent. The default is 20. This is mostly a matter of taste. setSorting() Sets whether the items should be sorted, whether it should be in ascending or descending order, and by what column they should be sorted. By default the list view is sorted by the first column; to switch this off call setSorting(-1).
There are several functions for mapping between items and coordinates. itemAt() returns the item at a position on-screen, itemRect() returns the rectangle an item occupies on the screen, and itemPos() returns the position of any item (whether it is on-screen or not). firstChild() returns the list view's first item (not necessarily visible on-screen).
You can iterate over visible items using Q3ListViewItem::itemBelow(); over a list view's top-level items using Q3ListViewItem::firstChild() and Q3ListViewItem::nextSibling(); or every item using a Q3ListViewItemIterator. See the Q3ListViewItem documentation for examples of traversal.
An item can be moved amongst its siblings using Q3ListViewItem::moveItem(). To move an item in the hierarchy use takeItem() and insertItem(). Item's (and all their child items) are deleted with delete; to delete all the list view's items use clear().
There are a variety of selection modes described in the Q3ListView::SelectionMode documentation. The default is Single selection, which you can change using setSelectionMode().
Because Q3ListView offers multiple selection it must display keyboard focus and selection state separately. Therefore there are functions both to set the selection state of an item (setSelected()) and to set which item displays keyboard focus (setCurrentItem()).
Q3ListView emits two groups of signals; one group signals changes in selection/focus state and one indicates selection. The first group consists of selectionChanged() (applicable to all list views), selectionChanged(Q3ListViewItem*) (applicable only to a Single selection list view), and currentChanged(Q3ListViewItem*). The second group consists of doubleClicked(Q3ListViewItem*), returnPressed(Q3ListViewItem*), rightButtonClicked(Q3ListViewItem*, const QPoint&, int), etc.
Note that changing the state of the list view in a slot connected to a list view signal may cause unexpected side effects. If you need to change the list view's state in response to a signal, use a single shot timer with a time out of 0, and connect this timer to a slot that modifies the list view's state.
In Motif style, Q3ListView deviates fairly strongly from the look and feel of the Motif hierarchical tree view. This is done mostly to provide a usable keyboard interface and to make the list view look better with a white background.
If selectionMode() is Single (the default) the user can select one item at a time, e.g. by clicking an item with the mouse, see Q3ListView::SelectionMode for details.
The list view can be navigated either using the mouse or the keyboard. Clicking a {-} icon closes an item (hides its children) and clicking a {+} icon opens an item (shows its children). The keyboard controls are these: Keypress Action Home Make the first item current and visible. End Make the last item current and visible. Page Up Make the item above the top visible item current and visible. Page Down Make the item below the bottom visible item current and visible. Up Arrow Make the item above the current item current and visible. Down Arrow Make the item below the current item current and visible. Left Arrow If the current item is closed ({+} icon) or has no children, make its parent item current and visible. If the current item is open ({-} icon) close it, i.e. hide its children. Exception: if the current item is the first item and is closed and the horizontal scrollbar is offset to the right the list view will be scrolled left. Right Arrow If the current item is closed ({+} icon) and has children, the item is opened. If the current item is opened ({-} icon) and has children the item's first child is made current and visible. If the current item has no children the list view is scrolled right.
If the user starts typing letters with the focus in the list view an incremental search will occur. For example if the user types 'd' the current item will change to the first item that begins with the letter 'd'; if they then type 'a', the current item will change to the first item that begins with 'da', and so on. If no item begins with the letters they type the current item doesn't change.
Note that the list view's size hint is calculated taking into account the height and width to produce a nice aspect ratio. This may mean that you need to reimplement sizeHint() in some cases.
Definition at line 217 of file q3listview.h.
This typedef is used in Q3ListView's API for values that are OR'd combinations of StringComparisonMode values.
Definition at line 339 of file q3listview.h.
This enum type describes how the width of a column in the view changes.
Manual the column width does not change automatically.
Maximum the column is automatically sized according to the widths of all items in the column. (Note: The column never shrinks in this case.) This means that the column is always resized to the width of the item with the largest width in the column.
Definition at line 260 of file q3listview.h.
This enumerated type is used by Q3ListView to indicate how it reacts to selection by the user.
Single When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item.
Multi When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone.
Extended When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. And if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item get selected or unselected, depending on the state of the clicked item. Also, multiple items can be selected by dragging the mouse over them.
NoSelection Items cannot be selected.
In other words, Single is a real single-selection list view, Multi a real multi-selection list view, Extended is a list view where users can select multiple items but usually want to select either just one or a range of contiguous items, and NoSelection is a list view where the user can look but not touch.
Definition at line 282 of file q3listview.h.
00282 { Single, Multi, Extended, NoSelection };
This enum describes how the list view's header adjusts to resize events which affect the width of the list view.
NoColumn The columns do not get resized in resize events.
AllColumns All columns are resized equally to fit the width of the list view.
LastColumn The last column is resized to fit the width of the list view.
Definition at line 328 of file q3listview.h.
00328 { NoColumn, AllColumns, LastColumn };
This enum type is used to set the string comparison mode when searching for an item. We'll refer to the string being searched as the 'target' string.
CaseSensitive The strings must match case sensitively. ExactMatch The target and search strings must match exactly. BeginsWith The target string begins with the search string. EndsWith The target string ends with the search string. Contains The target string contains the search string.
If you OR these flags together (excluding CaseSensitive), the search criteria be applied in the following order: ExactMatch, BeginsWith, EndsWith, Contains.
Matching is case-insensitive unless CaseSensitive is set. CaseSensitive can be OR-ed with any combination of the other flags.
Definition at line 332 of file q3listview.h.
00332 { 00333 CaseSensitive = 0x00001, // 0 0001 00334 BeginsWith = 0x00002, // 0 0010 00335 EndsWith = 0x00004, // 0 0100 00336 Contains = 0x00008, // 0 1000 00337 ExactMatch = 0x00010 // 1 0000 00338 };
This enum describes whether a rename operation is accepted if the rename editor loses focus without the user pressing Enter.
Accept Rename if Enter is pressed or focus is lost.
Reject Discard the rename operation if focus is lost (and Enter has not been pressed).
Definition at line 343 of file q3listview.h.
| Q3ListView::Q3ListView | ( | QWidget * | parent = 0, |
|
| const char * | name = 0, |
|||
| Qt::WindowFlags | f = 0 | |||
| ) |
Constructs a new empty list view called name with parent parent and widget attributes f.
This constructor sets the WA_StaticContent and the Qt::WA_NoBackground attributes to boost performance when drawing Q3ListViewItems. This may be unsuitable for custom Q3ListViewItem classes, in which case Qt::WA_StaticContents and Qt::WA_NoBackground should be cleared on the viewport() after construction.
Definition at line 2575 of file q3listview.cpp.
References init().
02576 : Q3ScrollView(parent, name, f | Qt::WStaticContents | Qt::WNoAutoErase) 02577 { 02578 init(); 02579 }
Here is the call graph for this function:

| Q3ListView::~Q3ListView | ( | ) |
Destroys the list view, deleting all its items, and frees up all allocated resources.
Definition at line 2751 of file q3listview.cpp.
References QList< T >::at(), d, Q3ListViewPrivate::focusItem, i, Q3ListViewPrivate::iterators, j, Q3ListViewPrivate::r, QList< T >::size(), and Q3ListViewPrivate::vci.
02752 { 02753 for (int j = 0; j < d->iterators.size(); ++j) { 02754 Q3ListViewItemIterator *i = d->iterators.at(j); 02755 i->listView = 0; 02756 } 02757 02758 d->focusItem = 0; 02759 delete d->r; 02760 d->r = 0; 02761 delete d->vci; 02762 d->vci = 0; 02763 #if 0 02764 delete d->toolTip; 02765 d->toolTip = 0; 02766 #endif 02767 delete d; 02768 d = 0; 02769 }
Here is the call graph for this function:

| int Q3ListView::treeStepSize | ( | ) | const |
Definition at line 3080 of file q3listview.cpp.
References d, and Q3ListViewPrivate::levelWidth.
Referenced by adjustColumn(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), drawContentsOffset(), getStyleOption(), handleSizeChange(), Q3CheckListItem::paintFocus(), Q3ListViewItem::startRename(), viewportResizeEvent(), and widthChanged().
03081 { 03082 return d->levelWidth; 03083 }
| void Q3ListView::setTreeStepSize | ( | int | ) | [virtual] |
Definition at line 3085 of file q3listview.cpp.
References d, Q3ListViewPrivate::levelWidth, QWidget::repaint(), and Q3ScrollView::viewport().
03086 { 03087 if (size != d->levelWidth) { 03088 d->levelWidth = size; 03089 viewport()->repaint(); 03090 } 03091 }
Here is the call graph for this function:

| void Q3ListView::insertItem | ( | Q3ListViewItem * | i | ) | [virtual] |
Inserts item i into the list view as a top-level item. You do not need to call this unless you've called takeItem(i) or Q3ListViewItem::takeItem(i) and need to reinsert i elsewhere.
Definition at line 3101 of file q3listview.cpp.
References d, i, and Q3ListViewPrivate::r.
| void Q3ListView::takeItem | ( | Q3ListViewItem * | i | ) | [virtual] |
Removes item i from the list view; i must be a top-level item. The warnings regarding Q3ListViewItem::takeItem() apply to this function, too.
Definition at line 7012 of file q3listview.cpp.
References d, i, and Q3ListViewPrivate::r.
| void Q3ListView::removeItem | ( | Q3ListViewItem * | item | ) | [inline, virtual] |
Removes the given item. Use takeItem() instead.
Definition at line 248 of file q3listview.h.
00248 { takeItem(item); }
| Q3Header * Q3ListView::header | ( | ) | const |
Returns the Q3Header object that manages this list view's columns. Please don't modify the header behind the list view's back.
You may safely call Q3Header::setClickEnabled(), Q3Header::setResizeEnabled(), Q3Header::setMovingEnabled(), Q3Header::hide() and all the const Q3Header functions.
Definition at line 6853 of file q3listview.cpp.
References d, and Q3ListViewPrivate::h.
Referenced by Q3CheckListItem::activate(), Q3FileDialogQFileListView::changeSortColumn2(), contentsMouseReleaseEventEx(), drawContentsOffset(), eventFilter(), handleSizeChange(), Q3FileDialog::init(), inputMethodQuery(), Q3ListViewExtraInfo::loadWidgetExtraInfo(), Q3CheckListItem::paintFocus(), Q3FileDialogQFileListView::Q3FileDialogQFileListView(), Q3ListViewExtraInfo::saveWidgetExtraInfo(), setResizeMode(), Q3ListViewItem::startRename(), updateContents(), and viewportResizeEvent().
| int Q3ListView::addColumn | ( | const QString & | label, | |
| int | width = -1 | |||
| ) | [virtual] |
Adds a width pixels wide column with the column header label to the list view, and returns the index of the new column.
All columns apart from the first one are inserted to the right of the existing ones.
If width is negative, the new column's WidthMode is set to Maximum instead of Manual.
Definition at line 3186 of file q3listview.cpp.
References Q3Header::addLabel(), c, Q3ListViewPrivate::column, d, Q3ListViewPrivate::h, Manual, Maximum, updateGeometries(), and QWidget::updateGeometry().
Referenced by Q3FileDialog::init(), and Q3ListViewExtraInfo::loadWidgetExtraInfo().
03187 { 03188 int c = d->h->addLabel(label, width); 03189 d->column.resize(c+1); 03190 d->column[c].wmode = (width >= 0 ? Manual : Maximum); 03191 updateGeometries(); 03192 updateGeometry(); 03193 return c; 03194 }
Here is the call graph for this function:

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds a width pixels wide new column with the header label and the icon to the list view, and returns the index of the column.
If width is negative, the new column's WidthMode is set to Maximum, and to Manual otherwise.
Definition at line 3208 of file q3listview.cpp.
References Q3Header::addLabel(), c, Q3ListViewPrivate::column, d, Q3ListViewPrivate::h, Manual, Maximum, updateGeometries(), and QWidget::updateGeometry().
03209 { 03210 int c = d->h->addLabel(icon, label, width); 03211 d->column.resize(c+1); 03212 d->column[c].wmode = (width >= 0 ? Manual : Maximum); 03213 updateGeometries(); 03214 updateGeometry(); 03215 return c; 03216 }
Here is the call graph for this function:

| void Q3ListView::removeColumn | ( | int | index | ) | [virtual] |
Removes the column at position index.
Definition at line 3234 of file q3listview.cpp.
References clear(), Q3ListViewPrivate::column, Q3ListViewItem::columns, Q3Header::count(), Q3ListViewItemIterator::current(), d, Q3ListViewPrivate::h, i, LastColumn, Q3ListViewPrivate::ViewColumnInfo::next, next, Q3ListViewPrivate::ItemColumnInfo::next, Q3Header::removeLabel(), Q3ListViewPrivate::resizeMode, Q3Header::setStretchEnabled(), QWidget::update(), updateGeometries(), QWidget::updateGeometry(), Q3ListViewPrivate::vci, and Q3ScrollView::viewport().
03235 { 03236 if (index < 0 || index > (int)d->column.count() - 1) 03237 return; 03238 03239 if (d->vci) { 03240 Q3ListViewPrivate::ViewColumnInfo *vi = d->vci, *prev = 0, *next = 0; 03241 for (int i = 0; i < index; ++i) { 03242 if (vi) { 03243 prev = vi; 03244 vi = vi->next; 03245 } 03246 } 03247 if (vi) { 03248 next = vi->next; 03249 if (prev) 03250 prev->next = next; 03251 vi->next = 0; 03252 delete vi; 03253 if (index == 0) 03254 d->vci = next; 03255 } 03256 } 03257 03258 Q3ListViewItemIterator it(this); 03259 for (; it.current(); ++it) { 03260 Q3ListViewPrivate::ItemColumnInfo *ci = (Q3ListViewPrivate::ItemColumnInfo*)it.current()->columns; 03261 if (ci) { 03262 Q3ListViewPrivate::ItemColumnInfo *prev = 0, *next = 0; 03263 for (int i = 0; i < index; ++i) { 03264 if (ci) { 03265 prev = ci; 03266 ci = ci->next; 03267 } 03268 } 03269 if (ci) { 03270 next = ci->next; 03271 if (prev) 03272 prev->next = next; 03273 ci->next = 0; 03274 delete ci; 03275 if (index == 0) 03276 it.current()->columns = next; 03277 } 03278 } 03279 } 03280 03281 for (int i = index; i < (int)d->column.size() - 1; ++i) 03282 d->column[i] = d->column[i + 1]; 03283 d->column.resize(d->column.size() - 1); 03284 03285 d->h->removeLabel(index); 03286 if (d->resizeMode == LastColumn) 03287 d->h->setStretchEnabled(true, d->h->count() - 1); 03288 03289 updateGeometries(); 03290 if (d->column.count() == 0) 03291 clear(); 03292 updateGeometry(); 03293 viewport()->update(); 03294 }
Here is the call graph for this function:

| void Q3ListView::setColumnText | ( | int | column, | |
| const QString & | label | |||
| ) | [virtual] |
Sets the heading of column column to label.
Definition at line 3301 of file q3listview.cpp.
References d, Q3ListViewPrivate::h, h, Q3Header::setLabel(), updateGeometries(), and QWidget::updateGeometry().
03302 { 03303 if (column < d->h->count()) { 03304 d->h->setLabel(column, label); 03305 updateGeometries(); 03306 updateGeometry(); 03307 } 03308 }
Here is the call graph for this function:

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the heading of column column to icon and label.
Definition at line 3317 of file q3listview.cpp.
References d, Q3ListViewPrivate::h, h, Q3Header::setLabel(), and updateGeometries().
03318 { 03319 if (column < d->h->count()) { 03320 d->h->setLabel(column, icon, label); 03321 updateGeometries(); 03322 } 03323 }
Here is the call graph for this function:

| QString Q3ListView::columnText | ( | int | c | ) | const |
Returns the text of column c.
Definition at line 3353 of file q3listview.cpp.
References d, Q3ListViewPrivate::h, and Q3Header::label().
Here is the call graph for this function:

| void Q3ListView::setColumnWidth | ( | int | column, | |
| int | w | |||
| ) | [virtual] |
Sets the width of column column to w pixels. Note that if the column has a WidthMode other than Manual, this width setting may be subsequently overridden.
Definition at line 3332 of file q3listview.cpp.
References QObject::connect(), d, QObject::disconnect(), emit, Q3ListViewPrivate::h, h, handleSizeChange(), Q3Header::resizeSection(), Q3Header::sectionSize(), SIGNAL, Q3Header::sizeChange(), SLOT, QWidget::update(), and Q3ScrollView::viewport().
Referenced by hideColumn(), and widthChanged().
03333 { 03334 int oldw = d->h->sectionSize(column); 03335 if (column < d->h->count() && oldw != w) { 03336 d->h->resizeSection(column, w); 03337 disconnect(d->h, SIGNAL(sizeChange(int,int,int)), 03338 this, SLOT(handleSizeChange(int,int,int))); 03339 emit d->h->sizeChange(column, oldw, w); 03340 connect(d->h, SIGNAL(sizeChange(int,int,int)), 03341 this, SLOT(handleSizeChange(int,int,int))); 03342 viewport()->update(); 03343 } 03344 }
Here is the call graph for this function:

| int Q3ListView::columnWidth | ( | int | c | ) | const |
Returns the width of column c.
Definition at line 3364 of file q3listview.cpp.
References Q3Header::cellSize(), d, Q3ListViewPrivate::h, and Q3Header::mapToActual().
Referenced by contentsContextMenuEvent(), Q3CheckListItem::paintFocus(), Q3FileDialogQFileListView::startRename(), Q3FileDialogQFileListView::viewportMousePressEvent(), and widthChanged().
Here is the call graph for this function:

| void Q3ListView::setColumnWidthMode | ( | int | c, | |
| WidthMode | mode | |||
| ) | [virtual] |
Sets column {c}'s width mode to mode. The default depends on the original width argument to addColumn().
Definition at line 3395 of file q3listview.cpp.
References Q3ListViewPrivate::column, d, and h.
| Q3ListView::WidthMode Q3ListView::columnWidthMode | ( | int | c | ) | const |
Returns the WidthMode for column c.
Definition at line 3408 of file q3listview.cpp.
References Q3ListViewPrivate::column, d, h, and Manual.
03409 { 03410 if (c >= 0 && c < d->h->count()) 03411 return d->column[c].wmode; 03412 else 03413 return Manual; 03414 }
| int Q3ListView::columns | ( | ) | const |
Definition at line 3225 of file q3listview.cpp.
References Q3ListViewPrivate::column, and d.
Referenced by drawContentsOffset(), Q3ListViewItem::setup(), and Q3ListViewItem::sortChildItems().
| void Q3ListView::setColumnAlignment | ( | int | column, | |
| int | align | |||
| ) | [virtual] |
Sets column {column}'s alignment to align. The alignment is ultimately passed to Q3ListViewItem::paintCell() for each item in the list view. For horizontally aligned text with Qt::AlignLeft or Qt::AlignHCenter the ellipsis (...) will be to the right, for Qt::AlignRight the ellipsis will be to the left.
Definition at line 3427 of file q3listview.cpp.
References d, l, triggerUpdate(), and Q3ListViewPrivate::vci.
Referenced by Q3FileDialog::init().
03428 { 03429 if (column < 0) 03430 return; 03431 if (!d->vci) 03432 d->vci = new Q3ListViewPrivate::ViewColumnInfo; 03433 Q3ListViewPrivate::ViewColumnInfo * l = d->vci; 03434 while(column) { 03435 if (!l->next) 03436 l->next = new Q3ListViewPrivate::ViewColumnInfo; 03437 l = l->next; 03438 column--; 03439 } 03440 if (l->align == align) 03441 return; 03442 l->align = align; 03443 triggerUpdate(); 03444 }
| int Q3ListView::columnAlignment | ( | int | column | ) | const |
Returns the alignment of column column. The default is Qt::AlignAuto.
Definition at line 3454 of file q3listview.cpp.
References d, l, and Q3ListViewPrivate::vci.
Referenced by Q3CheckListItem::activate(), drawContentsOffset(), handleSizeChange(), and Q3CheckListItem::paintFocus().
03455 { 03456 if (column < 0 || !d->vci) 03457 return Qt::AlignAuto; 03458 Q3ListViewPrivate::ViewColumnInfo * l = d->vci; 03459 while(column) { 03460 if (!l->next) 03461 l->next = new Q3ListViewPrivate::ViewColumnInfo; 03462 l = l->next; 03463 column--; 03464 } 03465 return l ? l->align : Qt::AlignAuto; 03466 }
| void Q3ListView::show | ( | ) |
Shows the widget and its child widgets. This function is equivalent to setVisible(true).
Reimplemented from QWidget.
Definition at line 3473 of file q3listview.cpp.
References QWidget::isVisible(), reconfigureItems(), QWidget::show(), and updateGeometries().
03474 { 03475 // Reimplemented to setx the correct background mode and viewed 03476 // area size. 03477 if (!isVisible()) { 03478 reconfigureItems(); 03479 updateGeometries(); 03480 } 03481 Q3ScrollView::show(); 03482 }
Here is the call graph for this function:

| QVariant Q3ListView::inputMethodQuery | ( | Qt::InputMethodQuery | query | ) | const [virtual] |
Reimplemented from QWidget.
Definition at line 4726 of file q3listview.cpp.
References d, Q3ListViewPrivate::focusItem, header(), QWidget::height(), Qt::ImMicroFocus, QWidget::inputMethodQuery(), QRect::isValid(), QWidget::isVisible(), and itemRect().
04727 { 04728 if (query == Qt::ImMicroFocus) { 04729 QRect mfrect = itemRect(d->focusItem); 04730 if (mfrect.isValid() && header() && header()->isVisible()) 04731 mfrect.moveBy(0, header()->height()); 04732 return mfrect; 04733 } 04734 return QWidget::inputMethodQuery(query); 04735 }
Here is the call graph for this function:

| Q3ListViewItem * Q3ListView::itemAt | ( | const QPoint & | viewPos | ) | const |
Returns the list view item at viewPos. Note that viewPos is in the viewport()'s coordinate system, not in the list view's own, much larger, coordinate system.
itemAt() returns 0 if there is no such item.
Note that you also get the pointer to the item if viewPos points to the root decoration (see setRootIsDecorated()) of the item. To check whether or not viewPos is on the root decoration of the item, you can do something like this:
Q3ListViewItem *i = itemAt(p); if (i) { if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin() || p.x() < header()->sectionPos(header()->mapToIndex(0))) { ; // p is not on root decoration else ; // p is on the root decoration }
This might be interesting if you use this function to find out where the user clicked and if you want to start a drag (which you do not want to do if the user clicked onto the root decoration of an item).
Definition at line 5061 of file q3listview.cpp.
References buildDrawableList(), c, Q3ScrollView::contentsWidth(), Q3ScrollView::contentsX(), Q3ScrollView::contentsY(), d, Q3ListViewPrivate::drawables, g, i, QPoint::x(), and QPoint::y().
Referenced by Q3FileDialogQFileListView::acceptDrop(), contentsContextMenuEvent(), contentsDragEnterEvent(), contentsDragMoveEvent(), contentsDropEvent(), contentsMouseDoubleClickEvent(), contentsMouseMoveEvent(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), eventFilter(), QAccessibleListView::itemAt(), keyPressEvent(), Q3FileDialogQFileListView::setCurrentDropItem(), Q3FileDialogQFileListView::viewportMouseMoveEvent(), and Q3FileDialogQFileListView::viewportMousePressEvent().
05062 { 05063 if (viewPos.x() > contentsWidth() - contentsX()) 05064 return 0; 05065 05066 if (d->drawables.isEmpty()) 05067 buildDrawableList(); 05068 05069 int g = viewPos.y() + contentsY(); 05070 05071 for (int i = 0; i < d->drawables.size(); ++i) { 05072 Q3ListViewPrivate::DrawableItem c = d->drawables.at(i); 05073 if (c.y + c.i->height() > g 05074 && c.i->isVisible() && (!c.i->parent() || c.i->parent()->isVisible())) 05075 return c.y <= g ? c.i : 0; 05076 } 05077 return 0; 05078 }
Here is the call graph for this function:

| QRect Q3ListView::itemRect | ( | const Q3ListViewItem * | item | ) | const |
Returns the rectangle on the screen that item item occupies in viewport()'s coordinates, or an invalid rectangle if item is 0 or is not currently visible.
The rectangle returned does not include any children of the rectangle (i.e. it uses Q3ListViewItem::height(), rather than Q3ListViewItem::totalHeight()). If you want the rectangle to include children you can use something like this:
QRect r(listView->itemRect(item)); r.setHeight(qMin(item->totalHeight(), listView->viewport->height() - r.y()))
Note the way it avoids too-high rectangles. totalHeight() can be much larger than the window system's coordinate system allows.
itemRect() is comparatively slow. It's best to call it only for items that are probably on-screen.
Definition at line 5405 of file q3listview.cpp.
References buildDrawableList(), c, Q3ScrollView::contentsX(), Q3ScrollView::contentsY(), d, Q3ListViewPrivate::drawables, Q3ListViewPrivate::h, i, QWidget::width(), and QWidget::y().
Referenced by Q3FileDialogQFileListView::acceptDrop(), contentsContextMenuEvent(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), doAutoScroll(), Q3FileDialog::doMimeTypeLookup(), drawContentsOffset(), handleSizeChange(), inputMethodQuery(), QAccessibleListView::itemRect(), keyPressEvent(), Q3FileDialogQFileListView::setCurrentDropItem(), Q3ListViewItem::startRename(), Q3FileDialogQFileListView::startRename(), updateDirtyItems(), and viewportResizeEvent().
05406 { 05407 if (d->drawables.isEmpty()) 05408 buildDrawableList(); 05409 05410 for (int i = 0; i < d->drawables.size(); ++i) { 05411 const Q3ListViewPrivate::DrawableItem &c = d->drawables.at(i); 05412 if (c.i == item) { 05413 int y = c.y - contentsY(); 05414 if (y + c.i->height() >= 0 && y < ((Q3ListView *)this)->visibleHeight()) { 05415 return QRect(-contentsX(), y, d->h->width(), c.i->height());; 05416 } 05417 } 05418 } 05419 05420 return QRect(0, 0, -1, -1); 05421 }
Here is the call graph for this function:

| int Q3ListView::itemPos | ( | const Q3ListViewItem * | item | ) |
Returns the y-coordinate of item in the list view's coordinate system. This function is normally much slower than itemAt() but it works for all items, whereas itemAt() normally works only for items on the screen.
This is a thin wrapper around Q3ListViewItem::itemPos().
Definition at line 5092 of file q3listview.cpp.
References Q3ListViewItem::itemPos().
Referenced by doAutoScroll(), and ensureItemVisible().
05093 { 05094 return item ? item->itemPos() : 0; 05095 }
Here is the call graph for this function:

| void Q3ListView::ensureItemVisible | ( | const Q3ListViewItem * | i | ) |
Ensures that item i is visible, scrolling the list view vertically if necessary and opening (expanding) any parent items if this is required to show the item.
Definition at line 6815 of file q3listview.cpp.
References Q3ScrollView::contentsX(), Q3ScrollView::contentsY(), d, h, i, QWidget::isVisible(), itemPos(), QObject::parent(), Q3ListViewPrivate::r, setContentsPos(), updateGeometries(), Q3ScrollView::visibleHeight(), and QWidget::y().
Referenced by keyPressEvent(), Q3FileDialogQFileListView::keyPressEvent(), makeVisible(), setOpen(), and Q3ListViewItem::startRename().
06816 { 06817 if (!i || !i->isVisible()) 06818 return; 06819 06820 Q3ListViewItem *parent = i->parent(); 06821 while (parent) { 06822 if (!parent->isOpen()) 06823 parent->setOpen(true); 06824 parent = parent->parent(); 06825 } 06826 06827 if (d->r->maybeTotalHeight < 0) 06828 updateGeometries(); 06829 int y = itemPos(i); 06830 int h = i->height(); 06831 if (isVisible() && y + h > contentsY() + visibleHeight()) 06832 setContentsPos(contentsX(), y - visibleHeight() + h); 06833 else if (!isVisible() || y < contentsY()) 06834 setContentsPos(contentsX(), y); 06835 }
Here is the call graph for this function:

| void Q3ListView::repaintItem | ( | const Q3ListViewItem * | item | ) | const |
Repaints item on the screen if item is currently visible. Takes care to avoid multiple repaints.
Definition at line 5825 of file q3listview.cpp.
References QList< T >::append(), d, Q3ListViewPrivate::dirtyItems, Q3ListViewPrivate::dirtyItemTimer, and QTimer::start().
Referenced by contentsMousePressEventEx(), contentsMouseReleaseEventEx(), focusInEvent(), focusOutEvent(), Q3ListViewItem::insertItem(), Q3ListViewItem::repaint(), setCurrentItem(), and setSelected().
05826 { 05827 if (!item) 05828 return; 05829 d->dirtyItemTimer->start(0, true); 05830 d->dirtyItems.append(item); 05831 }
Here is the call graph for this function:

| void Q3ListView::setMultiSelection | ( | bool | enable | ) | [virtual] |
Definition at line 5112 of file q3listview.cpp.
References d, Extended, Multi, Q3ListViewPrivate::selectionMode, and Single.
05113 { 05114 if (!enable) 05115 d->selectionMode = Q3ListView::Single; 05116 else if ( d->selectionMode != Multi && d->selectionMode != Extended) 05117 d->selectionMode = Q3ListView::Multi; 05118 }
| bool Q3ListView::isMultiSelection | ( | ) | const |
Definition at line 5120 of file q3listview.cpp.
References d, Extended, Multi, and Q3ListViewPrivate::selectionMode.
05121 { 05122 return d->selectionMode == Q3ListView::Extended || d->selectionMode == Q3ListView::Multi; 05123 }
| void Q3ListView::setSelectionMode | ( | SelectionMode | mode | ) |
Definition at line 5135 of file q3listview.cpp.
References clearSelection(), currentItem(), d, Extended, Multi, NoSelection, Q3ListViewItem::selected, Q3ListViewPrivate::selectionMode, and Single.
Referenced by Q3FileDialog::setMode().
05136 { 05137 if (d->selectionMode == mode) 05138 return; 05139 05140 if ((d->selectionMode == Multi || d->selectionMode == Extended) && 05141 (mode == Q3ListView::Single || mode == Q3ListView::NoSelection)){ 05142 clearSelection(); 05143 if ((mode == Q3ListView::Single) && currentItem()) 05144 currentItem()->selected = true; 05145 } 05146 05147 d->selectionMode = mode; 05148 }
Here is the call graph for this function:

| Q3ListView::SelectionMode Q3ListView::selectionMode | ( | ) | const |
Definition at line 5150 of file q3listview.cpp.
References d, and Q3ListViewPrivate::selectionMode.
Referenced by contentsMousePressEventEx(), Q3ListViewItem::setSelected(), and setSelected().
05151 { 05152 return d->selectionMode; 05153 }
| void Q3ListView::clearSelection | ( | ) | [virtual] |
Sets all the items to be not selected, updates the list view as necessary, and emits the selectionChanged() signals. Note that for Multi selection list views this function needs to iterate over all items.
Definition at line 5224 of file q3listview.cpp.
References selectAll().
Referenced by clear(), QAccessibleListView::clearSelection(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), Q3FileDialogQFileListView::keyPressEvent(), setSelectionMode(), and Q3FileDialog::urlStart().
05225 { 05226 selectAll(false); 05227 }
| void Q3ListView::setSelected | ( | Q3ListViewItem * | item, | |
| bool | selected | |||
| ) | [virtual] |
If selected is true the item is selected; otherwise it is unselected.
If the list view is in Single selection mode and selected is true, the currently selected item is unselected and item is made current. Unlike Q3ListViewItem::setSelected(), this function updates the list view as necessary and emits the selectionChanged() signals.
Definition at line 5170 of file q3listview.cpp.
References currentChanged(), d, emit, Q3ListViewPrivate::focusItem, Q3ListViewItem::isSelectable(), Q3ListViewItem::isSelected(), NoSelection, o, repaintItem(), Q3ListViewItem::selected, selectionChanged(), selectionMode(), Q3ListViewPrivate::selectionMode, Q3ListViewItem::setSelected(), and Single.
Referenced by contentsMouseMoveEvent(), contentsMousePressEventEx(), Q3FileDialog::createdDirectory(), doAutoScroll(), handleItemChange(), keyPressEvent(), Q3FileDialog::keyPressEvent(), Q3FileDialog::listBoxSelectionChanged(), Q3FileDialog::popupContextMenu(), selectAll(), QAccessibleListView::setSelected(), and Q3FileDialogQFileListView::startRename().
05171 { 05172 if (!item || item->isSelected() == selected || 05173 !item->isSelectable() || selectionMode() == NoSelection) 05174 return; 05175 05176 bool emitHighlighted = false; 05177 if (selectionMode() == Single && d->focusItem != item) { 05178 Q3ListViewItem *o = d->focusItem; 05179 if (d->focusItem && d->focusItem->selected) 05180 d->focusItem->setSelected(false); 05181 d->focusItem = item; 05182 if (o) 05183 repaintItem(o); 05184 emitHighlighted = true; 05185 } 05186 05187 item->setSelected(selected); 05188 05189 repaintItem(item); 05190 05191 if (d->selectionMode == Single && selected) 05192 emit selectionChanged(item); 05193 emit selectionChanged(); 05194 05195 if (emitHighlighted) 05196 emit currentChanged(d->focusItem); 05197 }
Here is the call graph for this function:

| void Q3ListView::setSelectionAnchor | ( | Q3ListViewItem * | item | ) |
Sets the selection anchor to item, if item is selectable.
The selection anchor is the item that remains selected when Shift-selecting with either mouse or keyboard in Extended selection mode.
Definition at line 5209 of file q3listview.cpp.
References d, Q3ListViewItem::isSelectable(), and Q3ListViewPrivate::selectAnchor.
05210 { 05211 if (item && item->isSelectable()) 05212 d->selectAnchor = item; 05213 }
Here is the call graph for this function:

| bool Q3ListView::isSelected | ( | const Q3ListViewItem * | i | ) | const |
Returns true if the list view item i is selected; otherwise returns false.
Definition at line 5291 of file q3listview.cpp.
References i.
Referenced by Q3FileDialog::fileNameEditReturnPressed(), and Q3FileDialog::updateFileNameEdit().
| Q3ListViewItem * Q3ListView::selectedItem | ( | ) | const |
Returns the selected item if the list view is in Single selection mode and an item is selected.
If no items are selected or the list view is not in Single selection mode this function returns 0.
Definition at line 5307 of file q3listview.cpp.
References d, Q3ListViewPrivate::focusItem, Q3ListViewItem::isSelected(), Q3ListViewPrivate::selectionMode, and Single.
Referenced by Q3ListViewItem::takeItem().
05308 { 05309 if (d->selectionMode != Single) 05310 return 0; 05311 if (d->focusItem && d->focusItem->isSelected()) 05312 return d->focusItem; 05313 return 0; 05314 }
Here is the call graph for this function:

| void Q3ListView::setOpen | ( | Q3ListViewItem * | item, | |
| bool | open | |||
| ) | [virtual] |
Sets item to be open if open is true and item is expandable, and to be closed if open is false. Repaints accordingly.
Definition at line 6725 of file q3listview.cpp.
References QList< T >::append(), buildDrawableList(), c, Q3ListViewItem::childCount(), d, Q3ListViewPrivate::dirtyItems, Q3ListViewPrivate::dirtyItemTimer, Q3ListViewPrivate::drawables, ensureItemVisible(), i, Q3ListViewItem::isExpandable(), Q3ListViewItem::isOpen(), Q3ListViewItem::itemBelow(), Q3ListViewItem::setOpen(), and QTimer::start().
Referenced by contentsMouseDoubleClickEvent(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), and keyPressEvent().
06726 { 06727 if (!item || 06728 item->isOpen() == open || 06729 (open && !item->childCount() && !item->isExpandable())) 06730 return; 06731 06732 Q3ListViewItem* nextParent = 0; 06733 if (open) 06734 nextParent = item->itemBelow(); 06735 06736 item->setOpen(open); 06737 06738 if (open) { 06739 Q3ListViewItem* lastChild = item; 06740 Q3ListViewItem* tmp; 06741 while (true) { 06742 tmp = lastChild->itemBelow(); 06743 if (tmp == nextParent) 06744 break; 06745 lastChild = tmp; 06746 } 06747 ensureItemVisible(lastChild); 06748 ensureItemVisible(item); 06749 } 06750 buildDrawableList(); 06751 06752 int i = 0; 06753 for (; i < d->drawables.size(); ++i) { 06754 const Q3ListViewPrivate::DrawableItem &c = d->drawables.at(i); 06755 if(c.i == item) 06756 break; 06757 } 06758 06759 if (i < d->drawables.size()) { 06760 d->dirtyItemTimer->start(0, true); 06761 for (; i < d->drawables.size(); ++i) { 06762 const Q3ListViewPrivate::DrawableItem &c = d->drawables.at(i); 06763 d->dirtyItems.append(c.i); 06764 } 06765 } 06766 }
Here is the call graph for this function:

| bool Q3ListView::isOpen | ( | const Q3ListViewItem * | item | ) | const |
Returns true if this list view item has children and they are not explicitly hidden; otherwise returns false.
Identical to {item}->isOpen(). Provided for completeness.
Definition at line 6778 of file q3listview.cpp.
References Q3ListViewItem::isOpen().
06779 { 06780 return item->isOpen(); 06781 }
Here is the call graph for this function:

| void Q3ListView::setCurrentItem | ( | Q3ListViewItem * | i | ) | [virtual] |
Sets item i to be the current item and repaints appropriately (i.e. highlights the item). The current item is used for keyboard navigation and focus indication; it is independent of any selected items, although a selected item can also be the current item.
Definition at line 5326 of file q3listview.cpp.
References Q3ListViewItem::cancelRename(), currentChanged(), currentItem(), d, Q3ListViewPrivate::defRenameAction, emit, QAccessible::Focus, Q3ListViewPrivate::focusItem, i, indexOfItem(), NoSelection, Q3ListViewItem::okRename(), Reject, repaintItem(), Q3ListViewItem::selected, selectionChanged(), Q3ListViewPrivate::selectionMode, Q3ListViewItem::setSelected(), Single, QAccessible::updateAccessibility(), and Q3ScrollView::viewport().
Referenced by contentsDragLeaveEvent(), contentsDropEvent(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), Q3FileDialog::createdDirectory(), doAutoScroll(), keyPressEvent(), Q3FileDialogQFileListView::keyPressEvent(), Q3FileDialog::popupContextMenu(), Q3FileDialogQFileListView::setCurrentDropItem(), and Q3ListViewItem::startRename().
05327 { 05328 if (!i || d->focusItem == i || !i->isEnabled()) 05329 return; 05330 05331 if (currentItem() && currentItem()->renameBox) { 05332 if (d->defRenameAction == Reject) 05333 currentItem()->cancelRename(currentItem()->renameCol); 05334 else 05335 currentItem()->okRename(currentItem()->renameCol); 05336 } 05337 05338 Q3ListViewItem * prev = d->focusItem; 05339 d->focusItem = i; 05340 05341 if (i != prev) { 05342 if (i && d->selectionMode == Single) { 05343 bool changed = false; 05344 if (prev && prev->selected) { 05345 changed = true; 05346 prev->setSelected(false); 05347 } 05348 if (i && !i->selected && d->selectionMode != NoSelection && i->isSelectable()) { 05349 i->setSelected(true); 05350 changed = true; 05351 emit selectionChanged(i); 05352 } 05353 if (changed) 05354 emit selectionChanged(); 05355 } 05356 05357 if (i) 05358 repaintItem(i); 05359 if (prev) 05360 repaintItem(prev); 05361 emit currentChanged(i); 05362 05363 #ifndef QT_NO_ACCESSIBILITY 05364 QAccessible::updateAccessibility(viewport(), indexOfItem(i), QAccessible::Focus); 05365 #endif 05366 } 05367 }
Here is the call graph for this function:

| Q3ListViewItem * Q3ListView::currentItem | ( | ) | const |
Returns the current item, or 0 if there isn't one.
Definition at line 5376 of file q3listview.cpp.
References d, and Q3ListViewPrivate::focusItem.
Referenced by Q3FileDialogQFileListView::cancelRename(), Q3FileDialog::changeMode(), changeSortColumn(), contentsContextMenuEvent(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), Q3FileDialog::detailViewSelectionChanged(), drawContentsOffset(), Q3FileDialog::eventFilter(), eventFilter(), Q3FileDialog::fileNameEditReturnPressed(), Q3FileDialog::fixupNameEdit(), handleIndexChange(), handleSizeChange(), Q3ListViewItem::insertItem(), isRenaming(), keyPressEvent(), Q3FileDialogQFileListView::keyPressEvent(), Q3FileDialog::okClicked(), Q3FileDialogQFileListView::rename(), setCurrentItem(), QAccessibleListView::setSelected(), setSelectionMode(), Q3ListViewItem::startRename(), startRename(), Q3FileDialogQFileListView::startRename(), Q3ListViewItem::takeItem(), Q3FileDialog::updateFileNameEdit(), Q3FileDialogQFileListView::viewportMousePressEvent(), and viewportResizeEvent().
| Q3ListViewItem * Q3ListView::firstChild | ( | ) | const |
Returns the first item in this Q3ListView. Returns 0 if there is no first item.
A list view's items can be traversed using firstChild() and nextSibling() or using a Q3ListViewItemIterator.
Definition at line 5777 of file q3listview.cpp.
References d, and Q3ListViewPrivate::r.
Referenced by adjustColumn(), Q3FileDialog::createdDirectory(), Q3ListViewItemIterator::currentRemoved(), Q3FileDialog::detailViewSelectionChanged(), Q3FileDialog::eventFilter(), findItem(), focusInEvent(), Q3ListViewItem::insertItem(), keyPressEvent(), Q3FileDialog::keyPressEvent(), Q3FileDialogQFileListView::keyPressEvent(), lastItem(), Q3ListViewItemIterator::operator--(), and selectRange().
05778 { 05779 if (!d->r) 05780 return 0; 05781 05782 d->r->enforceSortOrder(); 05783 return d->r->childItem; 05784 }
| Q3ListViewItem * Q3ListView::lastItem | ( | ) | const |
Returns the last item in the list view tree. Returns 0 if there are no items in the Q3ListView.
This function is slow because it traverses the entire tree to find the last item.
Definition at line 5794 of file q3listview.cpp.
References Q3ListViewItem::firstChild(), firstChild(), and Q3ListViewItem::nextSibling().
05795 { 05796 Q3ListViewItem* item = firstChild(); 05797 if (item) { 05798 while (item->nextSibling() || item->firstChild()) { 05799 if (item->nextSibling()) 05800 item = item->nextSibling(); 05801 else 05802 item = item->firstChild(); 05803 } 05804 } 05805 return item; 05806 }
Here is the call graph for this function:

| int Q3ListView::childCount | ( | ) | const |
Definition at line 6869 of file q3listview.cpp.
References d, and Q3ListViewPrivate::r.
Referenced by Q3FileDialog::resortDir().
| void Q3ListView::setAllColumnsShowFocus | ( | bool | ) | [virtual] |
Definition at line 5756 of file q3listview.cpp.
References Q3ListViewPrivate::allColumnsShowFocus, and d.
05757 { 05758 d->allColumnsShowFocus = enable; 05759 }
| bool Q3ListView::allColumnsShowFocus | ( | ) | const |
Definition at line 5761 of file q3listview.cpp.
References Q3ListViewPrivate::allColumnsShowFocus, and d.
Referenced by contentsContextMenuEvent().
05762 { 05763 return d->allColumnsShowFocus; 05764 }
| void Q3ListView::setItemMargin | ( | int | ) | [virtual] |
Definition at line 5606 of file q3listview.cpp.
References d, Q3ListViewPrivate::drawables, QWidget::isVisible(), Q3ListViewPrivate::margin, and triggerUpdate().
05607 { 05608 if (d->margin == m) 05609 return; 05610 d->margin = m; 05611 if (isVisible()) { 05612 d->drawables.clear(); 05613 triggerUpdate(); 05614 } 05615 }
Here is the call graph for this function:

| int Q3ListView::itemMargin | ( | ) | const |
Definition at line 5617 of file q3listview.cpp.
References d, and Q3ListViewPrivate::margin.
Referenced by Q3CheckListItem::activate(), adjustColumn(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), drawContentsOffset(), getStyleOption(), handleSizeChange(), Q3CheckListItem::paintCell(), Q3ListViewItem::paintCell(), Q3CheckListItem::paintFocus(), Q3ListViewItem::setup(), Q3ListViewItem::startRename(), viewportResizeEvent(), Q3ListViewItem::width(), and Q3CheckListItem::width().
| void Q3ListView::setRootIsDecorated | ( | bool | ) | [virtual] |
Definition at line 6792 of file q3listview.cpp.
References d, QWidget::isVisible(), Q3ListViewPrivate::rootIsExpandable, and triggerUpdate().
06793 { 06794 if (enable != (bool)d->rootIsExpandable) { 06795 d->rootIsExpandable = enable; 06796 if (isVisible()) 06797 triggerUpdate(); 06798 } 06799 }
Here is the call graph for this function:

| bool Q3ListView::rootIsDecorated | ( | ) | const |
Definition at line 6801 of file q3listview.cpp.
References d, and Q3ListViewPrivate::rootIsExpandable.
Referenced by adjustColumn(), contentsMousePressEventEx(), contentsMouseReleaseEventEx(), drawContentsOffset(), getStyleOption(), handleSizeChange(), Q3CheckListItem::paintFocus(), Q3ListViewItem::startRename(), viewportResizeEvent(), and widthChanged().
06802 { 06803 return d->rootIsExpandable; 06804 }
| void Q3ListView::setSorting | ( | int | column, | |
| bool | ascending = true | |||
| ) | [virtual] |
Sets the list view to be sorted by column column in ascending order if ascending is true or descending order if it is false.
If column is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers. If column is larger than the number of columns the user must click on a column header to sort the list view.
Definition at line 5475 of file q3listview.cpp.
References Q3ListViewPrivate::ascending, d, Q3ListViewPrivate::h, QAccessible::ObjectReorder, Q3Header::setSortIndicator(), Q3ListViewPrivate::sortcolumn, Q3ListViewPrivate::sortIndicator, triggerUpdate(), Unsorted, QAccessible::updateAccessibility(), and Q3ScrollView::viewport().
Referenced by changeSortColumn(), setSortColumn(), Q3FileDialogQFileListView::setSorting(), and setSortOrder().
05476 { 05477 if (column == -1) 05478 column = Unsorted; 05479 05480 if (d->sortcolumn == column && d->ascending == ascending) 05481 return; 05482 05483 d->ascending = ascending; 05484 d->sortcolumn = column; 05485 if (d->sortcolumn != Unsorted && d->sortIndicator) 05486 d->h->setSortIndicator(d->sortcolumn, d->ascending); 05487 else 05488 d->h->setSortIndicator(-1); 05489 05490 triggerUpdate(); 05491 05492 #ifndef QT_NO_ACCESSIBILITY 05493 QAccessible::updateAccessibility(viewport(), 0, QAccessible::ObjectReorder); 05494 #endif 05495 }
Here is the call graph for this function:

| int Q3ListView::sortColumn | ( | ) | const |
Returns the column by which the list view is sorted, or -1 if sorting is disabled.
Definition at line 5542 of file q3listview.cpp.
References d, and Q3ListViewPrivate::sortcolumn.
05543 { 05544 return d->sortcolumn; 05545 }
| void Q3ListView::setSortColumn | ( | int | column | ) |
Sets the sorting column for the list view.
If column is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers. If column is larger than the number of columns the user must click on a column header to sort the list view.
Definition at line 5557 of file q3listview.cpp.
References Q3ListViewPrivate::ascending, d, and setSorting().
05558 { 05559 setSorting(column, d->ascending); 05560 }
Here is the call graph for this function:

| Qt::SortOrder Q3ListView::sortOrder | ( | ) | const |
Returns the sorting order of the list view items.
Definition at line 5567 of file q3listview.cpp.
References Q3ListViewPrivate::ascending, Qt::AscendingOrder, d, and Qt::DescendingOrder.
05568 { 05569 if (d->ascending) 05570 return Qt::AscendingOrder; 05571 return Qt::DescendingOrder; 05572 }
| void Q3ListView::setSortOrder | ( | Qt::SortOrder | order | ) |
Sets the sort order for the items in the list view to order.
Definition at line 5579 of file q3listview.cpp.
References Qt::AscendingOrder, d, setSorting(), and Q3ListViewPrivate::sortcolumn.
05580 { 05581 setSorting(d->sortcolumn, order == Qt::AscendingOrder ? true : false); 05582 }
Here is the call graph for this function:

| void Q3ListView::sort | ( | ) | [virtual] |
Sorts the list view using the last sorting configuration (sort column and ascending/descending).
Definition at line 5589 of file q3listview.cpp.
References d, and Q3ListViewPrivate::r.
Redirects the event e relating to object o, for the viewport to mousePressEvent(), keyPressEvent() and friends.
Reimplemented from Q3ScrollView.
Definition at line 3685 of file q3listview.cpp.
References Q3ListViewItem::cancelRename(), currentItem(), d, Q3ListViewPrivate::defRenameAction, Q3ScrollView::eventFilter(), QEvent::FocusIn, focusInEvent(), QEvent::FocusOut, focusOutEvent(), QHelpEvent::globalPos(), Q3ListViewPrivate::h, header(), QWidget::height(), i, itemAt(), Qt::Key_Enter, Qt::Key_Escape, Qt::Key_Return, QEvent::KeyPress, QEvent::MouseButtonDblClick, QEvent::MouseButtonPress, QEvent::MouseMove, Q3ListViewPrivate::ItemColumnInfo::next, o, Q3ListViewItem::okRename(), Qt::PopupFocusReason, QHelpEvent::pos(), QCoreApplication::postEvent(), Reject, Qt::RightButton, Q3Header::sectionAt(), QToolTip::showText(), showToolTips(), QEvent::ToolTip, Q3ListViewPrivate::ItemColumnInfo::truncated, QEvent::type(), Q3ScrollView::viewport(), Q3ScrollView::viewportMouseMoveEvent(), and Q3ScrollView::viewportToContents().
03686 { 03687 if (o == d->h && 03688 e->type() >= QEvent::MouseButtonPress && 03689 e->type() <= QEvent::MouseMove) { 03690 QMouseEvent * me = (QMouseEvent *)e; 03691 QMouseEvent me2(me->type(), 03692 QPoint(me->pos().x(), 03693 me->pos().y() - d->h->height()), 03694 me->button(), me->state()); 03695 switch(me2.type()) { 03696 case QEvent::MouseButtonDblClick: 03697 if (me2.button() == Qt::RightButton) 03698 return true; 03699 break; 03700 case QEvent::MouseMove: 03701 if (me2.state() & Qt::RightButton) { 03702 viewportMouseMoveEvent(&me2); 03703 return true; 03704 } 03705 break; 03706 default: 03707 break; 03708 } 03709 } else if (o == viewport()) { 03710 QFocusEvent * fe = (QFocusEvent *)e; 03711 03712 switch(e->type()) { 03713 case QEvent::FocusIn: 03714 focusInEvent(fe); 03715 return true; 03716 case QEvent::FocusOut: 03717 focusOutEvent(fe); 03718 return true; 03719 #ifndef QT_NO_TOOLTIP 03720 case QEvent::ToolTip: 03721 { 03722 if (!showToolTips()) 03723 return false; 03724 03725 QHelpEvent *he = static_cast<QHelpEvent *>(e); 03726 Q3ListViewItem *item = itemAt(he->pos()); 03727 QPoint contentsPos = viewportToContents(he->pos()); 03728 if (!item || !item->columns) { 03729 QToolTip::showText(he->globalPos(), QString(), viewport()); 03730 return true; 03731 } 03732 int col = header()->sectionAt(contentsPos.x()); 03733 Q3ListViewPrivate::ItemColumnInfo *ci = (Q3ListViewPrivate::ItemColumnInfo*)item->columns; 03734 for (int i = 0; ci && (i < col); ++i) 03735 ci = ci->next; 03736 03737 if (!ci || !ci->truncated) 03738 QToolTip::showText(he->globalPos(), QString(), viewport()); 03739 else 03740 QToolTip::showText(he->globalPos(), item->text(col), viewport()); 03741 return true; 03742 } 03743 #endif 03744 default: 03745 // nothing 03746 break; 03747 } 03748 } else if (qobject_cast<QLineEdit*>(o)) { 03749 if (currentItem() && currentItem()->renameBox) { 03750 if (e->type() == QEvent::KeyPress) { 03751 QKeyEvent *ke = (QKeyEvent*)e; 03752 if (ke->key() == Qt::Key_Return || 03753 ke->key() == Qt::Key_Enter) { 03754 currentItem()->okRename(currentItem()->renameCol); 03755 return true; 03756 } else if (ke->key() == Qt::Key_Escape) { 03757 currentItem()->cancelRename(currentItem()->renameCol); 03758 return true; 03759 } 03760 } else if (e->type() == QEvent::FocusOut) { 03761 if (((QFocusEvent*)e)->reason() != Qt::PopupFocusReason) { 03762 QCustomEvent *e = new QCustomEvent(9999); 03763 QApplication::postEvent(o, e); 03764 return true; 03765 } 03766 } else if (e->type() == 9999) { 03767 if (d->defRenameAction == Reject) 03768 currentItem()->cancelRename(currentItem()->renameCol); 03769 else 03770 currentItem()->okRename(currentItem()->renameCol); 03771 return true; 03772 } 03773 } 03774 } 03775 03776 return Q3ScrollView::eventFilter(o, e); 03777 }
Here is the call graph for this function:

| QSize Q3ListView::sizeHint | ( | ) | const [virtual] |
Reimplemented from Q3ScrollView.
Definition at line 6672 of file q3listview.cpp.
References buildDrawableList(), Q3ScrollView::cachedSizeHint(), d, Q3ListViewPrivate::drawables, QWidget::ensurePolished(), Q3Frame::frameWidth(), Q3ListViewPrivate::h, QWidget::isVisible(), l, QStyle::pixelMetric(), QStyle::PM_ScrollBarExtent, Q3ListViewPrivate::r, s, Q3ScrollView::setCachedSizeHint(), Q3Header::sizeHint(), QWidget::style(), and Q3ScrollView::verticalScrollBar().
Referenced by Q3FileDialog::init().
06673 { 06674 if (cachedSizeHint().isValid()) 06675 return cachedSizeHint(); 06676 06677 ensurePolished(); 06678 06679 if (!isVisible() && d->drawables.isEmpty()) 06680 // force the column widths to sanity, if possible 06681 buildDrawableList(); 06682 06683 QSize s(d->h->sizeHint()); 06684 if (verticalScrollBar()->isVisible()) 06685 s.setWidth(s.width() + style()->pixelMetric(QStyle::PM_ScrollBarExtent)); 06686 s += QSize(frameWidth()*2,frameWidth()*2); 06687 Q3ListViewItem * l = d->r; 06688 while(l && !l->height()) 06689 l = l->childItem ? l->childItem : l->siblingItem; 06690 06691 if (l && l->height()) 06692 s.setHeight(s.height() + 10 * l->height()); 06693 else 06694 s.setHeight(s.height() + 140); 06695 06696 if (s.width() > s.height() * 3) 06697 s.setHeight(s.width() / 3); 06698 else if (s.width() *3 < s.height()) 06699 s.setHeight(s.width() * 3); 06700 06701 setCachedSizeHint(s); 06702 06703 return s; 06704 }
Here is the call graph for this function:

| QSize Q3ListView::minimumSizeHint | ( | ) | const [virtual] |
Reimplemented from Q3ScrollView.
Definition at line 6711 of file q3listview.cpp.
References Q3ScrollView::minimumSizeHint().
06712 { 06713 return Q3ScrollView::minimumSizeHint(); 06714 }
Here is the call graph for this function:

| void Q3ListView::setShowSortIndicator | ( | bool | show | ) | [virtual] |
Definition at line 2680 of file q3listview.cpp.
References Q3ListViewPrivate::ascending, d, Q3ListViewPrivate::h, Q3Header::setSortIndicator(), Q3ListViewPrivate::sortcolumn, Q3ListViewPrivate::sortIndicator, and Unsorted.
02681 { 02682 if (show == d->sortIndicator) 02683 return; 02684 02685 d->sortIndicator = show; 02686 if (d->sortcolumn != Unsorted && d->sortIndicator) 02687 d->h->setSortIndicator(d->sortcolumn, d->ascending); 02688 else 02689 d->h->setSortIndicator(-1); 02690 }
Here is the call graph for this function:

| bool Q3ListView::showSortIndicator | ( | ) | const |
Definition at line 2692 of file q3listview.cpp.
References d, and Q3ListViewPrivate::sortIndicator.
Referenced by widthChanged().
02693 { 02694 return d->sortIndicator; 02695 }
| void Q3ListView::setShowToolTips | ( | bool | b | ) | [virtual] |
| bool Q3ListView::showToolTips | ( | ) | const |
Definition at line 2709 of file q3listview.cpp.
References d, and Q3ListViewPrivate::toolTips.
Referenced by eventFilter().
| void Q3ListView::setResizeMode | ( | ResizeMode | m | ) | [virtual] |
Definition at line 2730 of file q3listview.cpp.
References AllColumns, d, header(), NoColumn, Q3ListViewPrivate::resizeMode, and Q3Header::setStretchEnabled().
02731 { 02732 d->resizeMode = m; 02733 if (m == NoColumn) 02734 header()->setStretchEnabled(false); 02735 else if (m == AllColumns) 02736 header()->setStretchEnabled(true); 02737 else 02738 header()->setStretchEnabled(true, header()->count() - 1); 02739 }
Here is the call graph for this function:

| Q3ListView::ResizeMode Q3ListView::resizeMode | ( | ) | const |
Definition at line 2741 of file q3listview.cpp.
References d, and Q3ListViewPrivate::resizeMode.
Referenced by viewportResizeEvent().
02742 { 02743 return d->resizeMode; 02744 }
| Q3ListViewItem * Q3ListView::findItem | ( | const QString & | text, | |
| int | column, | |||
| ComparisonFlags | compare = ExactMatch | Qt::CaseSensitive | |||
| ) | const |
Finds the first list view item in column column, that matches text and returns the item, or returns 0 of no such item could be found. Pass OR-ed together ComparisonFlags values in the compare flag, to control how the matching is performed. The default comparison mode is case-sensitive, exact match.
Definition at line 7830 of file q3listview.cpp.
References BeginsWith, Qt::CaseSensitive, CaseSensitive, QString::contains(), Q3ListViewItemIterator::current(), d, EndsWith, QString::endsWith(), ExactMatch, firstChild(), Q3ListViewPrivate::focusItem, QString::isEmpty(), Q3ListViewItemIterator, QString::startsWith(), Q3ListViewItem::text(), and QString::toLower().
07832 { 07833 if (text.isEmpty() && !(compare & ExactMatch)) 07834 return 0; 07835 07836 if (compare == Qt::CaseSensitive || compare == 0) 07837 compare |= ExactMatch; 07838 07839 QString itmtxt; 07840 QString comtxt = text; 07841 if (!(compare & Qt::CaseSensitive)) 07842 comtxt = comtxt.toLower(); 07843 07844 Q3ListViewItemIterator it(d->focusItem ? d->focusItem : firstChild()); 07845 Q3ListViewItem *sentinel = 0; 07846 Q3ListViewItem *item; 07847 Q3ListViewItem *beginsWithItem = 0; 07848 Q3ListViewItem *endsWithItem = 0; 07849 Q3ListViewItem *containsItem = 0; 07850 07851 for (int pass = 0; pass < 2; pass++) { 07852 while ((item = it.current()) != sentinel) { 07853 itmtxt = item->text(column); 07854 if (!(compare & CaseSensitive)) 07855 itmtxt = itmtxt.toLower(); 07856 07857 if ((compare & ExactMatch)==ExactMatch && itmtxt == comtxt) 07858 return item; 07859 if (compare & BeginsWith && !beginsWithItem && itmtxt.startsWith(comtxt)) 07860 beginsWithItem = containsItem = item; 07861 if (compare & EndsWith && !endsWithItem && itmtxt.endsWith(comtxt)) 07862 endsWithItem = containsItem = item; 07863 if ((compare & ExactMatch)==0 && !containsItem && itmtxt.contains(comtxt)) 07864 containsItem = item; 07865 ++it; 07866 } 07867 07868 it = Q3ListViewItemIterator(firstChild()); 07869 sentinel = d->focusItem ? d->focusItem : firstChild(); 07870 } 07871 07872 // Obey the priorities 07873 if (beginsWithItem) 07874 return beginsWithItem; 07875 else if (endsWithItem) 07876 return endsWithItem; 07877 else if (containsItem) 07878 return containsItem; 07879 return 0; 07880 }
Here is the call graph for this function:

| void Q3ListView::setDefaultRenameAction | ( | RenameAction | a | ) | [virtual] |
Definition at line 7153 of file q3listview.cpp.
References d, and Q3ListViewPrivate::defRenameAction.
07154 { 07155 d->defRenameAction = a; 07156 }
| Q3ListView::RenameAction Q3ListView::defaultRenameAction | ( | ) | const |
Definition at line 7158 of file q3listview.cpp.
References d, and Q3ListViewPrivate::defRenameAction.
07159 { 07160 return d->defRenameAction; 07161 }
| bool Q3ListView::isRenaming | ( | ) | const |
Returns true if an item is being renamed; otherwise returns false.
Definition at line 7167 of file q3listview.cpp.
References currentItem(), and Q3ListViewItem::renameBox.
Referenced by changeSortColumn(), and handleIndexChange().
07168 { 07169 return currentItem() && currentItem()->renameBox; 07170 }
Here is the call graph for this function:

| void Q3ListView::hideColumn | ( | int | column | ) |
Hides the column specified at column. This is a convenience function that calls setColumnWidth(column, 0).
Note: The user may still be able to resize the hidden column using the header handles. To prevent this, call setResizeEnabled(false, column) on the list views header.
Definition at line 7893 of file q3listview.cpp.
References setColumnWidth().
07894 { 07895 setColumnWidth(column, 0); 07896 }
Here is the call graph for this function:

| void Q3ListView::clear | ( | ) | [virtual, slot] |
Removes and deletes all the items in this list view and triggers an update.
Definition at line 3115 of file q3listview.cpp.
References QList< T >::at(), QObject::blockSignals(), Q3ListViewPrivate::buttonDown, c, QList< T >::clear(), Q3ListViewPrivate::clearing, clearSelection(), Q3ScrollView::contentsHeight(), d, Q3ListViewPrivate::dirtyItems, Q3ListViewPrivate::dirtyItemTimer, Q3ListViewPrivate::drawables, Q3ListViewPrivate::focusItem, Q3ListViewPrivate::h, Q3ListViewPrivate::highlighted, i, Q3ListViewPrivate::iterators, j, n, Q3ListViewPrivate::pressedItem, Q3ListViewPrivate::r, Q3ScrollView::resizeContents(), Q3ListViewPrivate::selectAnchor, setContentsPos(), QWidget::setUpdatesEnabled(), QObject::signalsBlocked(), QList< T >::size(), Q3Header::sizeHint(), Q3ListViewPrivate::startDragItem, QTimer::stop(), triggerUpdate(), QWidget::updatesEnabled(), Q3ScrollView::viewport(), and QSize::width().
Referenced by Q3FileDialogQFileListView::clear(), and removeColumn().
03116 { 03117 bool wasUpdatesEnabled = viewport()->updatesEnabled(); 03118 if (!wasUpdatesEnabled) 03119 viewport()->setUpdatesEnabled(false); 03120 setContentsPos(0, 0); 03121 if (!wasUpdatesEnabled) 03122 viewport()->setUpdatesEnabled(true); 03123 bool block = signalsBlocked(); 03124 blockSignals(true); 03125 d->clearing = true; 03126 clearSelection(); 03127 for (int j = 0; j < d->iterators.size(); ++j) { 03128 Q3ListViewItemIterator *i = d->iterators.at(j); 03129 i->curr = 0; 03130 } 03131 03132 d->drawables.clear(); 03133 d->dirtyItems.clear(); 03134 d->dirtyItemTimer->stop(); 03135 03136 d->highlighted = 0; 03137 d->focusItem = 0; 03138 d->selectAnchor = 0; 03139 d->pressedItem = 0; 03140 d->startDragItem = 0; 03141 03142 // if it's down its downness makes no sense, so undown it 03143 d->buttonDown = false; 03144 03145 Q3ListViewItem *c = (Q3ListViewItem *)d->r->firstChild(); 03146 Q3ListViewItem *n; 03147 while(c) { 03148 n = (Q3ListViewItem *)c->nextSibling(); 03149 delete c; 03150 c = n; 03151 } 03152 resizeContents(d->h->sizeHint().width(), contentsHeight()); 03153 delete d->r; 03154 d->r = 0; 03155 Q3ListViewPrivate::Root * r = new Q3ListViewPrivate::Root(this); 03156 r->is_root = true; 03157 d->r = r; 03158 d->r->setSelectable(false); 03159 blockSignals(block); 03160 triggerUpdate(); 03161 d->clearing = false; 03162 }
| void Q3ListView::invertSelection | ( | ) | [virtual, slot] |
Inverts the selection. Only works in Multi and Extended selection modes.
Definition at line 5267 of file q3listview.cpp.
References b, QObject::blockSignals(), Q3ListViewItemIterator::current(), d, emit, Q3ListViewItem::isSelected(), NoSelection, selectionChanged(), Q3ListViewPrivate::selectionMode, Q3ListViewItem::setSelected(), QObject::signalsBlocked(), Single, and triggerUpdate().
05268 { 05269 if (d->selectionMode == Single || 05270 d->selectionMode == NoSelection) 05271 return; 05272 05273 bool b = signalsBlocked(); 05274 blockSignals(true); 05275 Q3ListViewItemIterator it(this); 05276 for (; it.current(); ++it) 05277 it.current()->setSelected(!it.current()->isSelected()); 05278 blockSignals(b); 05279 emit selectionChanged(); 05280 triggerUpdate(); 05281 }
| void Q3ListView::selectAll | ( | bool | select | ) | [virtual, slot] |
If select is true, all the items get selected; otherwise all the items get unselected. This only works in the selection modes Multi and Extended. In Single and NoSelection mode the selection of the current item is just set to select.
Definition at line 5236 of file q3listview.cpp.
References b, QObject::blockSignals(), Q3ListViewItemIterator::current(), d, emit, Extended, Q3ListViewPrivate::focusItem, i, Multi, selectionChanged(), Q3ListViewPrivate::selectionMode, setSelected(), QObject::signalsBlocked(), and triggerUpdate().
Referenced by clearSelection(), handleItemChange(), keyPressEvent(), and Q3FileDialog::selectAll().
05237 { 05238 if (d->selectionMode == Multi || d->selectionMode == Extended) { 05239 bool b = signalsBlocked(); 05240 blockSignals(true); 05241 bool anything = false; 05242 Q3ListViewItemIterator it(this); 05243 while (it.current()) { 05244 Q3ListViewItem *i = it.current(); 05245 if ((bool)i->selected != select) { 05246 i->setSelected(select); 05247 anything = true; 05248 } 05249 ++it; 05250 } 05251 blockSignals(b); 05252 if (anything) { 05253 emit selectionChanged(); 05254 triggerUpdate(); 05255 } 05256 } else if (d->focusItem) { 05257 Q3ListViewItem * i = d->focusItem; 05258 setSelected(i, select); 05259 } 05260 }
| void Q3ListView::triggerUpdate | ( | ) | [slot] |
Triggers a size, geometry and content update during the next iteration of the event loop. Ensures that there'll be just one update to avoid flicker.
Definition at line 3669 of file q3listview.cpp.
References d, QWidget::isVisible(), QTimer::start(), Q3ListViewPrivate::timer, and QWidget::updatesEnabled().
Referenced by clear(), contentsMousePressEventEx(), doAutoScroll(), handleIndexChange(), Q3ListViewPrivate::Root::invalidateHeight(), invertSelection(), Q3ListViewItem::moveItem(), selectAll(), selectRange(), setColumnAlignment(), Q3ListViewItem::setEnabled(), setItemMargin(), Q3ListViewItem::setPixmap(), setRootIsDecorated(), setSorting(), Q3ListViewItem::setText(), Q3ListViewItem::setVisible(), Q3ListViewItem::sort(), and Q3ListViewItem::takeItem().
03670 { 03671 if (!isVisible() || !updatesEnabled()) { 03672 // Not in response to a setText/setPixmap any more. 03673 return; // it will update when shown, or something. 03674 } 03675 03676 d->timer->start(0, true); 03677 }
| void Q3ListView::setContentsPos | ( | int | x, | |
| int | y | |||
| ) | [virtual, slot] |
Reimplemented from Q3ScrollView.
Definition at line 3168 of file q3listview.cpp.
References Q3ScrollView::setContentsPos(), and updateGeometries().
Referenced by clear(), and ensureItemVisible().
03169 { 03170 updateGeometries(); 03171 Q3ScrollView::setContentsPos(x, y); 03172 }
| void Q3ListView::adjustColumn | ( | int | col | ) | [slot] |
Adjusts the column col to its preferred width
Definition at line 7900 of file q3listview.cpp.
References Q3Header::adjustHeaderSize(), Q3ListViewPrivate::column, d, Q3ListViewItem::depth(), emit, firstChild(), QWidget::fontMetrics(), Q3ListViewPrivate::fullRepaintOnComlumnChange, QApplication::globalStrut(), Q3ListViewPrivate::h, Q3Header::iconSet(), Q3Header::isStretchEnabled(), Q3ListViewItem::itemBelow(), itemMargin(), QIcon::pixmap(), qMax(), Q3Header::resizeSection(), rootIsDecorated(), Q3Header::sectionSize(), Q3Header::sectionSizeHint(), Q3Header::sizeChange(), treeStepSize(), QPixmap::width(), Q3ListViewItem::width(), QSize::width(), and QWidget::width().
Referenced by init().
07901 { 07902 if (col < 0 || col > (int)d->column.count() - 1 || d->h->isStretchEnabled(col)) 07903 return; 07904 07905 int oldw = d->h->sectionSize(col); 07906 07907 int w = d->h->sectionSizeHint(col, fontMetrics()).width(); 07908 if (d->h->iconSet(col)) 07909 w += d->h->iconSet(col)->pixmap().width(); 07910 w = qMax(w, 20); 07911 QFontMetrics fm(fontMetrics()); 07912 Q3ListViewItem* item = firstChild(); 07913 int rootDepth = rootIsDecorated() ? treeStepSize() : 0; 07914 while (item) { 07915 int iw = item->width(fm, this, col); 07916 if (0 == col) 07917 iw += itemMargin() + rootDepth + item->depth()*treeStepSize() - 1; 07918 w = qMax(w, iw); 07919 item = item->itemBelow(); 07920 } 07921 w = qMax(w, QApplication::globalStrut().width()); 07922 07923 d->h->adjustHeaderSize(oldw - w); 07924 if (oldw != w) { 07925 d->fullRepaintOnComlumnChange = true; 07926 d->h->resizeSection(col, w); 07927 emit d->h->sizeChange(col, oldw, w); 07928 } 07929 }
| void Q3ListView::selectionChanged | ( | ) | [signal] |
This signal is emitted whenever the set of selected items has changed (normally before the screen update). It is available both in Single selection and Multi selection mode but is most useful in Multi selection mode.
Referenced by contentsMousePressEventEx(), contentsMouseReleaseEventEx(), doAutoScroll(), invertSelection(), selectAll(), selectRange(), setCurrentItem(), setSelected(), and Q3ListViewItem::takeItem().
| void Q3ListView::selectionChanged | ( | Q3ListViewItem * | item | ) | [signal] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This signal is emitted whenever the selected item has changed in Single selection mode (normally after the screen update). The argument is the newly selected item.
In Multi selection mode, use the no argument overload of this signal.
| void Q3ListView::currentChanged | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted whenever the current item has changed (normally after the screen update). The current item is the item responsible for indicating keyboard focus.
The argument is the newly current item, or 0 if the change made no item current. This can happen, for example, if all the items in the list view are deleted.
Referenced by contentsMousePressEventEx(), contentsMouseReleaseEventEx(), focusInEvent(), setCurrentItem(), setSelected(), and Q3ListViewItem::takeItem().
| void Q3ListView::clicked | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted whenever the user clicks (mouse pressed and mouse released) in the list view. item is the clicked list view item, or 0 if the user didn't click on an item.
Referenced by contentsMouseReleaseEventEx().
| void Q3ListView::clicked | ( | Q3ListViewItem * | item, | |
| const QPoint & | pnt, | |||
| int | c | |||
| ) | [signal] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This signal is emitted whenever the user clicks (mouse pressed and mouse released) in the list view. item is the clicked list view item, or 0 if the user didn't click on an item. pnt is the position where the user has clicked in global coordinates. If item is not 0, c is the list view column into which the user pressed; if item is 0 {c}'s value is undefined.
| void Q3ListView::pressed | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted whenever the user presses the mouse button in a list view. item is the list view item on which the user pressed the mouse button, or 0 if the user didn't press the mouse on an item.
Referenced by contentsMousePressEventEx().
| void Q3ListView::pressed | ( | Q3ListViewItem * | item, | |
| const QPoint & | pnt, | |||
| int | c | |||
| ) | [signal] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This signal is emitted whenever the user presses the mouse button in a list view. item is the list view item on which the user pressed the mouse button, or 0 if the user didn't press the mouse on an item. pnt is the position of the mouse cursor in global coordinates, and c is the column where the mouse cursor was when the user pressed the mouse button.
| void Q3ListView::doubleClicked | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted whenever an item is double-clicked. It's emitted on the second button press, not the second button release. item is the list view item on which the user did the double-click.
Referenced by contentsMouseDoubleClickEvent().
| void Q3ListView::doubleClicked | ( | Q3ListViewItem * | item, | |
| const QPoint & | point, | |||
| int | column | |||
| ) | [signal] |
This signal is emitted when a double-click occurs. It's emitted on the second button press, not the second button release. The item is the Q3ListViewItem the button was double-clicked on (which could be 0 if it wasn't double-clicked on an item). The point where the double-click occurred is given in global coordinates. If an item was double-clicked on, column is the column within the item that was double-clicked; otherwise column is -1.
| void Q3ListView::returnPressed | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted when Enter or Return is pressed. The item parameter is the currentItem().
Referenced by keyPressEvent().
| void Q3ListView::spacePressed | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted when Space is pressed. The item parameter is the currentItem().
Referenced by keyPressEvent().
| void Q3ListView::rightButtonClicked | ( | Q3ListViewItem * | item, | |
| const QPoint & | point, | |||
| int | column | |||
| ) | [signal] |
This signal is emitted when the right button is clicked. The item is the Q3ListViewItem the button was clicked on (which could be 0 if it wasn't clicked on an item). The point where the click occurred is given in global coordinates. If an item was clicked on, column is the column within the item that was clicked; otherwise column is -1.
Referenced by contentsMouseReleaseEventEx().
| void Q3ListView::rightButtonPressed | ( | Q3ListViewItem * | item, | |
| const QPoint & | point, | |||
| int | column | |||
| ) | [signal] |
This signal is emitted when the right button is pressed. The item is the Q3ListViewItem the button was pressed on (which could be 0 if it wasn't pressed on an item). The point where the press occurred is given in global coordinates. If an item was pressed on, column is the column within the item that was pressed; otherwise column is -1.
Referenced by contentsMousePressEventEx().
| void Q3ListView::mouseButtonPressed | ( | int | button, | |
| Q3ListViewItem * | item, | |||
| const QPoint & | pos, | |||
| int | c | |||
| ) | [signal] |
This signal is emitted whenever the user pressed the mouse button in the list view at position pos. button is the mouse button which the user pressed, item is the pressed list view item or 0 if the user didn't press on an item. If item is not 0, c is the list view column into which the user pressed; if item is 0 {c}'s value is undefined.
Referenced by contentsMousePressEventEx().
| void Q3ListView::mouseButtonClicked | ( | int | button, | |
| Q3ListViewItem * | item, | |||
| const QPoint & | pos, | |||
| int | c | |||
| ) | [signal] |
This signal is emitted whenever the user clicks (mouse pressed and mouse released) in the list view at position pos. button is the mouse button that the user pressed, item is the clicked list view item or 0 if the user didn't click on an item. If item is not 0, c is the list view column into which the user pressed; if item is 0 {c}'s value is undefined.
Referenced by contentsMouseReleaseEventEx().
| void Q3ListView::contextMenuRequested | ( | Q3ListViewItem * | item, | |
| const QPoint & | pos, | |||
| int | col | |||
| ) | [signal] |
This signal is emitted when the user invokes a context menu with the right mouse button or with special system keys. If the keyboard was used item is the current item; if the mouse was used, item is the item under the mouse pointer or 0 if there is no item under the mouse pointer. If no item is clicked, the column index emitted is -1.
pos is the position for the context menu in the global coordinate system.
col is the column on which the user pressed, or -1 if the signal was triggered by a key event.
Referenced by contentsContextMenuEvent().
| void Q3ListView::onItem | ( | Q3ListViewItem * | i | ) | [signal] |
This signal is emitted when the user moves the mouse cursor onto item i, similar to the QWidget::enterEvent() function.
Referenced by contentsMouseMoveEvent().
| void Q3ListView::onViewport | ( | ) | [signal] |
This signal is emitted when the user moves the mouse cursor from an item to an empty part of the list view.
Referenced by contentsMouseMoveEvent().
| void Q3ListView::expanded | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted when item has been expanded, i.e. when the children of item are shown.
Referenced by Q3ListViewItem::setOpen().
| void Q3ListView::collapsed | ( | Q3ListViewItem * | item | ) | [signal] |
This signal is emitted when the item has been collapsed, i.e. when the children of item are hidden.
Referenced by Q3ListViewItem::setOpen().
| void Q3ListView::dropped | ( | QDropEvent * | e | ) | [signal] |
This signal is emitted, when a drop event occurred on the viewport (not onto an item).
e provides all the information about the drop.
Referenced by contentsDropEvent().
| void Q3ListView::itemRenamed | ( | Q3ListViewItem * | item, | |
| int | col, | |||
| const QString & | text | |||
| ) | [signal] |
This signal is emitted when item has been renamed to text, e.g. by in in-place renaming, in column col.
Referenced by Q3ListViewItem::okRename().
| void Q3ListView::itemRenamed | ( | Q3ListViewItem * | item, | |
| int | col | |||
| ) | [signal] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This signal is emitted when item has been renamed, e.g. by in-place renaming, in column col.
| void Q3ListView::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Processes the mouse press event e on behalf of the viewed widget.
Reimplemented from Q3ScrollView.
Definition at line 4142 of file q3listview.cpp.
References contentsMousePressEventEx().
04143 { 04144 contentsMousePressEventEx(e); 04145 }
Here is the call graph for this function:

| void Q3ListView::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Processes the mouse release event e on behalf of the viewed widget.
Reimplemented from Q3ScrollView.
Definition at line 4366 of file q3listview.cpp.
References contentsMouseReleaseEventEx().
04367 { 04368 contentsMouseReleaseEventEx(e); 04369 }
Here is the call graph for this function:

| void Q3ListView::contentsMouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Processes the mouse move event e on behalf of the viewed widget.
Reimplemented from Q3ScrollView.
Definition at line 4538 of file q3listview.cpp.
References Q3ListViewPrivate::buttonDown, QObject::connect(), Q3ScrollView::contentsToViewport(), d, QObject::disconnect(), doAutoScroll(), Q3ListViewItem::dragEnabled(), Q3ListViewPrivate::dragStartPos, emit, Q3ListViewPrivate::highlighted, i, Q3ListViewItem::isSelected(), itemAt(), Qt::LeftButton, Qt::MidButton, NoSelection, onItem(), onViewport(), QMouseEvent::pos(), Q3ListViewPrivate::pressedItem, Qt::RightButton, Q3ListViewPrivate::scrollTimer, Q3ListViewPrivate::selectionMode, setSelected(), SIGNAL, SLOT, QTimer::start(), startDrag(), QApplication::startDragDistance(), Q3ListViewPrivate::startDragItem, QTimer::stop(), Q3ScrollView::visibleHeight(), and QPoint::y().
04539 { 04540 if (!e) 04541 return; 04542 04543 bool needAutoScroll = false; 04544 04545 QPoint vp = contentsToViewport(e->pos()); 04546 04547 Q3ListViewItem * i = itemAt(vp); 04548 if (i && !i->isEnabled()) 04549 return; 04550 if (i != d->highlighted && 04551 !(d->pressedItem && 04552 (d->pressedItem->isSelected() || d->selectionMode == NoSelection) && 04553 d->pressedItem->dragEnabled())) { 04554 04555 if (i) { 04556 emit onItem(i); 04557 } else { 04558 emit onViewport(); 04559 } 04560 d->highlighted = i; 04561 } 04562 04563 if (d->startDragItem) 04564 i = d->startDragItem; 04565 04566 if (!d->buttonDown || 04567 ((e->state() & Qt::LeftButton) != Qt::LeftButton && 04568 (e->state() & Qt::MidButton) != Qt::MidButton && 04569 (e->state() & Qt::RightButton) != Qt::RightButton)) 04570 return; 04571 04572 if (d->pressedItem && 04573 (d->pressedItem->isSelected() || d->selectionMode == NoSelection) && 04574 d->pressedItem->dragEnabled()) { 04575 04576 if (!d->startDragItem) { 04577 setSelected(d->pressedItem, true); 04578 d->startDragItem = d->pressedItem; 04579 } 04580 if ((d->dragStartPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { 04581 d->buttonDown = false; 04582 #ifndef QT_NO_DRAGANDDROP 04583 startDrag(); 04584 #endif 04585 } 04586 return; 04587 } 04588 04589 // check, if we need to scroll 04590 if (vp.y() > visibleHeight() || vp.y() < 0) 04591 needAutoScroll = true; 04592 04593 // if we need to scroll and no autoscroll timer is started, 04594 // connect the timer