KWidgetsAddons

kactionmenu.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <[email protected]>
4  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
5  SPDX-FileCopyrightText: 2000 Nicolas Hadacek <[email protected]>
6  SPDX-FileCopyrightText: 2000 Kurt Granroth <[email protected]>
7  SPDX-FileCopyrightText: 2000 Michael Koch <[email protected]>
8  SPDX-FileCopyrightText: 2001 Holger Freyther <[email protected]>
9  SPDX-FileCopyrightText: 2002 Ellis Whitehead <[email protected]>
10  SPDX-FileCopyrightText: 2003 Andras Mantia <[email protected]>
11  SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <[email protected]>
12 
13  SPDX-License-Identifier: LGPL-2.0-only
14 */
15 
16 #ifndef KACTIONMENU_H
17 #define KACTIONMENU_H
18 
19 #include <QWidgetAction>
20 
21 #include <kwidgetsaddons_export.h>
22 
23 class QMenu;
24 
40 class KWIDGETSADDONS_EXPORT KActionMenu : public QWidgetAction
41 {
42  Q_OBJECT
43  Q_PROPERTY(bool delayed READ delayed WRITE setDelayed)
44  Q_PROPERTY(bool stickyMenu READ stickyMenu WRITE setStickyMenu)
45 
46 public:
47  explicit KActionMenu(QObject *parent);
48  KActionMenu(const QString &text, QObject *parent);
49  KActionMenu(const QIcon &icon, const QString &text, QObject *parent);
50  ~KActionMenu() override;
51 
52 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 0)
53 
56  KWIDGETSADDONS_DEPRECATED_VERSION(5, 0, "Use KActionMenu::removeAction(QAction*)")
57  void remove(QAction *);
58 #endif
59 
64  void addAction(QAction *action);
65  QAction *addSeparator();
66  void insertAction(QAction *before, QAction *action);
67  QAction *insertSeparator(QAction *before);
68  void removeAction(QAction *action);
69 
70 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 0)
71 
76  inline KWIDGETSADDONS_DEPRECATED_VERSION(5, 0, "Use KActionMenu::menu()")
77  QMenu *popupMenu()
78  {
79  return menu();
80  }
81 #endif
82 
87  bool delayed() const;
88 
102  void setDelayed(bool delayed);
103 
108  bool stickyMenu() const;
109 
118  void setStickyMenu(bool sticky);
119 
120  QWidget *createWidget(QWidget *parent) override;
121 
122 private:
123  class KActionMenuPrivate *const d;
124 };
125 
126 #endif
Q_PROPERTY(...)
A KActionMenu is an action that has several properties specific to holding a sub-menu of other action...
Definition: kactionmenu.h:40
virtual QWidget * createWidget(QWidget *parent)
QMenu * menu() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 5 2020 22:42:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.