Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134691

Qt does not handle the nullptr for hasFocus()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.5.7
    • Widgets: Main Window
    • None
    • RHEL 8.10
      Edition: Windows 10 2021 LTSC Enterprise Edition 64 bit - version 21H2 - OS build 19044.5371
    • Linux/X11, Windows

    Description

      as nullptr exceptions are not handled for hasFocus(), it can lead to crashes 

      it requires the nullptr handling to be implemented by us 

      what happens is: 

      sometimes the widget is not properly initialized & still we try to set the focus which goes to hasFocus() in the flow 

       

      you will find below the stack trace we get in such case (when the null pointer exception happens): 

      Stack Trace: ACCESS_VIOLATION 
      QWidget::hasFocus:0
      QAccessibleWidget::focusChild:0
      QAccessibleWidget::focusChild:0
      qt_plugin_query_metadata_v2:0
      QAccessible::updateAccessibility:0
      QWidgetRepaintManager::updateStaticContentsSize:0
      QApplicationPrivate::notify_helper:0
      QApplication::notify:0 

       

      note: the red strikedthough area is to hide reference to our code/product 

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            gerald_chartier Gérald CHARTIER
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes