Commit 91cac3e0 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: navigator widgets now grab focus when realized.

parent 5289da6c
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include "wb_wpkg_qt.h" #include "wb_wpkg_qt.h"
#include "wb_wtt_qt.h" #include "wb_wtt_qt.h"
#include <QApplication>
#include <QCloseEvent> #include <QCloseEvent>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QInputDialog> #include <QInputDialog>
...@@ -2292,6 +2293,11 @@ WttQt::WttQt(void* wt_parent_ctx, const char* wt_name, const char* iconname, ...@@ -2292,6 +2293,11 @@ WttQt::WttQt(void* wt_parent_ctx, const char* wt_name, const char* iconname,
pwr_mPrv_DevConfig | pwr_mPrv_DevPlc | pwr_mPrv_DevClass); pwr_mPrv_DevConfig | pwr_mPrv_DevPlc | pwr_mPrv_DevClass);
} }
// setFocus() doesn't work since QApplication has not entered its
// main loop yet. Instead, add an event to the event queue and let
// QApplication process it later when it enters the main loop.
QApplication::sendEvent(toplevel, new QFocusEvent(QEvent::FocusIn));
*status = 1; *status = 1;
} }
...@@ -2532,4 +2538,4 @@ void WttQt::disable_focus() ...@@ -2532,4 +2538,4 @@ void WttQt::disable_focus()
void WttQt::update_title() void WttQt::update_title()
{ {
CoWowQt::update_title(toplevel, editmode); CoWowQt::update_title(toplevel, editmode);
} }
\ No newline at end of file
...@@ -291,4 +291,5 @@ void QtScrollWidgetFlow::realize() ...@@ -291,4 +291,5 @@ void QtScrollWidgetFlow::realize()
client_data, static_cast<flow_eCtxType>(ctxType)); client_data, static_cast<flow_eCtxType>(ctxType));
} }
} }
} setFocus();
\ No newline at end of file }
...@@ -293,4 +293,5 @@ void QtScrollWidgetGlow::realize() ...@@ -293,4 +293,5 @@ void QtScrollWidgetGlow::realize()
client_data, static_cast<glow_eCtxType>(ctxType)); client_data, static_cast<glow_eCtxType>(ctxType));
} }
} }
} 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