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. [SOLVED] QColorDialog
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QColorDialog

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.7k 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.
  • Q Offline
    Q Offline
    QMartin
    wrote on last edited by
    #1

    Hello guys

    I've seen "QColorDialog":http://qt-project.org/doc/qt-4.8/qcolordialog.html#details documentation and I would like to show in a widget, permanently, the colour box with the colour slider. Is this possible? I've read through qcolordialog.cpp but cannot find where this widget is created. I'd prefer this than showing a permanent dialog.

    Any ideas? Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on last edited by
      #2

      You can call show on it, and with setting the proper windows flags you can remove all the window styling you don't want.

      1 Reply Last reply
      0
      • U Offline
        U Offline
        utcenter
        wrote on last edited by
        #3

        Building a color picker is actually a straightforward process your own application could benefit significantly by tailoring it to your specific needs. The one, provided by Qt dates back to the last century, and I myself would never use it outside of a quick testing scenario.

        Just draw a rect, fill it with varying colors in a loop according to its current dimensions, create a signal that gets the click coordinates and extrapolates out of those the color values based on the picker size and connect that to your setColor() or something slot in the parent widget.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QMartin
          wrote on last edited by
          #4

          Ok, thanks guys. Both work!

          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