KFilePlacesView
#include <KFilePlacesView>
Public Types | |
using | TeardownFunction = std::function<void(const QModelIndex &)> |
Public Types inherited from QListView | |
enum | Flow |
enum | LayoutMode |
enum | Movement |
enum | ResizeMode |
enum | ViewMode |
Public Types inherited from QAbstractItemView | |
enum | CursorAction |
enum | DragDropMode |
enum | DropIndicatorPosition |
enum | EditTrigger |
enum | ScrollHint |
enum | ScrollMode |
enum | SelectionBehavior |
enum | SelectionMode |
enum | State |
Public Types inherited from QAbstractScrollArea | |
enum | SizeAdjustPolicy |
Public Types inherited from QFrame | |
enum | Shadow |
enum | Shape |
enum | StyleMask |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Signals | |
void | activeTabRequested (const QUrl &url) |
void | allPlacesShownChanged (bool allPlacesShown) |
void | contextMenuAboutToShow (const QModelIndex &index, QMenu *menu) |
void | newWindowRequested (const QUrl &url) |
void | placeActivated (const QUrl &url) |
void | tabRequested (const QUrl &url) |
void | urlChanged (const QUrl &url) |
void | urlsDropped (const QUrl &dest, QDropEvent *event, QWidget *parent) |
Public Slots | |
void | setModel (QAbstractItemModel *model) override |
void | setShowAll (bool showAll) |
void | setUrl (const QUrl &url) |
Protected Slots | |
void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles) override |
void | rowsInserted (const QModelIndex &parent, int start, int end) override |
Protected Member Functions | |
void | contextMenuEvent (QContextMenuEvent *event) override |
void | dragEnterEvent (QDragEnterEvent *event) override |
void | dragLeaveEvent (QDragLeaveEvent *event) override |
void | dragMoveEvent (QDragMoveEvent *event) override |
void | dropEvent (QDropEvent *event) override |
void | hideEvent (QHideEvent *event) override |
void | keyPressEvent (QKeyEvent *event) override |
void | mousePressEvent (QMouseEvent *event) override |
void | paintEvent (QPaintEvent *event) override |
void | resizeEvent (QResizeEvent *event) override |
void | showEvent (QShowEvent *event) override |
void | startDrag (Qt::DropActions supportedActions) override |
Protected Member Functions inherited from QListView | |
virtual void | currentChanged (const QModelIndex ¤t, const QModelIndex &previous) override |
virtual void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) override |
virtual bool | event (QEvent *e) override |
virtual int | horizontalOffset () const const override |
virtual bool | isIndexHidden (const QModelIndex &index) const const override |
virtual void | mouseMoveEvent (QMouseEvent *e) override |
virtual void | mouseReleaseEvent (QMouseEvent *e) override |
virtual QModelIndex | moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override |
QRect | rectForIndex (const QModelIndex &index) const const |
virtual void | rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end) override |
virtual void | rowsInserted (const QModelIndex &parent, int start, int end) override |
virtual QModelIndexList | selectedIndexes () const const override |
virtual void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override |
void | setPositionForIndex (const QPoint &position, const QModelIndex &index) |
virtual void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) override |
virtual void | timerEvent (QTimerEvent *e) override |
virtual void | updateGeometries () override |
virtual int | verticalOffset () const const override |
virtual QStyleOptionViewItem | viewOptions () const const override |
virtual QSize | viewportSizeHint () const const override |
virtual QRegion | visualRegionForSelection (const QItemSelection &selection) const const override |
virtual void | wheelEvent (QWheelEvent *e) override |
Protected Member Functions inherited from QAbstractItemView | |
virtual void | closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint) |
virtual void | commitData (QWidget *editor) |
QPoint | dirtyRegionOffset () const const |
QAbstractItemView::DropIndicatorPosition | dropIndicatorPosition () const const |
virtual bool | edit (const QModelIndex &index, QAbstractItemView::EditTrigger trigger, QEvent *event) |
virtual void | editorDestroyed (QObject *editor) |
virtual bool | eventFilter (QObject *object, QEvent *event) override |
void | executeDelayedItemsLayout () |
virtual void | focusInEvent (QFocusEvent *event) override |
virtual bool | focusNextPrevChild (bool next) override |
virtual void | focusOutEvent (QFocusEvent *event) override |
int | horizontalStepsPerItem () const const |
virtual void | inputMethodEvent (QInputMethodEvent *event) override |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) override |
void | scheduleDelayedItemsLayout () |
void | scrollDirtyRegion (int dx, int dy) |
virtual QItemSelectionModel::SelectionFlags | selectionCommand (const QModelIndex &index, const QEvent *event) const const |
void | setDirtyRegion (const QRegion ®ion) |
void | setHorizontalStepsPerItem (int steps) |
void | setState (QAbstractItemView::State state) |
void | setVerticalStepsPerItem (int steps) |
QAbstractItemView::State | state () const const |
int | verticalStepsPerItem () const const |
virtual bool | viewportEvent (QEvent *event) override |
Protected Member Functions inherited from QAbstractScrollArea | |
virtual void | scrollContentsBy (int dx, int dy) |
void | setViewportMargins (const QMargins &margins) |
void | setViewportMargins (int left, int top, int right, int bottom) |
QMargins | viewportMargins () const const |
Protected Member Functions inherited from QFrame | |
virtual void | changeEvent (QEvent *ev) override |
void | initStyleOption (QStyleOptionFrame *option) const const |
Protected Member Functions inherited from QWidget | |
virtual void | actionEvent (QActionEvent *event) |
virtual void | closeEvent (QCloseEvent *event) |
void | create (WId window, bool initializeWindow, bool destroyOldWindow) |
void | destroy (bool destroyWindow, bool destroySubWindows) |
virtual void | enterEvent (QEvent *event) |
bool | focusNextChild () |
bool | focusPreviousChild () |
virtual void | initPainter (QPainter *painter) const const override |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | leaveEvent (QEvent *event) |
virtual int | metric (QPaintDevice::PaintDeviceMetric m) const const override |
virtual void | moveEvent (QMoveEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual void | tabletEvent (QTabletEvent *event) |
void | updateMicroFocus () |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
Detailed Description
This class allows to display a KFilePlacesModel.
Definition at line 30 of file kfileplacesview.h.
Member Typedef Documentation
◆ TeardownFunction
using KFilePlacesView::TeardownFunction = std::function<void(const QModelIndex &)> |
The teardown function signature.
Custom teardown logic may be provided via the setTeardownFunction method.
- Since
- 5.91
Definition at line 42 of file kfileplacesview.h.
Constructor & Destructor Documentation
◆ KFilePlacesView()
|
explicit |
Definition at line 754 of file kfileplacesview.cpp.
◆ ~KFilePlacesView()
|
override |
Definition at line 899 of file kfileplacesview.cpp.
Member Function Documentation
◆ activeTabRequested
|
signal |
Emitted when the URL url should be opened in a new active tab because the user clicked on a place with the middle mouse button with the Shift modifier pressed or left-clicked with both the Ctrl and Shift modifiers pressed.
If a storage device needs to be mounted first, this signal is emitted once mounting has completed successfully.
- Since
- 5.91
◆ allPlacesShown()
bool KFilePlacesView::allPlacesShown | ( | ) | const |
Whether hidden places, if any, are currently shown.
- Since
- 5.91
Definition at line 993 of file kfileplacesview.cpp.
◆ allPlacesShownChanged
|
signal |
Emitted when allPlacesShown changes.
- Since
- 5.91
◆ contextMenuAboutToShow
|
signal |
Emitted just before the context menu opens.
This can be used to add additional application actions to the menu.
- Parameters
-
index The model index of the place whose menu is about to open. menu The menu that will be opened.
- Since
- 5.91
◆ contextMenuEvent()
|
overrideprotectedvirtual |
Reimplemented from QAbstractScrollArea.
Definition at line 1076 of file kfileplacesview.cpp.
◆ dataChanged
|
overrideprotectedslot |
Definition at line 2054 of file kfileplacesview.cpp.
◆ dragAutoActivationDelay()
int KFilePlacesView::dragAutoActivationDelay | ( | ) | const |
Definition at line 934 of file kfileplacesview.cpp.
◆ dragEnterEvent()
|
overrideprotectedvirtual |
Reimplemented from QAbstractItemView.
Definition at line 1394 of file kfileplacesview.cpp.
◆ dragLeaveEvent()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1405 of file kfileplacesview.cpp.
◆ dragMoveEvent()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1420 of file kfileplacesview.cpp.
◆ dropEvent()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1464 of file kfileplacesview.cpp.
◆ hideEvent()
|
overrideprotectedvirtual |
Reimplemented from QWidget.
Definition at line 1387 of file kfileplacesview.cpp.
◆ isAutoResizeItemsEnabled()
bool KFilePlacesView::isAutoResizeItemsEnabled | ( | ) | const |
Definition at line 944 of file kfileplacesview.cpp.
◆ isDropOnPlaceEnabled()
bool KFilePlacesView::isDropOnPlaceEnabled | ( | ) | const |
Definition at line 909 of file kfileplacesview.cpp.
◆ keyPressEvent()
|
overrideprotectedvirtual |
Reimplemented from QAbstractItemView.
Definition at line 1034 of file kfileplacesview.cpp.
◆ mousePressEvent()
|
overrideprotectedvirtual |
Reimplemented from QAbstractItemView.
Definition at line 1569 of file kfileplacesview.cpp.
◆ newWindowRequested
|
signal |
Emitted when the URL url should be opened in a new window because the user left-clicked on a place with Shift modifier pressed or selected "Open in New Window" from the context menu.
If a storage device needs to be mounted first, this signal is emitted once mounting has completed successfully.
- Since
- 5.91
◆ paintEvent()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1515 of file kfileplacesview.cpp.
◆ placeActivated
|
signal |
Emitted when an item in the places view is clicked on with left mouse button with no modifier keys pressed.
If a storage device needs to be mounted first, this signal is emitted once mounting has completed successfully.
- Parameters
-
url The URL of the place
- Since
- 5.91
◆ resizeEvent()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1367 of file kfileplacesview.cpp.
◆ rowsInserted
|
overrideprotectedslot |
Definition at line 1609 of file kfileplacesview.cpp.
◆ setAutoResizeItemsEnabled()
void KFilePlacesView::setAutoResizeItemsEnabled | ( | bool | enabled | ) |
If enabled is true (the default), items will automatically resize themselves to fill the view.
Definition at line 939 of file kfileplacesview.cpp.
◆ setDragAutoActivationDelay()
void KFilePlacesView::setDragAutoActivationDelay | ( | int | delay | ) |
If delay (in ms) is greater than zero, the place will automatically be activated if an item is dragged over and held on top of a place for at least that duraton.
- Parameters
-
delay Delay in ms, default is zero.
- Since
- 5.92
Definition at line 914 of file kfileplacesview.cpp.
◆ setDropOnPlaceEnabled()
void KFilePlacesView::setDropOnPlaceEnabled | ( | bool | enabled | ) |
If enabled is true, it is allowed dropping items above a place for e.
g. copy or move operations. The application has to take care itself to perform the operation (see KFilePlacesView::urlsDropped()). If enabled is false, it is only possible adding items as additional place. Per default dropping on a place is disabled.
Definition at line 904 of file kfileplacesview.cpp.
◆ setModel
|
overrideslot |
Definition at line 1585 of file kfileplacesview.cpp.
◆ setShowAll
|
slot |
Definition at line 998 of file kfileplacesview.cpp.
◆ setTeardownFunction()
void KFilePlacesView::setTeardownFunction | ( | TeardownFunction | teardownFunc | ) |
Sets a custom function that will be called when teardown of a device (e.g. unmounting a drive) is requested.
- Since
- 5.91
Definition at line 949 of file kfileplacesview.cpp.
◆ setUrl
|
slot |
Definition at line 954 of file kfileplacesview.cpp.
◆ showEvent()
|
overrideprotectedvirtual |
Reimplemented from QWidget.
Definition at line 1373 of file kfileplacesview.cpp.
◆ sizeHint()
|
overridevirtual |
Reimplemented from QAbstractScrollArea.
Definition at line 1631 of file kfileplacesview.cpp.
◆ startDrag()
|
overrideprotectedvirtual |
Reimplemented from QListView.
Definition at line 1563 of file kfileplacesview.cpp.
◆ tabRequested
|
signal |
Emitted when the URL url should be opened in a new inactive tab because the user clicked on a place with the middle mouse button or left-clicked with the Ctrl modifier pressed or selected "Open in New Tab" from the context menu.
If a storage device needs to be mounted first, this signal is emitted once mounting has completed successfully.
- Since
- 5.91
◆ urlsDropped
|
signal |
Is emitted if items are dropped on the place dest.
The application has to take care itself about performing the corresponding action like copying or moving.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:45:23 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.