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

KDEUI

  • kdeui
  • widgets
kactionselector.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef _KACTION_SELECTOR_H_
20#define _KACTION_SELECTOR_H_
21
22#include <kdeui_export.h>
23#include <QtGui/QWidget>
24
25class QListWidget;
26class QListWidgetItem;
27class QKeyEvent;
28class QEvent;
29class QIcon;
30
31class KActionSelectorPrivate;
32
80class KDEUI_EXPORT KActionSelector : public QWidget {
81 Q_OBJECT
82 Q_ENUMS( InsertionPolicy MoveButton )
83 Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
84 Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
85 Q_PROPERTY( QString availableLabel READ availableLabel WRITE setAvailableLabel )
86 Q_PROPERTY( QString selectedLabel READ selectedLabel WRITE setSelectedLabel )
87 Q_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy )
88 Q_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy )
89 Q_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons )
90
91public:
92 explicit KActionSelector( QWidget *parent=0 );
93 ~KActionSelector();
94
98 QListWidget *availableListWidget() const;
99
103 QListWidget *selectedListWidget() const;
104
108 enum MoveButton {
109 ButtonAdd,
110 ButtonRemove,
111 ButtonUp,
112 ButtonDown
113 };
114
127 enum InsertionPolicy {
128 BelowCurrent,
129 Sorted,
130 AtTop,
131 AtBottom
132 };
133
142 bool moveOnDoubleClick() const;
143
148 void setMoveOnDoubleClick( bool enable );
149
168 bool keyboardEnabled() const;
169
174 void setKeyboardEnabled( bool enable );
175
179 QString availableLabel() const;
180
187 void setAvailableLabel( const QString & text );
188
192 QString selectedLabel() const;
193
200 void setSelectedLabel( const QString & text );
201
207 InsertionPolicy availableInsertionPolicy() const;
208
213 void setAvailableInsertionPolicy( InsertionPolicy policy );
214
220 InsertionPolicy selectedInsertionPolicy() const;
221
226 void setSelectedInsertionPolicy( InsertionPolicy policy );
227
231 bool showUpDownButtons() const;
232
237 void setShowUpDownButtons( bool show );
238
243 void setButtonIcon( const QString &icon, MoveButton button );
244
251 void setButtonIconSet( const QIcon &iconset, MoveButton button );
252
256 void setButtonTooltip( const QString &tip, MoveButton button );
257
261 void setButtonWhatsThis( const QString &text, MoveButton button );
262
270 void setButtonsEnabled();
271
272Q_SIGNALS:
276 void added( QListWidgetItem *item );
277
281 void removed( QListWidgetItem *item );
282
286 void movedUp( QListWidgetItem *item );
287
291 void movedDown( QListWidgetItem *item );
292
296// void addedToSelection( QListWidgetItem *item );
297
298public Q_SLOTS:
303 void polish();
304
305protected:
309 void keyPressEvent( QKeyEvent * );
310
314 bool eventFilter( QObject *, QEvent * );
315
316private:
320 Q_PRIVATE_SLOT(d, void buttonAddClicked())
321
322
325 Q_PRIVATE_SLOT(d, void buttonRemoveClicked())
326
330 Q_PRIVATE_SLOT(d, void buttonUpClicked())
331
335 Q_PRIVATE_SLOT(d, void buttonDownClicked())
336
340 Q_PRIVATE_SLOT(d, void itemDoubleClicked( QListWidgetItem *item ))
341
345 Q_PRIVATE_SLOT(d, void slotCurrentChanged( QListWidgetItem * ))
346
347private:
348
352 friend class KActionSelectorPrivate;
353 KActionSelectorPrivate * const d;
354
355 Q_DISABLE_COPY(KActionSelector)
356};
357
358#endif // _KACTION_SELECTOR_H_
KActionSelector
A widget for selecting and arranging actions/objects.
Definition: kactionselector.h:80
KActionSelector::movedUp
void movedUp(QListWidgetItem *item)
Emitted when an item is moved upwards in the "selected" listbox.
KActionSelector::InsertionPolicy
InsertionPolicy
This enum defines policies for where to insert moved items in a listbox.
Definition: kactionselector.h:127
KActionSelector::Sorted
@ Sorted
Definition: kactionselector.h:129
KActionSelector::AtTop
@ AtTop
Definition: kactionselector.h:130
KActionSelector::BelowCurrent
@ BelowCurrent
Definition: kactionselector.h:128
KActionSelector::MoveButton
MoveButton
This enum indentifies the moving buttons.
Definition: kactionselector.h:108
KActionSelector::ButtonUp
@ ButtonUp
Definition: kactionselector.h:111
KActionSelector::ButtonRemove
@ ButtonRemove
Definition: kactionselector.h:110
KActionSelector::ButtonAdd
@ ButtonAdd
Definition: kactionselector.h:109
KActionSelector::movedDown
void movedDown(QListWidgetItem *item)
Emitted when an item is moved downwards in the "selected" listbox.
KActionSelector::removed
void removed(QListWidgetItem *item)
Emitted when an item is moved out of the "selected" listbox.
KActionSelector::added
void added(QListWidgetItem *item)
Emitted when an item is moved to the "selected" listbox.
QListWidget
QObject
QWidget
kdeui_export.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