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

KDEUI

  • kdeui
  • widgets
khistorycombobox.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2
3 Copyright (c) 2000,2001 Dawit Alemayehu <adawit@kde.org>
4 Copyright (c) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License (LGPL) as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library 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 GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KHistoryComboBoxBOX_H
23#define KHistoryComboBoxBOX_H
24
25#include <kcombobox.h>
26
27class KPixmapProvider;
28
48class KDEUI_EXPORT KHistoryComboBox : public KComboBox
49{
50 Q_OBJECT
51 Q_PROPERTY( QStringList historyItems READ historyItems WRITE setHistoryItems )
52
53public:
72 explicit KHistoryComboBox( QWidget *parent = 0 );
73
80 explicit KHistoryComboBox( bool useCompletion, QWidget *parent = 0 );
81
85 ~KHistoryComboBox();
86
93 void setHistoryItems( const QStringList &items );
94
138 void setHistoryItems( const QStringList &items, bool setCompletionList );
139
146 QStringList historyItems() const;
147
155 bool removeFromHistory( const QString& item );
156
169 void setPixmapProvider( KPixmapProvider *prov );
170
176 KPixmapProvider * pixmapProvider() const;
177
182 void reset();
183
184 using QComboBox::insertItems;
185
186public Q_SLOTS:
206 void addToHistory( const QString& item );
207
211 void clearHistory();
212
213Q_SIGNALS:
217 void cleared();
218
219protected:
223 virtual void keyPressEvent( QKeyEvent * );
224
228 virtual void wheelEvent( QWheelEvent *ev );
229
238 void insertItems( const QStringList& items );
239
243 bool useCompletion() const;
244
245private Q_SLOTS:
249 void slotReset();
250
255 void slotClear();
256
260 void addContextMenuItems( QMenu* );
261
265 void slotSimulateActivated( const QString& );
266
267private:
268 void init( bool useCompletion );
269 void rotateUp();
270 void rotateDown();
271
272private:
273 class Private;
274 friend class Private;
275 Private* const d;
276
277 Q_DISABLE_COPY(KHistoryComboBox)
278};
279
280
281#endif
282
KComboBox::KComboBox
KComboBox(QWidget *parent=0)
Constructs a read-only or rather select-only combo box with a parent object and a name.
Definition kcombobox.cpp:57
KComboBox::wheelEvent
virtual void wheelEvent(QWheelEvent *ev)
Definition kcombobox.cpp:260
KHistoryComboBox::setPixmapProvider
void setPixmapProvider(KPixmapProvider *prov)
Sets a pixmap provider, so that items in the combobox can have a pixmap.
Definition khistorycombobox.cpp:377
KHistoryComboBox::addToHistory
void addToHistory(const QString &item)
Adds an item to the end of the history list and to the completion list.
Definition khistorycombobox.cpp:183
KHistoryComboBox::historyItems
QStringList historyItems
Definition khistorycombobox.h:51
KHistoryComboBox::keyPressEvent
virtual void keyPressEvent(QKeyEvent *)
Handling key-events, the shortcuts to rotate the items.
Definition khistorycombobox.cpp:340
KHistoryComboBox::removeFromHistory
bool removeFromHistory(const QString &item)
Removes all items named item.
Definition khistorycombobox.cpp:235
KHistoryComboBox::pixmapProvider
KPixmapProvider * pixmapProvider() const
Definition khistorycombobox.cpp:438
KHistoryComboBox::clearHistory
void clearHistory()
Clears the history and the completion list.
Definition khistorycombobox.cpp:163
KHistoryComboBox::cleared
void cleared()
Emitted when the history was cleared by the entry in the popup menu.
KHistoryComboBox::KHistoryComboBox
KHistoryComboBox(QWidget *parent=0)
Constructs a "read-write" combobox.
Definition khistorycombobox.cpp:66
KHistoryComboBox::insertItems
void insertItems(const QStringList &items)
Inserts items into the combo, honoring pixmapProvider() Does not update the completionObject.
Definition khistorycombobox.cpp:395
KHistoryComboBox::setHistoryItems
void setHistoryItems(const QStringList &items)
Inserts items into the combobox.
Definition khistorycombobox.cpp:113
KHistoryComboBox::reset
void reset()
Resets the current position of the up/down history.
Definition khistorycombobox.cpp:443
KHistoryComboBox::useCompletion
bool useCompletion() const
Definition khistorycombobox.cpp:158
KPixmapProvider
A tiny abstract class with just one method: pixmapFor()
Definition kpixmapprovider.h:39
QMenu
QWidget
kcombobox.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 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
  • 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