akonadi
agentinstancewidget.cpp
74 virtual void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
103 void AgentInstanceWidget::Private::currentAgentInstanceChanged( const QModelIndex ¤tIndex, const QModelIndex &previousIndex )
112 previousInstance = previousIndex.data( AgentInstanceModel::InstanceRole ).value<AgentInstance>();
118 void AgentInstanceWidget::Private::currentAgentInstanceDoubleClicked( const QModelIndex ¤tIndex )
128 void AgentInstanceWidget::Private::currentAgentInstanceClicked( const QModelIndex ¤tIndex )
158 d->mView->selectionModel()->setCurrentIndex( d->mView->model()->index( 0, 0 ), QItemSelectionModel::Select );
221 void AgentInstanceWidgetDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
234 QString statusMessage = index.model()->data( index, AgentInstanceModel::StatusMessageRole ).toString();
252 QRect innerRect = option.rect.adjusted( s_delegatePaddingSize, s_delegatePaddingSize, -s_delegatePaddingSize, -s_delegatePaddingSize ); //add some padding round entire delegate
254 const QSize decorationSize( KIconLoader::global()->currentSize( KIconLoader::Desktop ), KIconLoader::global()->currentSize( KIconLoader::Desktop ) );
255 const QSize statusIconSize = QSize(16,16);//= KIconLoader::global()->currentSize(KIconLoader::Small);
261 const QRect decorationRect( innerRect.left(), innerRect.top(), decorationSize.width(), innerRect.height() );
262 const QRect nameTextRect( decorationRect.topRight() + QPoint( 4, 0 ), innerRect.topRight() + QPoint( 0, innerRect.height() / 2) );
263 const QRect statusTextRect( decorationRect.bottomRight() + QPoint( 4, - innerRect.height()/2 ), innerRect.bottomRight() );
267 QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
278 painter->drawPixmap( style->itemPixmapRect( decorationRect, Qt::AlignCenter, iconPixmap ), iconPixmap );
284 painter->drawText(statusTextRect.adjusted( statusIconSize.width() + 4, 0, 0, 0 ), Qt::AlignVCenter | Qt::AlignLeft, statusMessage );
285 painter->drawPixmap(style->itemPixmapRect( statusTextRect, Qt::AlignVCenter | Qt::AlignLeft, statusPixmap ), statusPixmap );
288 QSize AgentInstanceWidgetDelegate::sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const
292 const int iconHeight = KIconLoader::global()->currentSize(KIconLoader::Desktop) + ( s_delegatePaddingSize*2 ); //icon height + padding either side
293 const int textHeight = option.fontMetrics.height() + qMax( option.fontMetrics.height(), 16 ) + ( s_delegatePaddingSize*2 ); //height of text + icon/text + padding either side
295 return QSize( 1,qMax( iconHeight, textHeight ) ); //any width,the view will give us the whole thing in list mode
The agent instance itself.
Definition: agentinstancemodel.h:64
void currentChanged(const Akonadi::AgentInstance ¤t, const Akonadi::AgentInstance &previous)
This signal is emitted whenever the current agent instance changes.
AgentInstance currentAgentInstance() const
Returns the current agent instance or an invalid agent instance if no agent instance is selected...
Definition: agentinstancewidget.cpp:174
The agent instance does currently nothing.
Definition: agentinstance.h:77
A textual presentation of the current status.
Definition: agentinstancemodel.h:67
The current online/offline status.
Definition: agentinstancemodel.h:69
The current status (numerical) of the instance.
Definition: agentinstancemodel.h:66
AgentFilterProxyModel * agentFilterProxyModel() const
Returns the agent filter proxy model, use this to filter by agent mimetype or capabilities.
Definition: agentinstancewidget.cpp:211
The agent instance is working on something.
Definition: agentinstance.h:78
QList< AgentInstance > selectedAgentInstances() const
Returns the selected agent instances.
Definition: agentinstancewidget.cpp:189
AgentInstanceWidget(QWidget *parent=0)
Creates a new agent instance widget.
Definition: agentinstancewidget.cpp:138
Provides a data model for agent instances.
Definition: agentinstancemodel.h:50
QAbstractItemView * view() const
Returns the view used in the widget.
Definition: agentinstancewidget.cpp:206
The current progress (numerical in percent) of an operation.
Definition: agentinstancemodel.h:68
A proxy model for filtering AgentType or AgentInstance.
Definition: agentfilterproxymodel.h:52
void doubleClicked(const Akonadi::AgentInstance ¤t)
This signal is emitted whenever there is a double click on an agent instance.
void clicked(const Akonadi::AgentInstance ¤t)
This signal is emitted whenever there is a click on an agent instance.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.