1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00

when scene toolbar gains focus, focus first button

This commit is contained in:
Marc Zinnschlag 2014-07-14 11:06:12 +02:00
parent c2ea8f3f0a
commit 688d413b8c
2 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,14 @@
#include "scenetool.hpp"
void CSVWidget::SceneToolbar::focusInEvent (QFocusEvent *event)
{
QWidget::focusInEvent (event);
if (mLayout->count())
dynamic_cast<QWidgetItem&> (*mLayout->itemAt (0)).widget()->setFocus();
}
CSVWidget::SceneToolbar::SceneToolbar (int buttonSize, QWidget *parent)
: QWidget (parent), mButtonSize (buttonSize), mIconSize (buttonSize-6)
{

View File

@ -17,6 +17,10 @@ namespace CSVWidget
int mButtonSize;
int mIconSize;
protected:
virtual void focusInEvent (QFocusEvent *event);
public:
SceneToolbar (int buttonSize, QWidget *parent = 0);