diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-20 23:30:31 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-20 23:30:31 +0100 |
commit | e5a11fbb3251a98fafd6bebf0b6fc366acb19088 (patch) | |
tree | 8e1bd6704205307e0a23484221ea1bb67a9f411e /tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp | |
parent | 0646d1131b4bc65cdd9af29f4ce00fdd2398a3df (diff) | |
parent | 76c0be34cd4ff4564693162fa7528463e23ce9d8 (diff) |
Merge "Merge branch 'dev' into stable" into refs/staging/stable
Diffstat (limited to 'tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp')
-rw-r--r-- | tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp index f8655bf725..540d7cf31b 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp @@ -73,14 +73,14 @@ Menu::~Menu() void Menu::init() { m_ButtonContainer = new QList<Button*>; - + m_Layout->setContentsMargins(0,0,0,0); m_Layout->setSpacing(0); - - setMinimumWidth(150); - + + setMinimumWidth(150); + setLayout(m_Layout); - + connect(Theme::p(), SIGNAL(themeChanged()), this, SLOT(themeChange())); } @@ -124,9 +124,9 @@ void Menu::menuHide() void Menu::themeChange() { - QPixmap pixmap = Theme::p()->pixmap("status_field_middle.svg", + QPixmap pixmap = Theme::p()->pixmap("status_field_middle.svg", QSize(MinMenuItemWidth, MinMenuItemHeight)); - + for(int i = 0; i < m_ButtonContainer->count(); i++) { Button* button = m_ButtonContainer->at(i); button->setBackground(pixmap); @@ -142,7 +142,7 @@ void Menu::keyPressEvent(QKeyEvent *event) Button* button = m_ButtonContainer->at(m_currentSelectedIndex); button->select(false); button->update(); - + m_currentSelectedIndex--; button = m_ButtonContainer->at(m_currentSelectedIndex); button->select(true); @@ -162,7 +162,7 @@ void Menu::keyPressEvent(QKeyEvent *event) } } } - + if(event->key() == 16777237 ) { //Down Arrow if (m_currentSelectedIndex < m_ButtonContainer->count()-1) { //One step down if(m_currentSelectedIndex >= 0) { @@ -187,15 +187,15 @@ void Menu::keyPressEvent(QKeyEvent *event) } } } - + if(event->key() == 17825792 || event->key() == 16842752 || //LSK, center key or enter - event->key() == 16777221 ) { + event->key() == 16777221 ) { if(m_currentSelectedIndex >= 0) { Button* button = m_ButtonContainer->at(m_currentSelectedIndex); button->click(); } } - + if(event->key() == 17825793 ) { //RSK menuShowHide(); } |