kget
transferhistoryitemdelegate.cpp
Go to the documentation of this file.
3 Based in the kcategorizeditemsviewdelegate from kdebase/workspace/libs/plasma/appletbrowser by Ivan Cukic
34 TransferHistoryItemDelegate::TransferHistoryItemDelegate(QWidget *parent) : QStyledItemDelegate(),
63 if (!option.state.testFlag(QStyle::State_Selected) && !option.state.testFlag(QStyle::State_MouseOver)) {
95 QString size = KIO::convertSize(model->data(index, TransferHistoryCategorizedDelegate::RoleSize).toInt());
96 QString date = model->data(index, TransferHistoryCategorizedDelegate::RoleDate).toDate().toString("dd.MM.yyyy");
116 QColor subcolor = (option.state.testFlag(QStyle::State_Selected) || (option.state.testFlag(QStyle::State_MouseOver))) ?
152 QSize TransferHistoryItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
187 const QAbstractItemModel *model = static_cast <const QAbstractItemModel *> (m_selectedIndex.model());
189 new KRun(model->data(m_selectedIndex, TransferHistoryCategorizedDelegate::RoleDest).toString(), m_view, true, false);
194 const QAbstractItemModel *model = static_cast <const QAbstractItemModel *> (m_selectedIndex.model());
202 const QAbstractItemModel *model = static_cast <const QAbstractItemModel *> (m_selectedIndex.model());
204 emit deletedTransfer(model->data(m_selectedIndex, TransferHistoryCategorizedDelegate::RoleUrl).toString(), m_selectedIndex);
void setText(const QString &text)
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: transferhistoryitemdelegate.cpp:160
QString toString(Qt::DateFormat format) const
void setColorAt(qreal position, const QColor &color)
void deletedTransfer(const QString &url, const QModelIndex &index)
void setIcon(const QIcon &icon)
void save()
~TransferHistoryItemDelegate()
Definition: transferhistoryitemdelegate.cpp:56
void drawLine(const QLineF &line)
virtual bool event(QEvent *e)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: transferhistoryitemdelegate.cpp:152
const char * name() const
bool isValid() const
void setFont(const QFont &font)
int toInt(bool *ok) const
void fillPath(const QPainterPath &path, const QBrush &brush)
void setPen(const QColor &color)
Qt::MouseButton button() const
void drawText(const QPointF &position, const QString &text)
virtual QVariant data(const QModelIndex &index, int role) const =0
void drawRoundRect(const QRectF &r, int xRnd, int yRnd)
TransferHistoryItemDelegate(QWidget *parent)
Definition: transferhistoryitemdelegate.cpp:34
void restore()
QDate toDate() const
const QAbstractItemModel * model() const
QPoint pos()
static void showNewTransferDialog(const KUrl &url=KUrl())
Definition: newtransferdialog.cpp:493
QStyle * style()
void addRoundRect(const QRectF &r, int xRnd, int yRnd)
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: transferhistoryitemdelegate.cpp:60
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
QString toString() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 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:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.