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

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
kwidgetlistbox.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005 Petri Damst� <petri.damsten@iki.fi>
3  *
4  * This file is part of SuperKaramba.
5  *
6  * SuperKaramba is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * SuperKaramba is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with SuperKaramba; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  ****************************************************************************/
20 #ifndef KWIDGETLISTBOX_H
21 #define KWIDGETLISTBOX_H
22 
23 #include "themewidget.h"
24 
25 #include <QTableWidget>
26 #include <QShowEvent>
27 #include <QHeaderView>
28 #include <QPoint>
29 
34 typedef bool(*show_callback)(int index, QWidget* widget, void* data);
35 
36 class KWidgetListbox : public QTableWidget
37 {
38  Q_OBJECT
39 
40 public:
41  explicit KWidgetListbox(QWidget *parent = 0);
42  ~KWidgetListbox();
43 
44  int insertItem(QWidget* item, int index = -1);
45  void setSelected(QWidget* item);
46  void setSelected(int index);
47  void removeItem(QWidget* item);
48  void removeItem(int index);
49  void clear();
50  int selected() const;
51  QWidget* selectedItem() const;
52  QWidget* item(int index) const;
53  int index(QWidget* itm) const;
54  uint count() const
55  {
56  return rowCount();
57  }
58 
59  void showItems(show_callback func = 0, void* data = 0);
60 
61 protected:
62  virtual void showEvent(QShowEvent* e);
63  virtual void mousePressEvent(QMouseEvent *event);
64  virtual void mouseMoveEvent(QMouseEvent *event);
65 
66 protected slots:
67  void selectionChanged(int row, int col);
68 
69 signals:
70  void selected(int index);
71  void itemDropped(QPoint, ThemeWidget*);
72 
73 private:
74  QPoint m_dragStartPosition;
75 };
76 
77 #endif
KWidgetListbox::count
uint count() const
Definition: kwidgetlistbox.h:54
KWidgetListbox::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: kwidgetlistbox.cpp:146
QTableWidget
KWidgetListbox::showEvent
virtual void showEvent(QShowEvent *e)
Definition: kwidgetlistbox.cpp:132
KWidgetListbox::selectionChanged
void selectionChanged(int row, int col)
Definition: kwidgetlistbox.cpp:74
QWidget
show_callback
bool(* show_callback)(int index, QWidget *widget, void *data)
Definition: kwidgetlistbox.h:34
KWidgetListbox::index
int index(QWidget *itm) const
Definition: kwidgetlistbox.cpp:110
KWidgetListbox::~KWidgetListbox
~KWidgetListbox()
Definition: kwidgetlistbox.cpp:44
KWidgetListbox::showItems
void showItems(show_callback func=0, void *data=0)
Definition: kwidgetlistbox.cpp:118
KWidgetListbox::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
Definition: kwidgetlistbox.cpp:137
themewidget.h
KWidgetListbox::selected
int selected() const
Definition: kwidgetlistbox.cpp:95
KWidgetListbox::removeItem
void removeItem(QWidget *item)
Definition: kwidgetlistbox.cpp:80
KWidgetListbox::insertItem
int insertItem(QWidget *item, int index=-1)
Definition: kwidgetlistbox.cpp:54
ThemeWidget
Definition: themewidget.h:30
KWidgetListbox::setSelected
void setSelected(QWidget *item)
Definition: kwidgetlistbox.cpp:69
KWidgetListbox::clear
void clear()
Definition: kwidgetlistbox.cpp:49
KWidgetListbox
Definition: kwidgetlistbox.h:36
KWidgetListbox::selectedItem
QWidget * selectedItem() const
Definition: kwidgetlistbox.cpp:100
KWidgetListbox::item
QWidget * item(int index) const
Definition: kwidgetlistbox.cpp:105
KWidgetListbox::itemDropped
void itemDropped(QPoint, ThemeWidget *)
KWidgetListbox::KWidgetListbox
KWidgetListbox(QWidget *parent=0)
Definition: kwidgetlistbox.cpp:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

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