KFile
kfileplacesview.cpp
Go to the documentation of this file.
134 return QSize(option.rect.width(), option.fontMetrics.height() / 2 + qMax(iconSize, option.fontMetrics.height()));
137 void KFilePlacesViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
159 : option.rect.right() - LATERAL_MARGIN - m_iconSize, option.rect.top() + (option.rect.height() - m_iconSize) / 2);
189 : 0, option.rect.top() + (option.rect.height() / 2 - height / 2), option.rect.width() - m_iconSize - LATERAL_MARGIN * 2, option.fontMetrics.height());
190 painter->drawText(rectText, Qt::AlignLeft | Qt::AlignTop, option.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width()));
191 QRect capacityRect(isLTR ? rectText.x() : LATERAL_MARGIN, rectText.bottom() - 1, rectText.width() - LATERAL_MARGIN, CAPACITYBAR_HEIGHT);
204 : 0, option.rect.top(), option.rect.width() - m_iconSize - LATERAL_MARGIN * 2, option.rect.height());
205 painter->drawText(rectText, Qt::AlignLeft | Qt::AlignVCenter, option.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width()));
640 const QString text = i18nc("@info", "Do you really want to empty the Trash? All items will be deleted.");
895 const int iconSize = KIconLoader::global()->currentSize(KIconLoader::Small) + 3 * LATERAL_MARGIN;
1166 const QModelIndex index = delegate->indexForFadeAnimation(static_cast<QTimeLine*>(q->sender()));
1177 const KFilePlacesModel *placesModel = static_cast<const KFilePlacesModel*>(hoveredIndex.model());
1184 const KFilePlacesModel *placesModel = static_cast<const KFilePlacesModel*>(focusedIndex.model());
KGuiItem add()
void urlsDropped(const KUrl &dest, QDropEvent *event, QWidget *parent)
Is emitted if items are dropped on the place dest.
QString i18n(const char *text)
void setDirtyRegion(const QRegion ®ion)
void setOpacity(qreal opacity)
SimpleJob * special(const KUrl &url, const QByteArray &data, JobFlags flags=DefaultFlags)
const QPalette & palette() const
int currentSize(KIconLoader::Group group) const
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
virtual void dropEvent(QDropEvent *event)
Definition: kfileplacesview.cpp:779
int IconSize(KIconLoader::Group group)
void setPlaceHidden(const QModelIndex &index, bool hidden)
Definition: kfileplacesmodel.cpp:697
void requestSetup(const QModelIndex &index)
Definition: kfileplacesmodel.cpp:817
void setCurrentIndex(const QModelIndex &index)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QModelIndex currentIndex() const
static bool getInformation(bool allowGlobal, KUrl &url, QString &label, QString &icon, bool isAddingNewPlace, bool &appLocal, int iconSize, QWidget *parent=0)
A convenience method to show the dialog and retrieve all the properties via the given parameters...
Definition: kfileplaceeditdialog.cpp:54
void setColor(ColorGroup group, ColorRole role, const QColor &color)
QWidget * window() const
QItemSelectionModel * selectionModel() const
static KIconLoader * global()
bool isDevice(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:202
void addActions(QList< QAction * > actions)
virtual void dragEnterEvent(QDragEnterEvent *event)
Definition: kfileplacesview.cpp:729
int timeout
void setChecked(bool)
QStyle * style() const
QString label(StandardShortcut id)
virtual void setModel(QAbstractItemModel *model)
virtual void paintEvent(QPaintEvent *event)
Definition: kfileplacesview.cpp:800
const QColor & color(ColorGroup group, ColorRole role) const
virtual void dragLeaveEvent(QDragLeaveEvent *event)
Definition: kfileplacesview.cpp:740
int y() const
void save()
void requestTeardown(const QModelIndex &index)
Definition: kfileplacesmodel.cpp:786
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Get the children model index for the given row and column.
Definition: kfileplacesmodel.cpp:249
void setAttribute(Qt::WidgetAttribute attribute, bool on)
T value() const
bool isAutoResizeItemsEnabled() const
Definition: kfileplacesview.cpp:456
KConfigGroup group(const QByteArray &group)
QString text(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:192
QWidget * viewport() const
void setAlpha(int alpha)
void addPlace(const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
Definition: kfileplacesmodel.cpp:634
int height() const
int x() const
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
QAction * teardownActionForIndex(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:727
void setFrameStyle(int style)
void drawLine(const QLineF &line)
void requestEject(const QModelIndex &index)
Definition: kfileplacesmodel.cpp:799
bool setupNeeded(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:182
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void rowsInserted(const QModelIndex &parent, int start, int end)
Definition: kfileplacesview.cpp:854
QPalette::ColorRole foregroundRole() const
virtual QSize sizeHint() const
int y() const
KGuiItem del()
QVariant data(const QModelIndex &index, int role) const
Get a visible data based on Qt role for the given index.
Definition: kfileplacesmodel.cpp:240
int rowCount(const QModelIndex &parent=QModelIndex()) const
Get the number of rows for a model index.
Definition: kfileplacesmodel.cpp:266
QString i18nc(const char *ctxt, const char *text)
QPixmap pixmap(const QSize &size, Mode mode, State state) const
Definition: kfileplacesview_p.h:25
void initFrom(const QWidget *widget)
const QColor & color() const
QString text() const
bool isValid() const
void insertAction(QAction *before, QAction *action)
enabled
virtual void showEvent(QShowEvent *event)
bool isHidden(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:197
void removePlace(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:681
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
void installEventFilter(QObject *filterObj)
int top() const
void setPen(const QColor &color)
QString icon() const
QModelIndex closestItem(const KUrl &url) const
Returns the closest item for the URL url.
Definition: kfileplacesmodel.cpp:281
virtual void hideEvent(QHideEvent *event)
int left() const
QPalette::ColorRole backgroundRole() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
bool isEmpty() const
void setItemDelegate(QAbstractItemDelegate *delegate)
int row() const
qreal currentValue() const
KBookmark bookmarkForIndex(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:226
Solid::Device deviceForIndex(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:212
QAbstractItemDelegate * itemDelegate() const
QPoint pos() const
void drawText(const QPointF &position, const QString &text)
QAction * ejectActionForIndex(const QModelIndex &index) const
Definition: kfileplacesmodel.cpp:771
virtual QRect visualRect(const QModelIndex &index) const
void setCurrentTime(int msec)
virtual void showEvent(QShowEvent *event)
Definition: kfileplacesview.cpp:717
virtual QVariant data(const QModelIndex &index, int role) const =0
virtual void dragEnterEvent(QDragEnterEvent *event)
QString componentName() const
void hide()
QScrollBar * verticalScrollBar() const
QRect rect() const
void setDropOnPlaceEnabled(bool enabled)
If enabled is true, it is allowed dropping items above a place for e.
Definition: kfileplacesview.cpp:441
void setAcceptDrops(bool on)
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: kfileplacesview.cpp:751
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const =0
int key() const
QString metaDataItem(const QString &key) const
void setParent(QObject *parent)
virtual void paintEvent(QPaintEvent *e)
void setRowHidden(int row, bool hide)
int width(const QString &text, int len) const
void setCheckable(bool)
virtual QStyleOptionViewItem viewOptions() const
void editPlace(const QModelIndex &index, const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
Definition: kfileplacesmodel.cpp:659
void restore()
void setSelectionRectVisible(bool show)
virtual void dragMoveEvent(QDragMoveEvent *e)
virtual bool event(QEvent *e)
virtual void resizeEvent(QResizeEvent *e)
QString & replace(int position, int n, QChar after)
bool isDropOnPlaceEnabled() const
Definition: kfileplacesview.cpp:446
static KNotification * event(const QString &eventId, const QString &title, const QString &text, const QPixmap &pixmap=QPixmap(), QWidget *widget=0L, const NotificationFlags &flags=CloseOnTimeout, const KComponentData &componentData=KComponentData())
virtual void dropEvent(QDropEvent *e)
bool isValid() const
virtual QModelIndex indexAt(const QPoint &p) const
virtual void clear()
int width() const
const QAbstractItemModel * model() const
virtual void dragLeaveEvent(QDragLeaveEvent *e)
QVariant data(int role) const
QStyle * style()
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: kfileplacesview.cpp:556
QWidget * parentWidget() const
int height() const
virtual void resizeEvent(QResizeEvent *event)
Definition: kfileplacesview.cpp:711
int height() const
virtual void setModel(QAbstractItemModel *model)
Definition: kfileplacesview.cpp:840
int bottom() const
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Definition: kfileplacesview.cpp:1191
virtual void keyPressEvent(QKeyEvent *event)
Definition: kfileplacesview.cpp:548
const KComponentData & mainComponent()
bool toBool() const
void setMouseTracking(bool enable)
virtual void hideEvent(QHideEvent *event)
Definition: kfileplacesview.cpp:723
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const =0
void edit(const QModelIndex &index)
void clicked(const QModelIndex &index)
void setCurrentIndex(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
KFilePlacesView(QWidget *parent=0)
Definition: kfileplacesview.cpp:366
virtual void keyPressEvent(QKeyEvent *event)
QAbstractItemModel * model() const
QModelIndex currentIndex() const
bool isLocalFile() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
QObject * parent() const
void setResizeMode(ResizeMode mode)
QString toString() const
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
T readEntry(const QString &key, const T &aDefault) const
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void setAutoResizeItemsEnabled(bool enabled)
If enabled is true (the default), items will automatically resize themselves to fill the view...
Definition: kfileplacesview.cpp:451
void start()
void setEnabled(bool)
int height() const
qreal opacity() const
void setDirection(Direction direction)
void setDropIndicatorShown(bool enable)
KUrl url() const
void setDragEnabled(bool enable)
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.