Akonadi
agentinstancewidget.cpp
61 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
80 void currentAgentInstanceChanged(const QModelIndex ¤tIndex, const QModelIndex &previousIndex);
90void AgentInstanceWidgetPrivate::currentAgentInstanceChanged(const QModelIndex ¤tIndex, const QModelIndex &previousIndex)
105void AgentInstanceWidgetPrivate::currentAgentInstanceDoubleClicked(const QModelIndex ¤tIndex)
148 d->mView->selectionModel()->setCurrentIndex(d->mView->model()->index(0, 0), QItemSelectionModel::Select);
151 connect(d->mView->selectionModel(), &QItemSelectionModel::currentChanged, this, [this](const auto &tl, const auto &br) {
231void AgentInstanceWidgetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
244 QString statusMessage = index.model()->data(index, AgentInstanceModel::StatusMessageRole).toString();
269 const QSize statusIconSize = statusPixmap.size(); //= KIconLoader::global()->currentSize(KIconLoader::Small);
275 const QRect decorationRect(innerRect.left(), innerRect.top(), decorationSize.width(), innerRect.height());
276 const QRect nameTextRect(decorationRect.topRight() + QPoint(4, 0), innerRect.topRight() + QPoint(0, innerRect.height() / 2));
277 const QRect statusTextRect(decorationRect.bottomRight() + QPoint(4, -innerRect.height() / 2), innerRect.bottomRight());
279 QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled;
290 painter->drawPixmap(style->itemPixmapRect(decorationRect, Qt::AlignCenter, iconPixmap), iconPixmap);
296 painter->drawText(statusTextRect.adjusted(statusIconSize.width() + 4, 0, 0, 0), Qt::AlignVCenter | Qt::AlignLeft, statusMessage);
297 painter->drawPixmap(style->itemPixmapRect(statusTextRect, Qt::AlignVCenter | Qt::AlignLeft, statusPixmap), statusPixmap);
300QSize AgentInstanceWidgetDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
304 const int iconHeight = QApplication::style()->pixelMetric(QStyle::PM_MessageBoxIconSize) + (s_delegatePaddingSize * 2); // icon height + padding either side
306 option.fontMetrics.height() + qMax(option.fontMetrics.height(), 16) + (s_delegatePaddingSize * 2); // height of text + icon/text + padding either side
308 return QSize(1, qMax(iconHeight, textHeight)); // any width,the view will give us the whole thing in list mode
Represents one agent instance and takes care of communication with it.
Definition akonadicontrol/agentinstance.h:35
A proxy model for filtering AgentType or AgentInstance.
Definition agentinstancefilterproxymodel.h:43
Provides a data model for agent instances.
Definition agentinstancemodel.h:41
@ ProgressRole
The current progress (numerical in percent) of an operation.
Definition agentinstancemodel.h:60
void doubleClicked(const Akonadi::AgentInstance ¤t)
This signal is emitted whenever there is a double click on an agent instance.
QList< AgentInstance > selectedAgentInstances() const
Returns the selected agent instances.
Definition agentinstancewidget.cpp:179
void clicked(const Akonadi::AgentInstance ¤t)
This signal is emitted whenever there is a click on an agent instance.
Akonadi::AgentInstanceFilterProxyModel * agentInstanceFilterProxyModel() const
Returns the agent filter proxy model, use this to filter by agent mimetype or capabilities.
Definition agentinstancewidget.cpp:201
~AgentInstanceWidget() override
Destroys the agent instance widget.
AgentInstance currentAgentInstance() const
Returns the current agent instance or an invalid agent instance if no agent instance is selected.
Definition agentinstancewidget.cpp:164
QAbstractItemView * view() const
Returns the view used in the widget.
Definition agentinstancewidget.cpp:196
void currentChanged(const Akonadi::AgentInstance ¤t, const Akonadi::AgentInstance &previous)
This signal is emitted whenever the current agent instance changes.
AgentInstanceWidget(QWidget *parent=nullptr)
Creates a new agent instance widget.
Definition agentinstancewidget.cpp:125
Q_SCRIPTABLE CaptureState status()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
Helper integration between Akonadi and Qt.
QString name(GameStandardAction id)
virtual QVariant data(const QModelIndex &index, int role) const const=0
ScrollPerPixel
ExtendedSelection
void clicked(const QModelIndex &index)
void doubleClicked(const QModelIndex &index)
QStyle * style()
void setBold(bool enable)
QModelIndexList indexes() const const
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
QModelIndex currentIndex() const const
const QItemSelection selection() const const
void addWidget(QWidget *w)
void setContentsMargins(const QMargins &margins)
void append(QList< T > &&value)
void reserve(qsizetype size)
QVariant data(int role) const const
bool isValid() const const
const QAbstractItemModel * model() const const
Q_OBJECTQ_OBJECT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
void drawPixmap(const QPoint &point, const QPixmap &pixmap)
void drawText(const QPoint &position, const QString &text)
void setFont(const QFont &font)
void setPen(Qt::PenStyle style)
ColorGroup
HighlightedText
QSize size() const const
QPoint bottomRight() const const
int height() const const
int left() const const
int top() const const
QPoint topRight() const const
int width() const const
QString & append(QChar ch)
PM_MessageBoxIconSize
PE_PanelItemViewItem
State_Enabled
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const const=0
virtual QRect itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const const=0
AlignCenter
CaseInsensitive
NoContextMenu
DecorationRole
bool toBool() const const
int toInt(bool *ok) const const
QString toString() const const
uint toUInt(bool *ok) const const
T value() const const
QLayout * layout() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.