Eneboo - Documentación para desarrolladores
|
The QIconView class provides an area with movable labelled icons. Más...
#include <qiconview.h>
The QIconView class provides an area with movable labelled icons.
iconview
A QIconView can display and manage a grid or other 2D layout of labelled icons. Each labelled icon is a QIconViewItem. Items (QIconViewItems) can be added or deleted at any time; items can be moved within the QIconView. Single or multiple items can be selected. Items can be renamed in-place. QIconView also supports drag and drop.
Each item contains a label string, a pixmap or picture (the icon itself) and optionally a sort key. The sort key is used for sorting the items and defaults to the label string. The label string can be displayed below or to the right of the icon (see ItemTextPos).
The simplest way to create a QIconView is to create a QIconView object and create some QIconViewItems with the QIconView as their parent, set the icon view's geometry and show it. For example:
QIconView *iv = new QIconView( this ); QDir dir( path, "*.xpm" ); for ( uint i = 0; i < dir.count(); i++ ) { (void) new QIconViewItem( iv, dir[i], QPixmap( path + dir[i] ) ); } iv->resize( 600, 400 ); iv->show();
The QIconViewItem call passes a pointer to the QIconView we wish to populate, along with the label text and a QPixmap.
When an item is inserted the QIconView allocates a position for it. Existing items are rearranged if autoArrange() is TRUE. The default arrangement is LeftToRight
-- the QIconView fills up the left-most column from top to bottom, then moves one column right and fills that from top to bottom and so on. The arrangement can be modified with any of the following approaches: Call setArrangement(), e.g. with TopToBottom
which will fill the top-most row from left to right, then moves one row down and fills that row from left to right and so on. Construct each QIconViewItem using a constructor which allows you to specify which item the new one is to follow. Call setSorting() or sort() to sort the items.
The spacing between items is set with setSpacing(). Items can be laid out using a fixed grid using setGridX() and setGridY(); by default the QIconView calculates a grid dynamically. The position of items' label text is set with setItemTextPos(). The text's background can be set with setItemTextBackground(). The maximum width of an item and of its text are set with setMaxItemWidth() and setMaxItemTextLength(). The label text will be word-wrapped if it is too long; this is controlled by setWordWrapIconText(). If the label text is truncated, the user can still see the entire text in a tool tip if they hover the mouse over the item. This is controlled with setShowToolTips().
Items which are selectable may be selected depending on the SelectionMode; the default is Single
. Because QIconView offers multiple selection it must display keyboard focus and selection state separately. Therefore there are functions to set the selection state of an item (setSelected()) and to select which item displays keyboard focus (setCurrentItem()). When multiple items may be selected the icon view provides a rubberband, too.
When in-place renaming is enabled (it is disabled by default), the user may change the item's label. They do this by selecting the item (single clicking it or navigating to it with the arrow keys), then single clicking it (or pressing F2), and entering their text. If no key has been set with QIconViewItem::setKey() the new text will also serve as the key. (See QIconViewItem::setRenameEnabled().)
You can control whether users can move items themselves with setItemsMovable().
Because the internal structure used to store the icon view items is linear, no iterator class is needed to iterate over all the items. Instead we iterate by getting the first item from the {icon view} and then each subsequent ( QIconViewItem::nextItem()) from each item in turn:
for ( QIconViewItem *item = iv->firstItem(); item; item = item->nextItem() ) do_something( item );
QIconView also provides currentItem(). You can search for an item using findItem() (searching by position or for label text) and with findFirstVisibleItem() and findLastVisibleItem(). The number of items is returned by count(). An item can be removed from an icon view using takeItem(); to delete an item use delete
. All the items can be deleted with clear().
The QIconView emits a wide range of useful signals, including selectionChanged(), currentChanged(), clicked(), moved() and itemRenamed().
draganddrop
This enum type determines in which direction the items flow when the view runs out of space.
LeftToRight Items which don't fit into the view cause the viewport to extend vertically (you get a vertical scrollbar).
TopToBottom Items which don't fit into the view cause the viewport to extend horizontally (you get a horizontal scrollbar).
This enumerated type is used by QIconView to indicate how it reacts to selection by the user. It has four values:
Single When the user selects an item, any already-selected item becomes unselected and the user cannot unselect the selected item. This means that the user can never clear the selection. (The application programmer can, using QIconView::clearSelection().)
Multi When the user selects an item, e.g. by navigating to it with the keyboard arrow keys or by clicking it, the selection status of that item is toggled and the other items are left alone. Also, multiple items can be selected by dragging the mouse while the left mouse button stays pressed.
Extended When the user selects an item 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. 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 while the left mouse button stays pressed.
NoSelection Items cannot be selected.
To summarise: Single
is a real single-selection icon view; Multi
a real multi-selection icon view; Extended
is an icon view in which users can select multiple items but usually want to select either just one or a range of contiguous items; and NoSelection
mode is for an icon view where the user can look but not touch.
Constructs an empty icon view called name, with parent parent and using the widget flags f.
QIconView::~QIconView | ( | ) | [virtual] |
Destroys the icon view and deletes all items.
virtual QIconView::~QIconView | ( | ) | [virtual] |
void QIconView::adjustItems | ( | ) | [protected, virtual, slot] |
Adjusts the positions of the items to the geometry of the icon view.
virtual void QIconView::adjustItems | ( | ) | [protected, virtual, slot] |
This variant uses grid instead of (gridX(), gridY()). If grid is invalid (see QSize::isValid()), arrangeItemsInGrid() calculates a valid grid itself and uses that.
If update is TRUE (the default) the viewport is repainted.
virtual void QIconView::arrangeItemsInGrid | ( | const QSize & | grid, |
bool | update = TRUE |
||
) | [virtual, slot] |
virtual void QIconView::arrangeItemsInGrid | ( | bool | update = TRUE | ) | [virtual, slot] |
void QIconView::arrangeItemsInGrid | ( | bool | update = TRUE | ) | [virtual, slot] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Arranges all the items in the grid given by gridX() and gridY().
Even if sorting() is enabled, the items are not sorted by this function. If you want to sort or rearrange the items, use iconview->sort(iconview->sortDirection()).
If update is TRUE (the default), the viewport is repainted as well.
Arrangement QIconView::arrangement | ( | ) | const |
Arrangement QIconView::arrangement | ( | ) | const |
bool QIconView::autoArrange | ( | ) | const |
bool QIconView::autoArrange | ( | ) | const |
virtual void QIconView::clear | ( | ) | [virtual] |
void QIconView::clear | ( | void | ) | [virtual] |
Clears the icon view. All items are deleted.
void QIconView::clearSelection | ( | ) | [virtual] |
Unselects all the items.
virtual void QIconView::clearSelection | ( | ) | [virtual] |
void QIconView::clicked | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted when the user clicks any mouse button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
void QIconView::clicked | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This signal is emitted when the user clicks any mouse button on an icon view item. item is a pointer to the item that has been clicked.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differ by a pixel or two, pos is the position at release time.)
void QIconView::clicked | ( | QIconViewItem * | ) | [signal] |
void QIconView::clicked | ( | QIconViewItem * | , |
const QPoint & | |||
) | [signal] |
void QIconView::contentsContextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsContextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a contextMenuEvent() in {e}: the mouse position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsDragEnterEvent | ( | QDragEnterEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsDragEnterEvent | ( | QDragEnterEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragEnterEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsDragLeaveEvent | ( | QDragLeaveEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsDragLeaveEvent | ( | QDragLeaveEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragLeaveEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsDragMoveEvent | ( | QDragMoveEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsDragMoveEvent | ( | QDragMoveEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragMoveEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsDropEvent | ( | QDropEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsDropEvent | ( | QDropEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dropEvent(): the drop position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsMouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsMouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseDoubleClickEvent(): the click position in e is translated to be a point on the contents.
The default implementation generates a normal mouse press event.
Reimplementado de QScrollView.
void QIconView::contentsMouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsMouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseMoveEvent(): the mouse position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mousePressEvent(): the press position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseReleaseEvent(): the release position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QIconView::contextMenuRequested | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
This signal is emitted when the user invokes a context menu with the right mouse button or with special system keys, with item being the item under the mouse cursor or the current item, respectively.
pos is the position for the context menu in the global coordinate system.
void QIconView::contextMenuRequested | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
uint QIconView::count | ( | ) | const |
uint QIconView::count | ( | ) | const |
void QIconView::currentChanged | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted when a new item becomes current. item is the new current item (or 0 if no item is now current).
void QIconView::currentChanged | ( | QIconViewItem * | item | ) | [signal] |
QIconViewItem * QIconView::currentItem | ( | ) | const |
Returns a pointer to the current item of the icon view, or 0 if no item is current.
QIconViewItem* QIconView::currentItem | ( | ) | const |
void QIconView::doAutoScroll | ( | ) | [protected, virtual, slot] |
Performs autoscrolling when selecting multiple icons with the rubber band.
virtual void QIconView::doAutoScroll | ( | ) | [protected, virtual, slot] |
void QIconView::doubleClicked | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted when the user double-clicks on item.
void QIconView::doubleClicked | ( | QIconViewItem * | item | ) | [signal] |
QDragObject * QIconView::dragObject | ( | ) | [protected, virtual] |
Returns the QDragObject that should be used for drag-and-drop. This function is called by the icon view when starting a drag to get the dragobject that should be used for the drag. Subclasses may reimplement this.
virtual QDragObject* QIconView::dragObject | ( | ) | [protected, virtual] |
This function is called to draw the rectangle r of the background using the painter p.
The default implementation fills r with the viewport's backgroundBrush(). Subclasses may reimplement this to draw custom backgrounds.
Reimplementado de QScrollView.
void QIconView::drawContents | ( | QPainter * | p, |
int | clipx, | ||
int | clipy, | ||
int | clipw, | ||
int | cliph | ||
) | [protected, virtual] |
Reimplement this function if you are viewing a drawing area rather than a widget.
The function should draw the rectangle (clipx, clipy, clipw, cliph) of the contents using painter p. The clip rectangle is in the scrollview's coordinates.
For example:
{ // Fill a 40000 by 50000 rectangle at (100000,150000) // Calculate the coordinates... int x1 = 100000, y1 = 150000; int x2 = x1+40000-1, y2 = y1+50000-1; // Clip the coordinates so X/Windows will not have problems... if (x1 < clipx) x1=clipx; if (y1 < clipy) y1=clipy; if (x2 > clipx+clipw-1) x2=clipx+clipw-1; if (y2 > clipy+cliph-1) y2=clipy+cliph-1; // Paint using the small coordinates... if ( x2 >= x1 && y2 >= y1 ) p->fillRect(x1, y1, x2-x1+1, y2-y1+1, red); }
The clip rectangle and translation of the painter p is already set appropriately.
Reimplementado de QScrollView.
void QIconView::drawRubber | ( | QPainter * | p | ) | [protected, virtual] |
Draws the rubber band using the painter p.
virtual void QIconView::drawRubber | ( | QPainter * | p | ) | [protected, virtual] |
void QIconView::dropped | ( | QDropEvent * | e, |
const QValueList< QIconDragItem > & | lst | ||
) | [signal] |
This signal is emitted when a drop event occurs in the viewport (but not on any icon) which the icon view itself can't handle.
e provides all the information about the drop. If the drag object of the drop was a QIconDrag, lst contains the list of the dropped items. You can get the data using QIconDragItem::data() on each item. If the lst is empty, i.e. the drag was not a QIconDrag, you have to decode the data in e and work with that.
Note QIconViewItems may be drop targets; if a drop event occurs on an item the item handles the drop.
void QIconView::dropped | ( | QDropEvent * | e, |
const QValueList< QIconDragItem > & | lst | ||
) | [signal] |
void QIconView::emitRenamed | ( | QIconViewItem * | item | ) | [protected] |
void QIconView::emitRenamed | ( | QIconViewItem * | item | ) | [protected] |
void QIconView::emitSelectionChanged | ( | QIconViewItem * | i = 0 | ) | [protected] |
void QIconView::emitSelectionChanged | ( | QIconViewItem * | i = 0 | ) | [protected] |
Emits a signal to indicate selection changes. i is the QIconViewItem that was selected or de-selected.
{You should never need to call this function.}
void QIconView::ensureItemVisible | ( | QIconViewItem * | item | ) |
void QIconView::ensureItemVisible | ( | QIconViewItem * | item | ) |
Makes sure that item is entirely visible. If necessary, ensureItemVisible() scrolls the icon view.
void QIconView::enterEvent | ( | QEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive widget enter events.
An event is sent to the widget when the mouse cursor enters the widget.
Reimplementado de QWidget.
This event filter ensures the scroll bars are updated when a single contents widget is resized, shown, hidden or destroyed; it passes mouse events to the QScrollView. The event is in e and the object is in obj.
Reimplementado de QScrollView.
Reimplementado de QScrollView.
QIconViewItem* QIconView::findFirstVisibleItem | ( | const QRect & | r | ) | const |
QIconViewItem * QIconView::findFirstVisibleItem | ( | const QRect & | r | ) | const |
Finds the first item whose bounding rectangle overlaps r and returns a pointer to that item. r is given in content coordinates. Returns 0 if no item overlaps r.
If you want to find all items that touch r, you will need to use this function and nextItem() in a loop ending at findLastVisibleItem() and test QIconViewItem::rect() for each of these items.
QIconViewItem * QIconView::findItem | ( | const QPoint & | pos | ) | const |
Returns a pointer to the item that contains point pos, which is given in contents coordinates, or 0 if no item contains point pos.
QIconViewItem * QIconView::findItem | ( | const QString & | text, |
ComparisonFlags | compare = BeginsWith |
||
) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns a pointer to the first item whose text begins with text, or 0 if no such item could be found. Use the compare flag to control the comparison behaviour. (See {Qt::StringComparisonMode}.)
QIconViewItem* QIconView::findItem | ( | const QString & | text, |
ComparisonFlags | compare = BeginsWith |
||
) | const |
QIconViewItem* QIconView::findItem | ( | const QPoint & | pos | ) | const |
QIconViewItem* QIconView::findLastVisibleItem | ( | const QRect & | r | ) | const |
QIconViewItem * QIconView::findLastVisibleItem | ( | const QRect & | r | ) | const |
Finds the last item whose bounding rectangle overlaps r and returns a pointer to that item. r is given in content coordinates. Returns 0 if no item overlaps r.
QIconViewItem * QIconView::firstItem | ( | ) | const |
Returns a pointer to the first item of the icon view, or 0 if there are no items in the icon view.
QIconViewItem* QIconView::firstItem | ( | ) | const |
void QIconView::focusInEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
Reimplementado de QWidget.
void QIconView::focusInEvent | ( | QFocusEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget.
A widget normally must setFocusPolicy() to something other than NoFocus
in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)
The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.
Reimplementado de QWidget.
void QIconView::focusOutEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
Reimplementado de QWidget.
void QIconView::focusOutEvent | ( | QFocusEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget.
A widget normally must setFocusPolicy() to something other than NoFocus
in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)
The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.
Reimplementado de QWidget.
int QIconView::gridX | ( | ) | const |
int QIconView::gridX | ( | ) | const |
int QIconView::gridY | ( | ) | const |
int QIconView::gridY | ( | ) | const |
int QIconView::index | ( | const QIconViewItem * | item | ) | const |
Returns the index of item, or -1 if item doesn't exist in this icon view.
int QIconView::index | ( | const QIconViewItem * | item | ) | const |
void QIconView::insertInGrid | ( | QIconViewItem * | item | ) | [protected, virtual] |
Inserts the QIconViewItem item in the icon view's grid. {You should never need to call this function.} Instead, insert QIconViewItems by creating them with a pointer to the QIconView that they are to be inserted into.
virtual void QIconView::insertInGrid | ( | QIconViewItem * | item | ) | [protected, virtual] |
void QIconView::insertItem | ( | QIconViewItem * | item, |
QIconViewItem * | after = 0L |
||
) | [virtual] |
Inserts the icon view item item after after. If after is 0, item is appended after the last item.
{You should never need to call this function.} Instead create QIconViewItem's and associate them with your icon view like this:
(void) new QIconViewItem( myIconview, "The text of the item", aPixmap );
virtual void QIconView::insertItem | ( | QIconViewItem * | item, |
QIconViewItem * | after = 0L |
||
) | [virtual] |
virtual void QIconView::invertSelection | ( | ) | [virtual] |
void QIconView::invertSelection | ( | ) | [virtual] |
Inverts the selection. Works only in Multi and Extended selection mode.
bool QIconView::isRenaming | ( | ) | const |
bool QIconView::isRenaming | ( | ) | const |
Returns TRUE if an iconview item is being renamed; otherwise returns FALSE.
void QIconView::itemRenamed | ( | QIconViewItem * | item, |
const QString & | name | ||
) | [signal] |
This signal is emitted when item has been renamed to name, usually by in-place renaming.
void QIconView::itemRenamed | ( | QIconViewItem * | item | ) | [signal] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This signal is emitted when item has been renamed, usually by in-place renaming.
void QIconView::itemRenamed | ( | QIconViewItem * | item | ) | [signal] |
void QIconView::itemRenamed | ( | QIconViewItem * | item, |
const QString & | |||
) | [signal] |
bool QIconView::itemsMovable | ( | ) | const |
bool QIconView::itemsMovable | ( | ) | const |
QBrush QIconView::itemTextBackground | ( | ) | const |
QBrush QIconView::itemTextBackground | ( | ) | const |
ItemTextPos QIconView::itemTextPos | ( | ) | const |
ItemTextPos QIconView::itemTextPos | ( | ) | const |
void QIconView::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.
A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.
If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.
The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.
Reimplementado de QWidget.
QIconViewItem * QIconView::lastItem | ( | ) | const |
Returns a pointer to the last item of the icon view, or 0 if there are no items in the icon view.
QIconViewItem* QIconView::lastItem | ( | ) | const |
QIconViewItem* QIconView::makeRowLayout | ( | QIconViewItem * | begin, |
int & | y, | ||
bool & | changed | ||
) | [protected] |
QIconViewItem * QIconView::makeRowLayout | ( | QIconViewItem * | begin, |
int & | y, | ||
bool & | changed | ||
) | [protected] |
Lays out a row of icons (if Arrangement == TopToBottom
this is a column). Starts laying out with the item begin. y is the starting coordinate. Returns the last item of the row (column) and sets the new starting coordinate to y. The changed parameter is used internally.
int QIconView::maxItemTextLength | ( | ) | const |
int QIconView::maxItemTextLength | ( | ) | const |
int QIconView::maxItemWidth | ( | ) | const |
int QIconView::maxItemWidth | ( | ) | const |
QSize QIconView::minimumSizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
QSize QIconView::minimumSizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
void QIconView::mouseButtonClicked | ( | int | button, |
QIconViewItem * | item, | ||
const QPoint & | pos | ||
) | [signal] |
This signal is emitted when the user clicks mouse button button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differ by a pixel or two, pos is the position at release time.)
void QIconView::mouseButtonClicked | ( | int | button, |
QIconViewItem * | item, | ||
const QPoint & | pos | ||
) | [signal] |
void QIconView::mouseButtonPressed | ( | int | button, |
QIconViewItem * | item, | ||
const QPoint & | pos | ||
) | [signal] |
This signal is emitted when the user presses mouse button button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()).
void QIconView::mouseButtonPressed | ( | int | button, |
QIconViewItem * | item, | ||
const QPoint & | pos | ||
) | [signal] |
void QIconView::moved | ( | ) | [signal] |
This signal is emitted after successfully dropping one (or more) items of the icon view. If the items should be removed, it's best to do so in a slot connected to this signal.
void QIconView::moved | ( | ) | [signal] |
void QIconView::onItem | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted when the user moves the mouse cursor onto an item, similar to the QWidget::enterEvent() function.
void QIconView::onItem | ( | QIconViewItem * | item | ) | [signal] |
void QIconView::onViewport | ( | ) | [signal] |
This signal is emitted when the user moves the mouse cursor from an item to an empty part of the icon view.
void QIconView::onViewport | ( | ) | [signal] |
void QIconView::pressed | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted when the user presses any mouse button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
void QIconView::pressed | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This signal is emitted when the user presses any mouse button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differ by a pixel or two, pos is the position at release time.)
void QIconView::pressed | ( | QIconViewItem * | , |
const QPoint & | |||
) | [signal] |
void QIconView::pressed | ( | QIconViewItem * | ) | [signal] |
virtual void QIconView::repaintItem | ( | QIconViewItem * | item | ) | [virtual] |
void QIconView::repaintItem | ( | QIconViewItem * | item | ) | [virtual] |
Repaints the item.
void QIconView::repaintSelectedItems | ( | ) |
void QIconView::repaintSelectedItems | ( | ) |
Repaints the selected items.
void QIconView::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::resizeEvent | ( | QResizeEvent * | event | ) | [protected, virtual] |
Reimplementado de QScrollView.
ResizeMode QIconView::resizeMode | ( | ) | const |
ResizeMode QIconView::resizeMode | ( | ) | const |
void QIconView::returnPressed | ( | QIconViewItem * | item | ) | [signal] |
This signal is emitted if the user presses the Return or Enter key. item is the currentItem() at the time of the keypress.
void QIconView::returnPressed | ( | QIconViewItem * | item | ) | [signal] |
void QIconView::rightButtonClicked | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
This signal is emitted when the user clicks the right mouse button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differ by a pixel or two, pos is the position at release time.)
void QIconView::rightButtonClicked | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
void QIconView::rightButtonPressed | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
void QIconView::rightButtonPressed | ( | QIconViewItem * | item, |
const QPoint & | pos | ||
) | [signal] |
This signal is emitted when the user presses the right mouse button. If item is non-null, the cursor is on item. If item is null, the mouse cursor isn't on any item.
pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()).
void QIconView::selectAll | ( | bool | select | ) | [virtual] |
In Multi and Extended modes, this function sets all items to be selected if select is TRUE, and to be unselected if select is FALSE.
In Single and NoSelection modes, this function only changes the selection status of currentItem().
virtual void QIconView::selectAll | ( | bool | select | ) | [virtual] |
void QIconView::selectionChanged | ( | ) | [signal] |
This signal is emitted when the selection has been changed. It's emitted in each selection mode.
void QIconView::selectionChanged | ( | QIconViewItem * | item | ) | [signal] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This signal is emitted when the selection changes. item is the newly selected item. This signal is emitted only in single selection mode.
void QIconView::selectionChanged | ( | ) | [signal] |
void QIconView::selectionChanged | ( | QIconViewItem * | item | ) | [signal] |
SelectionMode QIconView::selectionMode | ( | ) | const |
SelectionMode QIconView::selectionMode | ( | ) | const |
void QIconView::setArrangement | ( | Arrangement | am | ) | [virtual] |
virtual void QIconView::setArrangement | ( | Arrangement | am | ) | [virtual] |
virtual void QIconView::setAutoArrange | ( | bool | b | ) | [virtual] |
void QIconView::setAutoArrange | ( | bool | b | ) | [virtual] |
Scrolls the content so that the point (x, y) is in the top-left corner.
Reimplementado de QScrollView.
Reimplementado de QScrollView.
void QIconView::setCurrentItem | ( | QIconViewItem * | item | ) | [virtual] |
Makes item the new current item of the icon view.
virtual void QIconView::setCurrentItem | ( | QIconViewItem * | item | ) | [virtual] |
virtual void QIconView::setGridX | ( | int | rx | ) | [virtual] |
void QIconView::setGridX | ( | int | rx | ) | [virtual] |
void QIconView::setGridY | ( | int | ry | ) | [virtual] |
virtual void QIconView::setGridY | ( | int | ry | ) | [virtual] |
virtual void QIconView::setItemsMovable | ( | bool | b | ) | [virtual] |
void QIconView::setItemsMovable | ( | bool | b | ) | [virtual] |
void QIconView::setItemTextBackground | ( | const QBrush & | b | ) | [virtual] |
virtual void QIconView::setItemTextBackground | ( | const QBrush & | b | ) | [virtual] |
virtual void QIconView::setItemTextPos | ( | ItemTextPos | pos | ) | [virtual] |
void QIconView::setItemTextPos | ( | ItemTextPos | pos | ) | [virtual] |
virtual void QIconView::setMaxItemTextLength | ( | int | w | ) | [virtual] |
void QIconView::setMaxItemTextLength | ( | int | w | ) | [virtual] |
void QIconView::setMaxItemWidth | ( | int | w | ) | [virtual] |
virtual void QIconView::setMaxItemWidth | ( | int | w | ) | [virtual] |
virtual void QIconView::setResizeMode | ( | ResizeMode | am | ) | [virtual] |
void QIconView::setResizeMode | ( | ResizeMode | am | ) | [virtual] |
void QIconView::setSelected | ( | QIconViewItem * | item, |
bool | s, | ||
bool | cb = FALSE |
||
) | [virtual] |
Selects or unselects item depending on s, and may also unselect other items, depending on QIconView::selectionMode() and cb.
If s is FALSE, item is unselected.
If s is TRUE and QIconView::selectionMode() is Single
, item is selected, and the item which was selected is unselected.
If s is TRUE and QIconView::selectionMode() is Extended
, item is selected. If cb is TRUE, the selection state of the icon view's other items is left unchanged. If cb is FALSE (the default) all other items are unselected.
If s is TRUE and QIconView::selectionMode() is Multi
item is selected.
Note that cb is used only if QIconView::selectionMode() is Extended
. cb defaults to FALSE.
All items whose selection status is changed repaint themselves.
virtual void QIconView::setSelected | ( | QIconViewItem * | item, |
bool | s, | ||
bool | cb = FALSE |
||
) | [virtual] |
void QIconView::setSelectionMode | ( | SelectionMode | m | ) | [virtual] |
virtual void QIconView::setSelectionMode | ( | SelectionMode | m | ) | [virtual] |
void QIconView::setShowToolTips | ( | bool | b | ) | [virtual] |
virtual void QIconView::setShowToolTips | ( | bool | b | ) | [virtual] |
If sort is TRUE, this function sets the icon view to sort items when a new item is inserted. If sort is FALSE, the icon view will not be sorted.
Note that autoArrange() must be TRUE for sorting to take place.
If ascending is TRUE (the default), items are sorted in ascending order. If ascending is FALSE, items are sorted in descending order.
QIconViewItem::compare() is used to compare pairs of items. The sorting is based on the items' keys; these default to the items' text unless specifically set to something else.
virtual void QIconView::setSpacing | ( | int | sp | ) | [virtual] |
void QIconView::setSpacing | ( | int | sp | ) | [virtual] |
virtual void QIconView::setWordWrapIconText | ( | bool | b | ) | [virtual] |
void QIconView::setWordWrapIconText | ( | bool | b | ) | [virtual] |
void QIconView::showEvent | ( | QShowEvent * | ) | [virtual] |
Reimplementado de QWidget.
virtual void QIconView::showEvent | ( | QShowEvent * | ) | [virtual] |
This event handler can be reimplemented in a subclass to receive widget show events.
Non-spontaneous show events are sent to widgets immediately before they are shown. The spontaneous show events of top-level widgets are delivered afterwards.
Reimplementado de QWidget.
bool QIconView::showToolTips | ( | ) | const |
bool QIconView::showToolTips | ( | ) | const |
QSize QIconView::sizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
QSize QIconView::sizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
void QIconView::slotUpdate | ( | ) | [protected, virtual, slot] |
This slot is used for a slightly-delayed update.
The icon view is not redrawn immediately after inserting a new item but after a very small delay using a QTimer. This means that when many items are inserted in a loop the icon view is probably redrawn only once at the end of the loop. This makes the insertions both flicker-free and faster.
virtual void QIconView::slotUpdate | ( | ) | [protected, virtual, slot] |
virtual void QIconView::sort | ( | bool | ascending = TRUE | ) | [virtual] |
void QIconView::sort | ( | bool | ascending = TRUE | ) | [virtual] |
Sorts and rearranges all the items in the icon view. If ascending is TRUE, the items are sorted in increasing order, otherwise they are sorted in decreasing order.
QIconViewItem::compare() is used to compare pairs of items. The sorting is based on the items' keys; these default to the items' text unless specifically set to something else.
Note that this function sets the sort order to ascending.
bool QIconView::sortDirection | ( | ) | const |
bool QIconView::sortDirection | ( | ) | const |
bool QIconView::sorting | ( | ) | const |
bool QIconView::sorting | ( | ) | const |
int QIconView::spacing | ( | ) | const |
int QIconView::spacing | ( | ) | const |
void QIconView::startDrag | ( | ) | [protected, virtual] |
Starts a drag.
virtual void QIconView::startDrag | ( | ) | [protected, virtual] |
void QIconView::styleChange | ( | QStyle & | old | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QIconView::styleChange | ( | QStyle & | old | ) | [protected, virtual] |
Reimplementado de QScrollView.
virtual void QIconView::takeItem | ( | QIconViewItem * | item | ) | [virtual] |
void QIconView::takeItem | ( | QIconViewItem * | item | ) | [virtual] |
Takes the icon view item item out of the icon view and causes an update of the screen display. The item is not deleted. You should normally not need to call this function because QIconViewItem::~QIconViewItem() calls it. The normal way to delete an item is to delete it.
virtual void QIconView::updateContents | ( | ) | [virtual, slot] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Reimplementado de QScrollView.
void QIconView::updateContents | ( | ) | [virtual, slot] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Reimplementado de QScrollView.
void QIconView::windowActivationChange | ( | bool | oldActive | ) | [protected, virtual] |
Reimplementado de QWidget.
void QIconView::windowActivationChange | ( | bool | oldActive | ) | [protected, virtual] |
This virtual function is called for a widget when its window is activated or deactivated by the window system. oldActive is the previous state; you can get the new setting from isActiveWindow().
Reimplement this function if your widget needs to know when its window becomes activated or deactivated.
The default implementation updates the visible part of the widget if the inactive and the active colorgroup are different for colors other than the highlight and link colors.
Reimplementado de QWidget.
bool QIconView::wordWrapIconText | ( | ) | const |
bool QIconView::wordWrapIconText | ( | ) | const |
QIconViewItem [friend] |
QIconViewPrivate [friend] |
QIconViewToolTip [friend] |
Arrangement QIconView::arrangement [read, write] |
the arrangement mode of the icon view
This can be LeftToRight
or TopToBottom
. The default is LeftToRight
.
bool QIconView::autoArrange [read, write] |
whether the icon view rearranges its items when a new item is inserted.
The default is TRUE.
Note that if the icon view is not visible at the time of insertion, QIconView defers all position-related work until it is shown and then calls arrangeItemsInGrid().
uint QIconView::count [read] |
the number of items in the icon view
int QIconView::gridX [read, write] |
the horizontal grid of the icon view
If the value is -1, (the default), QIconView computes suitable column widths based on the icon view's contents.
Note that setting a grid width overrides setMaxItemWidth().
int QIconView::gridY [read, write] |
the vertical grid of the icon view
If the value is -1, (the default), QIconView computes suitable column heights based on the icon view's contents.
bool QIconView::itemsMovable [read, write] |
whether the user is allowed to move items around in the icon view
The default is TRUE.
QBrush QIconView::itemTextBackground [read, write] |
the brush to use when drawing the background of an item's text.
By default this brush is set to NoBrush, meaning that only the normal icon view background is used.
ItemTextPos QIconView::itemTextPos [read, write] |
the position where the text of each item is drawn.
Valid values are Bottom
or Right
. The default is Bottom
.
int QIconView::maxItemTextLength [read, write] |
the maximum length (in characters) that an item's text may have.
The default is 255 characters.
int QIconView::maxItemWidth [read, write] |
ResizeMode QIconView::resizeMode [read, write] |
SelectionMode QIconView::selectionMode [read, write] |
the selection mode of the icon view
This can be Single
(the default), Extended
, Multi
or NoSelection
.
bool QIconView::showToolTips [read, write] |
whether the icon view will display a tool tip with the complete text for any truncated item text
The default is TRUE. Note that this has no effect if setWordWrapIconText() is TRUE, as it is by default.
bool QIconView::sortDirection [read] |
whether the sort direction for inserting new items is ascending;
The default is TRUE (i.e. ascending). This sort direction is only meaningful if both sorting() and autoArrange() are TRUE.
To set the sort direction, use setSorting()
bool QIconView::sorting [read] |
whether the icon view sorts on insertion
The default is FALSE, i.e. no sorting on insertion.
To set the sorting, use setSorting().
int QIconView::spacing [read, write] |
the space in pixels between icon view items
The default is 5 pixels.
Negative values for spacing are illegal.
bool QIconView::wordWrapIconText [read, write] |
whether the item text will be word-wrapped if it is too long
The default is TRUE.
If this property is FALSE, icon text that is too long is truncated, and an ellipsis (...) appended to indicate that truncation has occurred. The full text can still be seen by the user if they hover the mouse because the full text is shown in a tooltip; see setShowToolTips().