Skip to content

Commit

Permalink
Enable focus-related events on Qt
Browse files Browse the repository at this point in the history
Qt's widget focus handling can be a bit tricky. Recent architectural
changes related to the file list broke it, and these changes are
required to get it working again.
  • Loading branch information
Colin Ward authored and hitman-codehq committed Apr 22, 2024
1 parent 2ca9a07 commit 10cba2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Qt/QtWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ CQtWindow::CQtWindow(CWindow *a_poWindow, QSize &a_roSize)
{
m_poWindow = a_poWindow;
m_oSize = a_roSize;

/* Disable tabbing between widgets that are dynamically laid out */

setFocusPolicy(Qt::NoFocus);
}

/**
Expand Down
6 changes: 6 additions & 0 deletions StdWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2633,6 +2633,12 @@ TInt CWindow::open(const char *a_pccTitle, const char *a_pccScreenName, TBool a_

m_poWindow->showMaximized();

/* Showing the window doesn't necessarily give it focus, even if keyboard input to the window is */
/* working, meaning that the window won't get focus-related events. Explicitly setting the focus */
/* to the window shouldn't be necessary, but seems to be required to enable these events to be sent */

m_poWindow->setFocus();

/* Save the outer width and height of the window */

Size = m_poWindow->size();
Expand Down

0 comments on commit 10cba2a

Please sign in to comment.