• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IJHack / QtPass / 24966395320
55%

Build:
DEFAULT BRANCH: main
Ran 26 Apr 2026 08:37PM UTC
Jobs 1
Files 72
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Apr 2026 08:32PM UTC coverage: 27.593% (-0.03%) from 27.622%
24966395320

push

github

web-flow
fix: resolve focusInput's QLineEdit through findChild to survive widget rebuild (#1190)

A SIGSEGV on first launch was still reproducible after #1187 + #1188:

  $ ./main/qtpass
  Segmentation fault (core dumped)
  #0 QWidget::testAttribute
  #1 QWidget::isVisible
  #2 MainWindow::focusInput
  #3 MainWindow::changeEvent
  ...
  #7 QApplicationPrivate::setActiveWindow

Root cause traced with progressive fprintf probes:

- `this` (MainWindow) is valid and visible.
- `ui->lineEdit` is non-null but points at freed memory.
- `findChild<QLineEdit*>("lineEdit")` returns nullptr — the
  QLineEdit is no longer a child of MainWindow.

The destruction happens during the constructor's
`m_qtPass->init()` -> `MainWindow::config()` ->
`applyWindowFlagsSettings()` path, which runs
`setWindowFlags(...)` + `show()` on the main window. On Qt 6.11
that sequence rebuilds the native window via
`setParent(nullptr, flags)` and the QLineEdit attached to the
centralWidget gets recreated with a different underlying object,
leaving the cached `ui->lineEdit` pointer dangling.

Fix focusInput to look up the live widget by object name
(`findChild<QLineEdit*>("lineEdit")`) instead of trusting the
cached pointer. If the lookup returns nullptr (post-rebuild,
mid-init, etc.) focusInput becomes a safe no-op rather than a
use-after-free. Also:

- Add a first-time `showEvent()` hook that schedules focusInput
  via a queued invokeMethod, replacing the historic
  `QTimer::singleShot(10, this, SLOT(focusInput()))` in the
  constructor — show is the natural point at which the widget
  hierarchy has settled.
- In `changeEvent`, also defer focusInput via queued invokeMethod
  and require both `isActiveWindow()` and `isVisible()` so the
  ActivationChange dispatched from `activateWindow()` before
  `show()` does not run focusInput inline against a not-yet-
  realised hierarchy.

Verified locally: 8 consecutive fresh-launch attempts (timeout 3 s
each, alternating first-instance / sendMessage) pro... (continued)

0 of 13 new or added lines in 1 file covered. (0.0%)

2 existing lines in 1 file now uncovered.

1825 of 6614 relevant lines covered (27.59%)

26.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
13
0.0
0.0% src/mainwindow.cpp

Coverage Regressions

Lines Coverage ∆ File
2
0.0
0.0% src/mainwindow.cpp
Jobs
ID Job ID Ran Files Coverage
1 24966395320.1 26 Apr 2026 08:37PM UTC 72
27.59
GitHub Action Run
Source Files on build 24966395320
  • Tree
  • List 72
  • Changed 4
  • Source Changed 4
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24966395320
  • 9e1cd409 on github
  • Prev Build on main (#24964110488)
  • Next Build on main (#24966775936)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc