Commit e45de73f authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fixed focus change on TAB.

parent 2c95738b
...@@ -62,7 +62,7 @@ void QtScrollWidgetFlow::init(unsigned int eCtxType, ...@@ -62,7 +62,7 @@ void QtScrollWidgetFlow::init(unsigned int eCtxType,
int (*init_proc2)(QWidget* w, FlowCtx* ctx, void* client_data)) int (*init_proc2)(QWidget* w, FlowCtx* ctx, void* client_data))
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->init_proc = init_proc; this->init_proc = init_proc;
...@@ -81,7 +81,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType, ...@@ -81,7 +81,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType,
int (*init_proc2)(QWidget* w, FlowCtx* ctx, void* client_data)) int (*init_proc2)(QWidget* w, FlowCtx* ctx, void* client_data))
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->init_proc = init_proc; this->init_proc = init_proc;
...@@ -89,6 +89,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType, ...@@ -89,6 +89,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType,
this->client_data = client_data; this->client_data = client_data;
this->scroll_timerid = new QTimer(this); this->scroll_timerid = new QTimer(this);
form = new QScrollArea(); form = new QScrollArea();
form->setFocusPolicy(Qt::NoFocus);
form->installEventFilter(this); form->installEventFilter(this);
scroll_h = form->horizontalScrollBar(); scroll_h = form->horizontalScrollBar();
scroll_v = form->verticalScrollBar(); scroll_v = form->verticalScrollBar();
...@@ -113,7 +114,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType, ...@@ -113,7 +114,7 @@ QWidget* QtScrollWidgetFlow::initScroll(unsigned int eCtxType,
void QtScrollWidgetFlow::init(unsigned int eCtxType, QWidget* main) void QtScrollWidgetFlow::init(unsigned int eCtxType, QWidget* main)
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->scroll_timerid = new QTimer(this); this->scroll_timerid = new QTimer(this);
...@@ -289,8 +290,7 @@ void QtScrollWidgetFlow::realize() ...@@ -289,8 +290,7 @@ void QtScrollWidgetFlow::realize()
} else { } else {
draw_ctx = new FlowDrawQt(this, &parent_ctx, init_widget_proc, draw_ctx = new FlowDrawQt(this, &parent_ctx, init_widget_proc,
client_data, static_cast<flow_eCtxType>(ctxType)); client_data, static_cast<flow_eCtxType>(ctxType));
setFocus();
} }
} }
setFocus();
} }
\ No newline at end of file
...@@ -63,7 +63,7 @@ void QtScrollWidgetGlow::init(unsigned int eCtxType, ...@@ -63,7 +63,7 @@ void QtScrollWidgetGlow::init(unsigned int eCtxType,
int (*init_proc2)(QWidget* w, GlowCtx* ctx, void* client_data)) int (*init_proc2)(QWidget* w, GlowCtx* ctx, void* client_data))
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->init_proc = init_proc; this->init_proc = init_proc;
...@@ -82,7 +82,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType, ...@@ -82,7 +82,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType,
int (*init_proc2)(QWidget* w, GlowCtx* ctx, void* client_data)) int (*init_proc2)(QWidget* w, GlowCtx* ctx, void* client_data))
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->init_proc = init_proc; this->init_proc = init_proc;
...@@ -90,6 +90,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType, ...@@ -90,6 +90,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType,
this->client_data = client_data; this->client_data = client_data;
this->scroll_timerid = new QTimer(this); this->scroll_timerid = new QTimer(this);
form = new QScrollArea(); form = new QScrollArea();
form->setFocusPolicy(Qt::NoFocus);
form->installEventFilter(this); form->installEventFilter(this);
scroll_h = form->horizontalScrollBar(); scroll_h = form->horizontalScrollBar();
scroll_v = form->verticalScrollBar(); scroll_v = form->verticalScrollBar();
...@@ -114,7 +115,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType, ...@@ -114,7 +115,7 @@ QWidget* QtScrollWidgetGlow::initScroll(unsigned int eCtxType,
void QtScrollWidgetGlow::init(unsigned int eCtxType, QWidget* main) void QtScrollWidgetGlow::init(unsigned int eCtxType, QWidget* main)
{ {
createBuffer(size()); createBuffer(size());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true); setMouseTracking(true);
this->ctxType = eCtxType; this->ctxType = eCtxType;
this->scroll_timerid = new QTimer(this); this->scroll_timerid = new QTimer(this);
...@@ -291,8 +292,7 @@ void QtScrollWidgetGlow::realize() ...@@ -291,8 +292,7 @@ void QtScrollWidgetGlow::realize()
} else { } else {
draw_ctx = new GlowDrawQt(this, &parent_ctx, init_widget_proc, draw_ctx = new GlowDrawQt(this, &parent_ctx, init_widget_proc,
client_data, static_cast<glow_eCtxType>(ctxType)); client_data, static_cast<glow_eCtxType>(ctxType));
setFocus();
} }
} }
setFocus();
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment