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 12 Nov 2020, 15:26 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!

    O 1 Reply Last reply 12 Nov 2020, 16:24
    0
    • K Kris Revi
      12 Nov 2020, 15:26

      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!

      O Offline
      O Offline
      ODБOï
      wrote on 12 Nov 2020, 16:24 last edited by ODБOï 11 Dec 2020, 16:32
      #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 12 Nov 2020, 17:31
      0
      • O ODБOï
        12 Nov 2020, 16:24

        @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 12 Nov 2020, 17:31 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

        J P 2 Replies Last reply 12 Nov 2020, 17:45
        0
        • K Kris Revi
          12 Nov 2020, 17:31

          @LeLev hehe np!

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

          J Offline
          J Offline
          JonB
          wrote on 12 Nov 2020, 17:45 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 12 Nov 2020, 20:35
          2
          • J JonB
            12 Nov 2020, 17:45

            @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 12 Nov 2020, 20:35 last edited by
            #5

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

            J 1 Reply Last reply 12 Nov 2020, 21:58
            0
            • K Kris Revi
              12 Nov 2020, 20:35

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

              J Offline
              J Offline
              JonB
              wrote on 12 Nov 2020, 21:58 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
                12 Nov 2020, 17:31

                @LeLev hehe np!

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

                P Offline
                P Offline
                Pl45m4
                wrote on 13 Nov 2020, 00:10 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 13 Nov 2020, 10:52
                2
                • P Pl45m4
                  13 Nov 2020, 00:10

                  @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 13 Nov 2020, 10:52 last edited by
                  #8

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

                  P 1 Reply Last reply 14 Nov 2020, 11:49
                  1
                  • K Kris Revi
                    13 Nov 2020, 10:52

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

                    P Offline
                    P Offline
                    Pl45m4
                    wrote on 14 Nov 2020, 11:49 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 14 Nov 2020, 12:04 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

                      1/10

                      12 Nov 2020, 15:26

                      • Login

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