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

Second and subsequent QTextEdit.setPalette() calls are ignored

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 4.8.2, 4.8.3, 4.8.4, 4.8.5
    • Fix Version/s: None
    • Component/s: GUI: Painting
    • Labels:
      None
    • Environment:
      Windows 7 & Linux with Python 3 & PySide 1.1.1 on Linux and 1.2.2 on Windows.

      Description

      When I start up my PySide application I call this method:

      def changeBackground(self, bg):
      palette = self.lineEdit.palette()
      palette.setBrush(QPalette.Base, QBrush(bg))
      self.lineEdit.setPalette(palette)
      palette = self.textEdit.palette()
      palette.setBrush(QPalette.Base, QBrush(bg))
      palette.setBrush(QPalette.Window, QBrush(bg))
      self.textEdit.setPalette(palette)

      bg is a QColor or a QPixmap; self.lineEdit is a QLineEdit and self.textEdit is a QTextEdit.

      This works the first time I call it.

      But the second and subsequent times I call it, it works correctly for the QLineEdit; but has no effect on the QTextEdit. I have tried setting autofillbackground on and off and it has no effect.

        Attachments

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

          Activity

            People

            Assignee:
            sletta Gunnar Sletta
            Reporter:
            m.n.summerfield Mark Summerfield
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes