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. can we place a widget over a pushbutton
Forum Updated to NodeBB v4.3 + New Features

can we place a widget over a pushbutton

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 563 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.
  • M Offline
    M Offline
    ManiRon28
    wrote on last edited by
    #1

    I want to place a QCustomplot widget over a pushbutton , and i want to highlight the pushbutton when pressed over the widget . This is an unique requirement kindly help in solving this problem. Or can we make the transparent and when the transparent button is i want to highlight the border of pushbutton , Is this possible ?

    Pl45m4P 1 Reply Last reply
    0
    • M ManiRon28

      I want to place a QCustomplot widget over a pushbutton , and i want to highlight the pushbutton when pressed over the widget . This is an unique requirement kindly help in solving this problem. Or can we make the transparent and when the transparent button is i want to highlight the border of pushbutton , Is this possible ?

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

      @maniron28

      What do you expect from doing this?

      I think, the plot is larger than the button, so it would hide the button completely.

      If it's all about the button press / click event, you could use the mousePress-Event from your QCustomPlot instead.


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

      ~E. W. Dijkstra

      M 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @maniron28

        What do you expect from doing this?

        I think, the plot is larger than the button, so it would hide the button completely.

        If it's all about the button press / click event, you could use the mousePress-Event from your QCustomPlot instead.

        M Offline
        M Offline
        ManiRon28
        wrote on last edited by
        #3

        @pl45m4 actually i will be have three to for such widget, My requirement is that i want to highlight the widget which is being selected by the user

        Pl45m4P 1 Reply Last reply
        0
        • M ManiRon28

          @pl45m4 actually i will be have three to for such widget, My requirement is that i want to highlight the widget which is being selected by the user

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

          @maniron28 said in can we place a widget over a pushbutton:

          My requirement is that i want to highlight the widget which is being selected by the user

          "Selected" in which way? You dont need a PushButton for this. You can draw a border around your widget (with stylesheet for example).


          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
          • M Offline
            M Offline
            MrShawn
            wrote on last edited by
            #5

            Set the pushbutton to be the parent of your widget. See if that adds the widget onto your pushbutton.

            M 1 Reply Last reply
            0
            • M MrShawn

              Set the pushbutton to be the parent of your widget. See if that adds the widget onto your pushbutton.

              M Offline
              M Offline
              ManiRon28
              wrote on last edited by
              #6

              @mrshawn said in can we place a widget over a pushbutton:

              Set the pushbutton to be the parent of your widget

              How to do this, is there any sample programs available.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MrShawn
                wrote on last edited by
                #7

                You can set the parent of your object or widget with the constructor.

                https://doc.qt.io/qt-5/qwidget.html#QWidget
                take a second to read what the constructor says about the parent argument.

                MyWidget *myWidgetPtr = new MyWidget(pushBtnPtr);
                
                1 Reply Last reply
                1

                • Login

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