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. is there good way to realize this CustomWidget?

is there good way to realize this CustomWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 1.3k 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    is there good way to realize this CustomWidget?
    0_1544164955488_微信截图_20181207144053.png

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Very difficult to answer this question ? What you would like to do ? Can you explain more ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu
        wrote on last edited by
        #3

        the picture is from photoshop.
        and simply say, it's a custom slider-bar, with gradient color and the color is changing while moving the slider.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4
          1. Write custom widget
          2. Re-implement paintEvent(..) method
          3. Write drawing instructions using QPainter to draw your slider.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          2
          • O Offline
            O Offline
            opengpu
            wrote on last edited by
            #5

            thanks.
            is there any good demo?
            and QPainter is enough to do this? no need to use QGraphicsView?
            and i want to make it a custom widget which can be registered into Qt Disigner and then it can be used as Qt intrinsic widget.

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6

              Can you look at the examples present in the Qt installation directory ?
              e.g <QtInstallDir>/Qt5.11.0/Examples/Qt-5.11.0/widgets.

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply
              0
              • O Offline
                O Offline
                opengpu
                wrote on last edited by
                #7

                yeh, i have it , and i dont know is there any demo that like this custom widget

                1 Reply Last reply
                0
                • dheerendraD Offline
                  dheerendraD Offline
                  dheerendra
                  Qt Champions 2022
                  wrote on last edited by
                  #8

                  You will not get example exactly what you want. You can look at the examples on how they are drawing custom widgets. Also you can look at store Custom Widgets

                  You need to look at examples & do things on your own.

                  Dheerendra
                  @Community Service
                  Certified Qt Specialist
                  http://www.pthinks.com

                  1 Reply Last reply
                  1
                  • O Offline
                    O Offline
                    opengpu
                    wrote on last edited by opengpu
                    #9

                    thank you.but woops, i am using Windows.

                    1 Reply Last reply
                    0
                    • dheerendraD Offline
                      dheerendraD Offline
                      dheerendra
                      Qt Champions 2022
                      wrote on last edited by dheerendra
                      #10

                      i am using Windows.lol

                      Did not understand your last comment. What do you mean by I'm using windows ? How is it related here ? & what is the context of 'lol' ?

                      Dheerendra
                      @Community Service
                      Certified Qt Specialist
                      http://www.pthinks.com

                      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