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. Gradient Picker, how?!
Forum Updated to NodeBB v4.3 + New Features

Gradient Picker, how?!

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 1.6k Views 3 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.
  • K Offline
    K Offline
    Kris Revi
    wrote on last edited by
    #1

    is there any tutorials on how to make a Gradient Picker GUI? where i can add / remove positions and edit each color in each position and save gradient palette and open / load gradient palette!

    is there any tutorials at all? i've googled for 1 hour now but with no luck!

    ODБOïO 1 Reply Last reply
    0
    • K Kris Revi

      is there any tutorials on how to make a Gradient Picker GUI? where i can add / remove positions and edit each color in each position and save gradient palette and open / load gradient palette!

      is there any tutorials at all? i've googled for 1 hour now but with no luck!

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #2

      @Kris-Revi hi
      I don't know any tutorial about that but here is an example that shows how to dynamically edit the gradient
      https://stackoverflow.com/questions/36049068/how-to-dynamically-add-stops-in-a-gradient
      You can then save/load the values to/from a text file

      [EDIT] i thought it's in QML

      K 1 Reply Last reply
      0
      • ODБOïO ODБOï

        @Kris-Revi hi
        I don't know any tutorial about that but here is an example that shows how to dynamically edit the gradient
        https://stackoverflow.com/questions/36049068/how-to-dynamically-add-stops-in-a-gradient
        You can then save/load the values to/from a text file

        [EDIT] i thought it's in QML

        K Offline
        K Offline
        Kris Revi
        wrote on last edited by
        #3

        @LeLev hehe np!

        Like this would be awsome! but google / github / stackoverflow = nothing in searching :/
        4c4b9ecd-bb1d-46de-a897-c227ac217c0b-image.png

        JonBJ Pl45m4P 2 Replies Last reply
        0
        • K Kris Revi

          @LeLev hehe np!

          Like this would be awsome! but google / github / stackoverflow = nothing in searching :/
          4c4b9ecd-bb1d-46de-a897-c227ac217c0b-image.png

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Kris-Revi
          Is https://www.codeproject.com/Articles/5267129/Gradient-Color-Picker any good?

          Since it's in my favorite C#, it should be a doddle to convert to C++ :-) And hopefully to adapt to Qt. Worth a look at least for a schema of code already written?

          K 1 Reply Last reply
          2
          • JonBJ JonB

            @Kris-Revi
            Is https://www.codeproject.com/Articles/5267129/Gradient-Color-Picker any good?

            Since it's in my favorite C#, it should be a doddle to convert to C++ :-) And hopefully to adapt to Qt. Worth a look at least for a schema of code already written?

            K Offline
            K Offline
            Kris Revi
            wrote on last edited by
            #5

            @JonB im in no way an expert here and this is way out of my field! :/

            JonBJ 1 Reply Last reply
            0
            • K Kris Revi

              @JonB im in no way an expert here and this is way out of my field! :/

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @Kris-Revi
              How do you mean? Translating C# into C++? Easy :) IMHO. I thought it looked like just what you wanted. Couldn't find anything else, desktop.

              1 Reply Last reply
              1
              • K Kris Revi

                @LeLev hehe np!

                Like this would be awsome! but google / github / stackoverflow = nothing in searching :/
                4c4b9ecd-bb1d-46de-a897-c227ac217c0b-image.png

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote on last edited by
                #7

                @Kris-Revi

                You can create such Gradient picker easily with some subclassing and some color magic :)
                If I were you, I would consider to build one myself, if you are planning to use it more than once


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                K 1 Reply Last reply
                2
                • Pl45m4P Pl45m4

                  @Kris-Revi

                  You can create such Gradient picker easily with some subclassing and some color magic :)
                  If I were you, I would consider to build one myself, if you are planning to use it more than once

                  K Offline
                  K Offline
                  Kris Revi
                  wrote on last edited by
                  #8

                  @Pl45m4 it's easy to say that! but im a beginner at best :/ never touched QGradient / QPainter!

                  Pl45m4P 1 Reply Last reply
                  1
                  • K Kris Revi

                    @Pl45m4 it's easy to say that! but im a beginner at best :/ never touched QGradient / QPainter!

                    Pl45m4P Offline
                    Pl45m4P Offline
                    Pl45m4
                    wrote on last edited by
                    #9

                    @Kris-Revi

                    QGradient has a very detailed documentation.

                    • https://doc.qt.io/qt-5/qgradient.html

                    Create a custom widget, play around with QGradient and add input widgets (some kind of sliders or whatsever you want to do) to set the QGradientStops.


                    If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                    ~E. W. Dijkstra

                    1 Reply Last reply
                    1
                    • mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Hi
                      Just as a note.
                      The example is kinda a picker
                      https://doc.qt.io/qt-5/qtwidgets-painting-gradients-example.html

                      There is also the build-in editor
                      alt text
                      but not sure in what files it lives or if it can be reused easily.

                      1 Reply Last reply
                      3

                      • Login

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