• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • ui
transfersviewdelegate.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2006 Dario Massarin <nekkar@libero.it>
4  Copyright (C) 2007 by Javier Goday <jgoday@gmail.com>
5  Copyright (C) 2010 Matthias Fuchs <mat69@gmx.net>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 */
12 
13 #ifndef TRANSFERSVIEWDELEGATE_H
14 #define TRANSFERSVIEWDELEGATE_H
15 
16 #include <KExtendableItemDelegate>
17 
18 #include <QToolButton>
19 #include <QModelIndex>
20 
21 class QHBoxLayout;
22 class QButtonGroup;
23 
24 class TransferHandler;
25 class TransferObserver;
26 class TransfersViewDelegate;
27 
28 class GroupStatusButton : public QToolButton
29 {
30  Q_OBJECT
31 
32  public:
33  GroupStatusButton(const QModelIndex &index, QWidget *parent);
34 
35  protected:
36  void checkStateSet();
37  void enterEvent(QEvent * event);
38  void leaveEvent(QEvent * event);
39  void paintEvent(QPaintEvent * event);
40  void timerEvent(QTimerEvent *event);
41 
42  private:
43  enum {None, Selecting, Deselecting, Blinking, BlinkingExiting} m_status;
44  QModelIndex m_index;
45 
46  int m_timerId;
47  int m_iconSize;
48 
49  float m_gradientId;
50 };
51 
52 class GroupStatusEditor : public QWidget
53 {
54  Q_OBJECT
55 
56  public:
57  GroupStatusEditor(const QModelIndex &index, QWidget *parent);
58 
59  void setRunning(bool running);
60  bool isRunning();
61 
62  private slots:
63  void slotStatusChanged();
64 
65  signals:
66  void changedStatus(GroupStatusEditor *editor);
67 
68  private:
69  QModelIndex m_index;
70 
71  QHBoxLayout * m_layout;
72 
73  QButtonGroup * m_btGroup;
74  GroupStatusButton * m_startBt;
75  GroupStatusButton * m_stopBt;
76 };
77 
81 class BasicTransfersViewDelegate : public KExtendableItemDelegate
82 {
83  Q_OBJECT
84 
85  public:
86  BasicTransfersViewDelegate(QAbstractItemView *parent);
87 
88  virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
89  virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
90  virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
91 
92  private slots:
93  virtual void slotGroupStatusChanged(GroupStatusEditor *editor);
94 };
95 
96 class TransfersViewDelegate : public BasicTransfersViewDelegate
97 {
98  Q_OBJECT
99 
100  public:
101  TransfersViewDelegate(QAbstractItemView *parent);
102 
103  void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
104 
105  void drawFocus(QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect) const;
106 
107  QSize sizeHint (const QStyleOptionViewItem & option, const QModelIndex & index) const;
108 
109  bool editorEvent(QEvent * event, QAbstractItemModel * model, const QStyleOptionViewItem & option, const QModelIndex & index);
110 };
111 
112 #endif
113 
TransfersViewDelegate::paint
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: transfersviewdelegate.cpp:324
TransferHandler
Class TransferHandler:
Definition: transferhandler.h:48
QWidget
TransfersViewDelegate
Definition: transfersviewdelegate.h:96
KExtendableItemDelegate
BasicTransfersViewDelegate::setEditorData
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
Definition: transfersviewdelegate.cpp:290
TransfersViewDelegate::sizeHint
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: transfersviewdelegate.cpp:424
BasicTransfersViewDelegate::createEditor
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: transfersviewdelegate.cpp:274
GroupStatusEditor::changedStatus
void changedStatus(GroupStatusEditor *editor)
GroupStatusButton
Definition: transfersviewdelegate.h:28
BasicTransfersViewDelegate
The BasicTransfersViewDelegate handles the setting of the status of a group.
Definition: transfersviewdelegate.h:81
GroupStatusEditor
Definition: transfersviewdelegate.h:52
GroupStatusButton::paintEvent
void paintEvent(QPaintEvent *event)
Definition: transfersviewdelegate.cpp:100
GroupStatusButton::leaveEvent
void leaveEvent(QEvent *event)
Definition: transfersviewdelegate.cpp:93
TransfersViewDelegate::TransfersViewDelegate
TransfersViewDelegate(QAbstractItemView *parent)
Definition: transfersviewdelegate.cpp:316
TransfersViewDelegate::editorEvent
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: transfersviewdelegate.cpp:447
GroupStatusEditor::GroupStatusEditor
GroupStatusEditor(const QModelIndex &index, QWidget *parent)
Definition: transfersviewdelegate.cpp:208
QAbstractItemModel
GroupStatusButton::enterEvent
void enterEvent(QEvent *event)
Definition: transfersviewdelegate.cpp:76
BasicTransfersViewDelegate::setModelData
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Definition: transfersviewdelegate.cpp:300
BasicTransfersViewDelegate::BasicTransfersViewDelegate
BasicTransfersViewDelegate(QAbstractItemView *parent)
Definition: transfersviewdelegate.cpp:269
GroupStatusButton::GroupStatusButton
GroupStatusButton(const QModelIndex &index, QWidget *parent)
Definition: transfersviewdelegate.cpp:40
GroupStatusEditor::setRunning
void setRunning(bool running)
Definition: transfersviewdelegate.cpp:247
GroupStatusEditor::isRunning
bool isRunning()
Definition: transfersviewdelegate.cpp:258
QToolButton
TransfersViewDelegate::drawFocus
void drawFocus(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const
Definition: transfersviewdelegate.cpp:416
GroupStatusButton::timerEvent
void timerEvent(QTimerEvent *event)
Definition: transfersviewdelegate.cpp:148
GroupStatusButton::checkStateSet
void checkStateSet()
Definition: transfersviewdelegate.cpp:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal