Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can one unset a widget attribute such as Qt::WA_MacShowFocusRect globally?
Forum Updated to NodeBB v4.3 + New Features

Can one unset a widget attribute such as Qt::WA_MacShowFocusRect globally?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kimbs
    wrote on last edited by
    #1

    I'm creating a gui for use on os x and one of the most annoying features of the QMacStyle is the mac focus frame.

    I unset this attribute for every widget i use, but its getting annoying to do and especially when using composite widgets such as QTabWidget that is comprised of several child widgets.

    Can it be unset globally? Or perhaps for all child widgets of a widget?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      No, but you can use some simple code to disable for all your widgets.

      For all your top-level windows, do something like this:

      @
      QWidgetList widgets = myTopLevelWidget->findChildren<QWidget*>();
      foreach(QWidget* widget, widgets)
      //unset your flag
      @

      Access to all top level widgets can be gotten from QApplication.

      1 Reply Last reply
      1
      • K Offline
        K Offline
        Kimbs
        wrote on last edited by
        #3

        Thanks :) That worked nicely!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved