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

libkdepim

  • sources
  • kde-4.12
  • kdepim
  • libkdepim
  • widgets
kcheckcombobox.h
Go to the documentation of this file.
1 /*
2  This file is part of libkdepim.
3 
4  Copyright (c) 2008 Thomas Thrainer <tom_t@gmx.at>
5  Copyright (c) 2010 Bertjan Broeksema <broeksema@kde.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of Qt, and distribute the resulting executable,
23  without including the source code for Qt in the source distribution.
24 */
25 
26 #ifndef KCHECKCOMBOBOX_H
27 #define KCHECKCOMBOBOX_H
28 
29 #include "kdepim_export.h"
30 
31 #include <KComboBox>
32 #include <QModelIndex>
33 
34 namespace KPIM {
35 
42 class KDEPIM_EXPORT KCheckComboBox : public KComboBox
43 {
44  Q_OBJECT
45 
46  Q_PROPERTY( QString separator READ separator WRITE setSeparator )
47  Q_PROPERTY( QString defaultText READ defaultText WRITE setDefaultText )
48  Q_PROPERTY( bool squeezeText READ squeezeText WRITE setSqueezeText )
49  Q_PROPERTY( QStringList checkedItems READ checkedItems WRITE setCheckedItems )
50 
51  public:
57  explicit KCheckComboBox( QWidget *parent = 0 );
58 
62  virtual ~KCheckComboBox();
63 
67  virtual void hidePopup();
68 
72  QString defaultText() const;
73 
79  void setDefaultText( const QString &text );
80 
85  bool alwaysShowDefaultText() const;
86 
93  void setAlwaysShowDefaultText( bool always );
94 
101  bool squeezeText() const;
102 
108  void setSqueezeText( bool squeeze );
109 
114  bool itemEnabled( int index );
115 
120  void setItemEnabled( int index, bool enabled = true );
121 
127  Qt::CheckState itemCheckState( int index ) const;
128 
135  void setItemCheckState( int index, Qt::CheckState state );
136 
141  QString separator() const;
142 
148  void setSeparator( const QString &separator );
149 
154  QStringList checkedItems( int role = Qt::DisplayRole ) const;
155 
156  public Q_SLOTS:
164  void setCheckedItems( const QStringList &items, int role = Qt::DisplayRole );
165 
166  Q_SIGNALS:
172  void checkedItemsChanged( const QStringList &items );
173 
174  protected:
175  virtual bool eventFilter( QObject *receiver, QEvent *event );
176  virtual void keyPressEvent( QKeyEvent *event );
177  virtual void resizeEvent( QResizeEvent * event );
178 #ifndef QT_NO_WHEELEVENT
179  virtual void wheelEvent( QWheelEvent *event );
180 #endif
181 
182  private:
183  //@cond PRIVATE
184  class Private;
185  Private *const d;
186 
187  Q_PRIVATE_SLOT( d, void makeInsertedItemsCheckable(const QModelIndex &, int start, int end) )
188  Q_PRIVATE_SLOT( d, void updateCheckedItems( const QModelIndex &topLeft,
189  const QModelIndex &bottomRight ) )
190  Q_PRIVATE_SLOT( d, void toggleCheckState() )
191  //@endcond
192 };
193 
194 }
195 
196 #endif // KCHECKCOMBOBOX_H
kdepim_export.h
QWidget
KPIM::KCheckComboBox
A combobox that shows its items in such a way that they can be checked in the drop menu...
Definition: kcheckcombobox.h:42
QObject
KComboBox
KDEPIM_EXPORT
#define KDEPIM_EXPORT
Definition: kdepim_export.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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