Version: 9.12.0
QtxMenu.h
Go to the documentation of this file.
1
// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2
//
3
// This library is free software; you can redistribute it and/or
4
// modify it under the terms of the GNU Lesser General Public
5
// License as published by the Free Software Foundation; either
6
// version 2.1 of the License, or (at your option) any later version.
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
// Lesser General Public License for more details.
12
//
13
// You should have received a copy of the GNU Lesser General Public
14
// License along with this library; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
//
17
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
//
19
20
// File: QtxMenu.h
21
// Author: Sergey TELKOV
22
//
23
#ifndef QTXMENU_H
24
#define QTXMENU_H
25
26
#include "
Qtx.h
"
27
28
#include <QMenu>
29
30
class
QWidgetAction
;
31
32
class
QTX_EXPORT
QtxMenu
:
public
QMenu
33
{
34
Q_OBJECT
35
36
class
Title
;
37
38
public
:
40
typedef
enum
{
41
TitleAuto
,
42
TitleOn
,
43
TitleOff
44
} TitleMode;
45
46
public
:
47
QtxMenu
(
QWidget
* = 0 );
48
virtual
~
QtxMenu
();
49
50
QIcon titleIcon()
const
;
51
QString titleText()
const
;
52
53
TitleMode titleMode()
const
;
54
Qt::Alignment titleAlignment()
const
;
55
56
virtual
void
setTitleIcon(
const
QIcon& );
57
virtual
void
setTitleText(
const
QString& );
58
59
virtual
void
setTitleMode(
const
TitleMode );
60
virtual
void
setTitleAlignment(
const
Qt::Alignment );
61
62
virtual
void
addGroup(
const
QString& );
63
virtual
void
addGroup(
const
QIcon&,
const
QString& );
64
65
public
slots:
66
virtual
void
setVisible(
bool
);
67
68
private
:
69
void
updateTitle();
70
void
insertTitle();
71
void
removeTitle();
72
73
private
:
74
TitleMode
myMode
;
75
Title
*
myTitle
;
76
QWidgetAction
*
myAction
;
77
};
78
79
#endif
// QTXMENU_H
Qtx.h
QTX_EXPORT
#define QTX_EXPORT
Definition:
Qtx.h:36
QMenu
QWidgetAction
QWidget
QtxMenu::Title
Popup menu title item.
Definition:
QtxMenu.cxx:41
QtxMenu
The class QtxMenu represents the popup menu with the title.
Definition:
QtxMenu.h:33
QtxMenu::myMode
TitleMode myMode
Definition:
QtxMenu.h:74
QtxMenu::myAction
QWidgetAction * myAction
Definition:
QtxMenu.h:76
QtxMenu::myTitle
Title * myTitle
Definition:
QtxMenu.h:75
QtxMenu::TitleMode
TitleMode
Popup menu title mode.
Definition:
QtxMenu.h:40
QtxMenu::TitleAuto
@ TitleAuto
auto mode
Definition:
QtxMenu.h:41
QtxMenu::TitleOn
@ TitleOn
always on (display title)
Definition:
QtxMenu.h:42
src
Qtx
QtxMenu.h
Copyright © 2007-2023 CEA, EDF, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS