Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    2
    3
    3402
    Loading More Posts
    • 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
      Kimbs last edited by

      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 Reply Quote 0
      • A
        andre last edited by

        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 Reply Quote 1
        • K
          Kimbs last edited by

          Thanks :) That worked nicely!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post