• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kcompletionbox.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2
3 Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
4 2000 Stefan Schimanski <1Stein@gmx.de>
5 2000,2001,2002,2003,2004 Dawit Alemayehu <adawit@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License (LGPL) as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library 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 GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef KCOMPLETIONBOX_H
24#define KCOMPLETIONBOX_H
25
26#include <klistwidget.h>
27
28class QEvent;
29
43class KDEUI_EXPORT KCompletionBox : public KListWidget
44{
45 Q_OBJECT
46 Q_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
47 Q_PROPERTY(QString cancelledText READ cancelledText WRITE setCancelledText)
48 Q_PROPERTY( bool activateOnSelect READ activateOnSelect WRITE setActivateOnSelect )
49
50public:
57 explicit KCompletionBox( QWidget *parent = 0 );
58
62 ~KCompletionBox();
63
64 virtual QSize sizeHint() const;
65
69 bool activateOnSelect() const;
70
71public Q_SLOTS:
75 QStringList items() const;
76
82 void insertItems( const QStringList& items, int index = -1 );
83
87 void setItems( const QStringList& items );
88
100 virtual void popup();
101
112 void setTabHandling( bool enable );
113
122 bool isTabHandling() const;
123
134 void setCancelledText( const QString& txt);
135
139 QString cancelledText() const;
140
147 void setActivateOnSelect(bool state);
148
149
153 void down();
154
158 void up();
159
163 void pageDown();
164
168 void pageUp();
169
173 void home();
174
178 void end();
179
184 virtual void setVisible( bool visible );
185
186Q_SIGNALS:
191 void activated( const QString& );
192
197 void userCancelled( const QString& );
198
199protected:
205 QRect calculateGeometry() const;
206
210 void sizeAndPosition();
211
216 virtual bool eventFilter( QObject *, QEvent * );
217
222 virtual QPoint globalPositionHint() const;
223
224protected Q_SLOTS:
229 virtual void slotActivated( QListWidgetItem * );
230
231private Q_SLOTS:
232 void canceled();
233 void slotItemClicked( QListWidgetItem * );
234
235private:
236 class KCompletionBoxPrivate;
237 KCompletionBoxPrivate* const d;
238};
239
240
241#endif // KCOMPLETIONBOX_H
KCompletionBox
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
Definition: kcompletionbox.h:44
KCompletionBox::activated
void activated(const QString &)
Emitted when an item was selected, contains the text of the selected item.
KCompletionBox::userCancelled
void userCancelled(const QString &)
Emitted whenever the user chooses to ignore the available selections and close the this box.
KListWidget
A variant of QListWidget that honors KDE's system-wide settings.
Definition: klistwidget.h:41
QObject
QWidget
klistwidget.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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