29 #include <QGraphicsView>
30 #include <QGraphicsWidget>
31 #include <QGraphicsLinearLayout>
39 static const int MinMenuItemWidth = 150;
40 static const int MinMenuItemHeight = 40;
44 m_ButtonContainer(0), m_isMenuVisible(
false), m_currentSelectedIndex(-1)
51 for(
int i = 0;
i < m_ButtonContainer->
count();
i++ ) {
52 delete m_ButtonContainer->
at(
i);
54 m_ButtonContainer->
clear();
56 delete m_ButtonContainer;
57 m_ButtonContainer = 0;
88 m_isMenuVisible ? menuHide() : menuShow();
89 m_isMenuVisible = !m_isMenuVisible;
94 for(
int i = 0;
i < m_ButtonContainer->
count();
i++) {
101 void Menu::menuHide()
103 for(
int i = 0;
i < m_ButtonContainer->
count();
i++) {
109 m_currentSelectedIndex = -1;
115 QSize(MinMenuItemWidth, MinMenuItemHeight));
117 for(
int i = 0;
i < m_ButtonContainer->
count();
i++) {
127 if(
event->key() == 16777235 ) {
128 if(m_currentSelectedIndex > 0) {
133 m_currentSelectedIndex--;
134 button = m_ButtonContainer->
at(m_currentSelectedIndex);
139 if(m_currentSelectedIndex >= 0) {
144 m_currentSelectedIndex = m_ButtonContainer->
count() -1;
145 if(m_currentSelectedIndex >= 0) {
153 if(
event->key() == 16777237 ) {
154 if (m_currentSelectedIndex < m_ButtonContainer->
count()-1) {
155 if(m_currentSelectedIndex >= 0) {
160 m_currentSelectedIndex++;
166 if(m_currentSelectedIndex >= 0) {
170 m_currentSelectedIndex = 0;
171 button = m_ButtonContainer->
at(m_currentSelectedIndex);
178 if(
event->key() == 17825792 ||
event->key() == 16842752 ||
179 event->key() == 16777221 ) {
180 if(m_currentSelectedIndex >= 0) {
186 if(
event->key() == 17825793 ) {
small capitals from c petite p scientific i
[1]
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
void setMinimumWidth(qreal width)
The QGraphicsLinearLayout class provides a horizontal or vertical layout for managing widgets in Grap...
void removeItem(QGraphicsLayoutItem *item)
void setSpacing(qreal spacing)
void addItem(QGraphicsLayoutItem *item)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The QKeyEvent class describes a key event.
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void append(parameter_type t)
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QString class provides a Unicode character string.
QPixmap pixmap(const QString filename="", QSize size=QSize(0, 0))
GLenum GLenum GLsizei count
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent