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

[Macintosh]QStyle::drawPrimitive(PE_FrameFocusRect, ...) doesn't draw anything on Macintosh

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.6.1
    • None
    • Mac OS X, Qt 5.6.1
    • macOS

    Description

      I wanted to draw a focus ring on my custom controls on a Macintosh. So I naively used QStyle::drawPrimitive(PE_FrameFocusRect, ...) to do it based on the documentation for QStyle. It didn't draw anything.

      Tracing into the code to figure out why, I find this in QMacStyle::drawPrimitive() (qmacstyle_mac.cpp):

          case PE_FrameFocusRect:
              // Use the our own focus widget stuff.
              break;
      

      In the QStyle documentation, under the heading "Developing Style-Aware Custom Widgets" the example code is drawing a focus rectangle!

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            johnweeks John Weeks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes