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

KDE3Support

  • kde3support
  • kdeui
k3popupmenu.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
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 _K3POPUPMENU_H
20#define _K3POPUPMENU_H
21
22#ifndef QT3_SUPPORT
23#define QT3_SUPPORT
24#endif
25
26#include <kde3support_export.h>
27
28#include <Qt3Support/Q3PopupMenu>
29#include <QtGui/QMenuItem>
30
49class KDE3SUPPORT_EXPORT K3PopupMenu : public Q3PopupMenu {
50 Q_OBJECT
51public:
55 K3PopupMenu(QWidget *parent=0);
56
60 ~K3PopupMenu();
61
65 QAction* addTitle(const QString &text, QAction* before = 0L);
69 QAction* addTitle(const QIcon &icon, const QString &text, QAction* before = 0L);
70
84 void setKeyboardShortcutsEnabled(bool enable);
85
90 void setKeyboardShortcutsExecute(bool enable);
91
95 Q3PopupMenu* contextMenu();
96
100 const Q3PopupMenu* contextMenu() const;
101
105 void hideContextMenu();
106
110 static K3PopupMenu* contextMenuFocus();
111
115 static QAction* contextMenuFocusAction();
116
117#ifdef QT3_SUPPORT
122 Qt::ButtonState state() const;
123#endif
124
128 Qt::MouseButtons mouseButtons() const;
129
133 Qt::KeyboardModifiers keyboardModifiers() const;
134
135#ifdef QT3_SUPPORT
139 int insertTitle(const QString &text, int id=-1, int index=-1);
143 int insertTitle(const QPixmap &icon, const QString &text, int id=-1,
144 int index=-1);
149 void changeTitle(int id, const QString &text);
153 void changeTitle(int id, const QPixmap &icon, const QString &text);
159 QString title(int id=-1) const;
163 QPixmap titlePixmap(int id) const;
164
170 K3PopupMenu(const QString &title, QWidget *parent=0);
171
177 void setTitle(const QString &title);
178
182 static int contextMenuFocusItem();
183
187 virtual void activateItemAt(int index);
188 // END compat methods
189
194 static int actionId(QAction* action)
195 {
196 if (!action)
197 return -1;
198 return static_cast<QMenuItem*>(action)->id();
199 }
200#endif
201Q_SIGNALS:
208 void aboutToShowContextMenu(K3PopupMenu* menu, QAction* menuAction, QMenu* ctxMenu);
210 void aboutToShowContextMenu(K3PopupMenu* menu, int menuItem, Q3PopupMenu* ctxMenu);
211
212protected:
213 virtual void closeEvent(QCloseEvent *);
214 virtual void keyPressEvent(QKeyEvent* e);
215 virtual void mouseReleaseEvent(QMouseEvent* e);
216 virtual void mousePressEvent(QMouseEvent* e);
217 virtual bool focusNextPrevChild( bool next );
218 virtual void contextMenuEvent(QContextMenuEvent *e);
219 virtual void hideEvent(QHideEvent*);
220
221 virtual void virtual_hook( int id, void* data );
222
223protected Q_SLOTS:
224 QString underlineText(const QString& text, uint length);
225 void resetKeyboardVars(bool noMatches = false);
226 void actionHovered(QAction* action);
227 void showCtxMenu(const QPoint &pos);
228 void ctxMenuHiding();
229 void ctxMenuHideShowingMenu();
230
231private:
232 class K3PopupMenuPrivate;
233 K3PopupMenuPrivate *d;
234 Q_DISABLE_COPY( K3PopupMenu )
235};
236
237#endif
K3PopupMenu
A menu with keyboard searching and convenience methods for title items.
Definition: k3popupmenu.h:49
K3PopupMenu::aboutToShowContextMenu
void aboutToShowContextMenu(K3PopupMenu *menu, int menuItem, Q3PopupMenu *ctxMenu)
compat
K3PopupMenu::actionId
static int actionId(QAction *action)
Helper for porting things.
Definition: k3popupmenu.h:194
K3PopupMenu::aboutToShowContextMenu
void aboutToShowContextMenu(K3PopupMenu *menu, QAction *menuAction, QMenu *ctxMenu)
connect to this signal to be notified when a context menu is about to be shown
Q3PopupMenu
QAction
QMenu
QWidget
kde3support_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.

KDE3Support

Skip menu "KDE3Support"
  • 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