⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qiconview.3qt

📁 qt专门用于嵌入式的图形开发GUI
💻 3QT
📖 第 1 页 / 共 4 页
字号:
.PP.SS "Member Type Documentation".SH "QIconView::Arrangement"This enum type determines in which direction the items flow when the view runs out of space..TP\fCQIconView::LeftToRight\fR - Items which don't fit into the view go further down (you get a vertical scrollbar).TP\fCQIconView::TopToBottom\fR - Items which don't fit into the view go further right (you get a horizontal scrollbar).SH "QIconView::ItemTextPos"This enum type specifies the position of the item text in relation to the icon..TP\fCQIconView::Bottom\fR - The text is drawn below the icon..TP\fCQIconView::Right\fR - The text is drawn to the right of the icon..SH "QIconView::ResizeMode"This enum type is used to tell QIconView how it should treat the positions of its icons when the widget is resized. The modes are:.TP\fCQIconView::Fixed\fR - The icons' positions are not changed..TP\fCQIconView::Adjust\fR - The icons' positions are adjusted to be within the new geometry, if possible..SH "QIconView::SelectionMode"This enumerated type is used by QIconView to indicate how it reacts to selection by the user. It has four values:.TP\fCQIconView::Single\fR - 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().).TP\fCQIconView::Multi\fR - 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..TP\fCQIconView::Extended\fR - 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..TP\fCQIconView::NoSelection\fR - Items cannot be selected..PPTo 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..SH MEMBER FUNCTION DOCUMENTATION.SH "QIconView::QIconView ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"Constructs an empty icon view called \fIname\fR, with parent \fIparent\fR and using the widget flags \fIf\fR..SH "QIconView::~QIconView ()\fC [virtual]\fR"Destroys the icon view and deletes all items..SH "void QIconView::adjustItems ()\fC [virtual protected slot]\fR"Adjusts the positions of the items to the geometry of the icon view..SH "void QIconView::arrangeItemsInGrid ( const QSize & grid, bool update = TRUE )\fC [virtual slot]\fR"This variant uses \fIgrid\fR instead of (gridX(), gridY()). If \fIgrid\fR is invalid (see QSize::isValid()), arrangeItemsInGrid() calculates a valid grid itself and uses that..PPIf \fIupdate\fR is TRUE (the default) the viewport is repainted..PPExample: fileiconview/qfileiconview.h..SH "void QIconView::arrangeItemsInGrid ( bool update = TRUE )\fC [virtual slot]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPArranges all the items in the grid given by gridX() and gridY()..PPEven 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())..PPIf \fIupdate\fR is TRUE (the default), the viewport is repainted as well..PPSee also QIconView::gridX, QIconView::gridY, and QIconView::sort()..SH "Arrangement QIconView::arrangement () const"Returns the arrangement mode of the icon view. See the "arrangement" property for details..SH "bool QIconView::autoArrange () const"Returns TRUE if the icon view rearranges its items when a new item is inserted; otherwise returns FALSE. See the "autoArrange" property for details..SH "void QIconView::clear ()\fC [virtual]\fR"Clears the icon view. All items are deleted..SH "void QIconView::clearSelection ()\fC [virtual]\fR"Unselects all the items..SH "void QIconView::clicked ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted when the user clicks any mouse button. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PPSee also mouseButtonClicked(), rightButtonClicked(), and pressed()..SH "void QIconView::clicked ( QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when the user clicks any mouse button on an icon view item. \fIitem\fR is a pointer to the item that has been clicked..PP\fIpos\fR 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, \fIpos\fR is the position at release time.).PPSee also mouseButtonClicked(), rightButtonClicked(), and pressed()..SH "void QIconView::contextMenuRequested ( QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This signal is emitted when the user invokes a context menu with the right mouse button or with special system keys, with \fIitem\fR being the item under the mouse cursor or the current item, respectively..PP\fIpos\fR is the position for the context menu in the global coordinate system..SH "uint QIconView::count () const"Returns the number of items in the icon view. See the "count" property for details..SH "void QIconView::currentChanged ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted when a new item becomes current. \fIitem\fR is the new current item (or 0 if no item is now current)..PPSee also currentItem()..SH "QIconViewItem * QIconView::currentItem () const"Returns a pointer to the current item of the icon view, or 0 if no item is current..PPSee also setCurrentItem(), firstItem(), and lastItem()..SH "void QIconView::doAutoScroll ()\fC [virtual protected slot]\fR"Performs autoscrolling when selecting multiple icons with the rubber band..SH "void QIconView::doubleClicked ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted when the user double-clicks on \fIitem\fR..SH "QDragObject * QIconView::dragObject ()\fC [virtual protected]\fR"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..PPSee also QIconDrag..PPExamples:.)l fileiconview/qfileiconview.cpp and iconview/simple_dd/main.cpp..SH "void QIconView::drawBackground ( QPainter * p, const QRect & r )\fC [virtual protected]\fR"This function is called to draw the rectangle \fIr\fR of the background using the painter \fIp\fR..PPThe default implementation fills \fIr\fR with the viewport's backgroundBrush(). Subclasses may reimplement this to draw custom backgrounds..PPSee also contentsX, contentsY, and drawContents()..SH "void QIconView::drawRubber ( QPainter * p )\fC [virtual protected]\fR"Draws the rubber band using the painter \fIp\fR..SH "void QIconView::dropped ( QDropEvent * e, const QValueList<QIconDragItem> & lst )\fC [signal]\fR"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..PP\fIe\fR provides all the information about the drop. If the drag object of the drop was a QIconDrag, \fIlst\fR contains the list of the dropped items. You can get the data using QIconDragItem::data() on each item. If the \fIlst\fR is empty, i.e. the drag was not a QIconDrag, you have to decode the data in \fIe\fR and work with that..PPNote QIconViewItems may be drop targets; if a drop event occurs on an item the item handles the drop..PPExamples:.)l iconview/main.cpp and iconview/simple_dd/main.cpp..SH "void QIconView::emitSelectionChanged ( QIconViewItem * i = 0 )\fC [protected]\fR"Emits a signal to indicate selection changes. \fIi\fR is the QIconViewItem that was selected or de-selected..PP\fIYou should never need to call this function.\fR.SH "void QIconView::ensureItemVisible ( QIconViewItem * item )"Makes sure that \fIitem\fR is entirely visible. If necessary, ensureItemVisible() scrolls the icon view..PPSee also ensureVisible()..SH "QIconViewItem * QIconView::findFirstVisibleItem ( const QRect & r ) const"Finds the first item whose bounding rectangle overlaps \fIr\fR and returns a pointer to that item. \fIr\fR is given in content coordinates. Returns 0 if no item overlaps \fIr\fR..PPIf you want to find all items that touch \fIr\fR, you will need to use this function and nextItem() in a loop ending at findLastVisibleItem() and test QIconViewItem::rect() for each of these items..PPSee also findLastVisibleItem() and QIconViewItem::rect()..SH "QIconViewItem * QIconView::findItem ( const QPoint & pos ) const"Returns a pointer to the item that contains point \fIpos\fR, which is given in contents coordinates, or 0 if no item contains point \fIpos\fR..SH "QIconViewItem * QIconView::findItem ( const QString & text, ComparisonFlags compare = BeginsWith ) const"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a pointer to the first item whose text begins with \fItext\fR, or 0 if no such item could be found. Use the \fIcompare\fR flag to control the comparison behaviour. (See Qt::StringComparisonMode.).SH "QIconViewItem * QIconView::findLastVisibleItem ( const QRect & r ) const"Finds the last item whose bounding rectangle overlaps \fIr\fR and returns a pointer to that item. \fIr\fR is given in content coordinates. Returns 0 if no item overlaps \fIr\fR..PPSee also findFirstVisibleItem()..SH "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..PPSee also lastItem() and currentItem()..SH "int QIconView::gridX () const"Returns the horizontal grid of the icon view. See the "gridX" property for details..SH "int QIconView::gridY () const"Returns the vertical grid of the icon view. See the "gridY" property for details..SH "int QIconView::index ( const QIconViewItem * item ) const"Returns the index of \fIitem\fR, or -1 if \fIitem\fR doesn't exist in this icon view..SH "void QIconView::insertInGrid ( QIconViewItem * item )\fC [virtual protected]\fR"Inserts the QIconViewItem \fIitem\fR in the icon view's grid. \fIYou should never need to call this function.\fR Instead, insert QIconViewItems by creating them with a pointer to the QIconView that they are to be inserted into..SH "void QIconView::insertItem ( QIconViewItem * item, QIconViewItem * after = 0L )\fC [virtual]\fR"Inserts the icon view item \fIitem\fR after \fIafter\fR. If \fIafter\fR is 0, \fIitem\fR is appended after the last item..PP\fIYou should never need to call this function.\fR Instead create QIconViewItem's and associate them with your icon view like this:.PP.nf.br        (void) new QIconViewItem( myIconview, "The text of the item", aPixmap );.br.fi.SH "void QIconView::invertSelection ()\fC [virtual]\fR"Inverts the selection. Works only in Multi and Extended selection mode..SH "bool QIconView::isRenaming () const"Returns TRUE if an iconview item is being renamed; otherwise returns FALSE..SH "void QIconView::itemRenamed ( QIconViewItem * item, const QString & name )\fC [signal]\fR"This signal is emitted when \fIitem\fR has been renamed to \fIname\fR, usually by in-place renaming..PPSee also QIconViewItem::setRenameEnabled() and QIconViewItem::rename()..SH "void QIconView::itemRenamed ( QIconViewItem * item )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when \fIitem\fR has been renamed, usually by in-place renaming..PPSee also QIconViewItem::setRenameEnabled() and QIconViewItem::rename()..SH "QBrush QIconView::itemTextBackground () const"Returns the brush to use when drawing the background of an item's text. See the "itemTextBackground" property for details..SH "ItemTextPos QIconView::itemTextPos () const"Returns the position where the text of each item is drawn. See the "itemTextPos" property for details..SH "bool QIconView::itemsMovable () const"Returns TRUE if the user is allowed to move items around in the icon view; otherwise returns FALSE. See the "itemsMovable" property for details..SH "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..PPSee also firstItem() and currentItem()..SH "QIconViewItem * QIconView::makeRowLayout ( QIconViewItem * begin, int & y, bool & changed )\fC [protected]\fR"Lays out a row of icons (if Arrangement == TopToBottom this is a column). Starts laying out with the item \fIbegin\fR. \fIy\fR is the starting coordinate. Returns the last item of the row (column) and sets the new starting coordinate to \fIy\fR. The \fIchanged\fR parameter is used internally..PP\fBWarning:\fR This function may be made private in a future version of Qt. We do not recommend calling it..SH "int QIconView::maxItemTextLength () const"Returns the maximum length (in characters) that an item's text may have. See the "maxItemTextLength" property for details..SH "int QIconView::maxItemWidth () const"Returns the maximum width that an item may have. See the "maxItemWidth" property for details..SH "void QIconView::mouseButtonClicked ( int button, QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This signal is emitted when the user clicks mouse button \fIbutton\fR. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PP\fIpos\fR 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, \fIpos\fR is the position at release time.).PPSee also mouseButtonPressed(), rightButtonClicked(), and clicked()..SH "void QIconView::mouseButtonPressed ( int button, QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This signal is emitted when the user presses mouse button \fIbutton\fR. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PP\fIpos\fR is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos())..PPSee also rightButtonClicked() and pressed()..SH "void QIconView::moved ()\fC [signal]\fR"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..PPExample: iconview/main.cpp..SH "void QIconView::onItem ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted when the user moves the mouse cursor onto an \fIitem\fR, similar to the QWidget::enterEvent() function..SH "void QIconView::onViewport ()\fC [signal]\fR"This signal is emitted when the user moves the mouse cursor from an item to an empty part of the icon view..PPSee also onItem()..SH "void QIconView::pressed ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted when the user presses any mouse button. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PPSee also mouseButtonPressed(), rightButtonPressed(), and clicked()..SH "void QIconView::pressed ( QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when the user presses any mouse button. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PP\fIpos\fR 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, \fIpos\fR is the position at release time.).PPSee also mouseButtonPressed(), rightButtonPressed(), and clicked()..SH "void QIconView::repaintItem ( QIconViewItem * item )\fC [virtual]\fR"Repaints the \fIitem\fR..SH "void QIconView::repaintSelectedItems ()"Repaints the selected items..SH "ResizeMode QIconView::resizeMode () const"Returns the resize mode of the icon view. See the "resizeMode" property for details..SH "void QIconView::returnPressed ( QIconViewItem * item )\fC [signal]\fR"This signal is emitted if the user presses the Return or Enter key. \fIitem\fR is the currentItem() at the time of the keypress..SH "void QIconView::rightButtonClicked ( QIconViewItem * item, const QPoint & pos )\fC [signal]\fR"This signal is emitted when the user clicks the right mouse button. If \fIitem\fR is non-null, the cursor is on \fIitem\fR. If \fIitem\fR is null, the mouse cursor isn't on any item..PP\fIpos\fR 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, \fIpos\fR is the position at release time.)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -