Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QColorDialog.setCurrentColor doesn't set currentColor. pyside6

QColorDialog.setCurrentColor doesn't set currentColor. pyside6

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 583 Views
  • 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.
  • Q Offline
    Q Offline
    qAminzzz
    wrote on last edited by
    #1

    my code:

    @Slot(result=str)   
        def openColorDialog(self):
            color = QColorDialog()
            color.setCurrentColor(Qt.red) 
            print(color.getColor().name())
            return ""
    

    console output:
    #ffffff

    thanks in advance

    jsulmJ 1 Reply Last reply
    0
    • jsulmJ jsulm

      @qAminzzz said in QColorDialog.setCurrentColor doesn't set currentColor. pyside6:

      getColor()

      getColor() is a static method

      Q Offline
      Q Offline
      qAminzzz
      wrote on last edited by
      #3

      @jsulm
      thank you
      i used

      QColorDialog.getColor(previousColor, None, "", QColorDialog.ColorDialogOptions())

      and now that's working well

      1 Reply Last reply
      0
      • Q qAminzzz

        my code:

        @Slot(result=str)   
            def openColorDialog(self):
                color = QColorDialog()
                color.setCurrentColor(Qt.red) 
                print(color.getColor().name())
                return ""
        

        console output:
        #ffffff

        thanks in advance

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @qAminzzz said in QColorDialog.setCurrentColor doesn't set currentColor. pyside6:

        getColor()

        getColor() is a static method

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        1
        • jsulmJ jsulm

          @qAminzzz said in QColorDialog.setCurrentColor doesn't set currentColor. pyside6:

          getColor()

          getColor() is a static method

          Q Offline
          Q Offline
          qAminzzz
          wrote on last edited by
          #3

          @jsulm
          thank you
          i used

          QColorDialog.getColor(previousColor, None, "", QColorDialog.ColorDialogOptions())

          and now that's working well

          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