Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Doubts about #setAutoFillBackground
Forum Updated to NodeBB v4.3 + New Features

Doubts about #setAutoFillBackground

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 2 Posters 556 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.
  • J Offline
    J Offline
    JaderoChan
    wrote on last edited by
    #1

    [MT Text]
    I have seen that this function can be used to determine whether the caller's background color is affected by its parent window, but I wonder why a name like setAutoFillBackground that seems to have nothing to do with the function is used? Is it about window rendering or is it just a representation of this function?
    Lastly, if the above statement is correct, then when autoFillBackground is set to true, does the caller completely ignore the QSS and the QPalette of the parent window, the Qss of the QPalette and the QSS of the qApp?

    [Source Text]
    我曾看到过一个说法:这个函数可以用来决定调用者的背景颜色是否受其父窗口影响,然而我不解的是为什么使用setAutoFillBackground这样一个看起来和功能毫无关系的名称?是关于窗口渲染方面的还是说上面那种说法仅仅只是这个函数的表现之一?
    最后,我想明白如果上面那种说法是正确的,那么请问当autoFillBackground设置为true时,调用者是完全忽视了父窗口的QSS、QPalette和qApp的Qss、QPalette吗?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Not really no, that property determines whether the background of the widget shall be filled before painting on it happens.
      There are some rules and constraints for it though.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Not really no, that property determines whether the background of the widget shall be filled before painting on it happens.
        There are some rules and constraints for it though.

        J Offline
        J Offline
        JaderoChan
        wrote on last edited by
        #3

        @SGaist
        I seem get, and turn off this property of all top-level window and dialog is invalid (because them always need filled the background) that is right?
        Last, this property always be turn off when the widget has custom background (image or color...) or the widget has some specify window flags (e.g. WA_TranslucentBackground), am i right?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The documentation is quite clear: by default this property is false.
          There's no reason to pre-fill the background if you are going to fully paint it anyway.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • J JaderoChan has marked this topic as solved on

          • Login

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