Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to press a button, keep it pressed and when I press it the 2nd time to be unpressed
Forum Updated to NodeBB v4.3 + New Features

How to press a button, keep it pressed and when I press it the 2nd time to be unpressed

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 529 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.
  • J Offline
    J Offline
    john_hobbyist
    wrote on last edited by john_hobbyist
    #1

    I don't know how to search it in google. So, I need to make an small button, with an icon on it. When I press the button it should give me a flag = 1 so that I will be able to run qrubberband. When I choose an area with rqrubberband I need to press again the icon button in order to be able to activate it next time I press it. I mean, while I press it to be kept pressed and when I press it again to be in its initial state.

    J.HilkJ 1 Reply Last reply
    0
    • J john_hobbyist

      I don't know how to search it in google. So, I need to make an small button, with an icon on it. When I press the button it should give me a flag = 1 so that I will be able to run qrubberband. When I choose an area with rqrubberband I need to press again the icon button in order to be able to activate it next time I press it. I mean, while I press it to be kept pressed and when I press it again to be in its initial state.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @john_hobbyist
      you can take a standard QPushButton and set the checkable property to true
      https://doc.qt.io/qt-5/qabstractbutton.html#checkable-prop

      than you get the toggled signal, when the user toggles the button :D
      https://doc.qt.io/qt-5/qabstractbutton.html#checked-prop


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      3
      • J Offline
        J Offline
        john_hobbyist
        wrote on last edited by
        #3
        This post is deleted!
        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