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. Scalable buttons
Forum Updated to NodeBB v4.3 + New Features

Scalable buttons

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.3k 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.
  • P Offline
    P Offline
    potla11
    wrote on last edited by
    #1

    hi...please some one help me i have 10 buttons in a column Is there any way to boom up when the button pressed..i.e increase the size or changing colour property like any thing it may be that button should have to be different from other buttons....

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      Hello.
      Consider using checkable buttons (void QAbstractButton::setCheckable(bool)).
      Or you can connect every button to a slot similar to this:
      @void MyClass::onButtonPressed()
      {
      QPushButton* button = qobject_cast< QPushButton* >( sender() );
      if( !button )
      return;
      button->setStyleSheet( "background-color: red;" );
      }@

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Just setting it checkable should already give a different look, in a standard way.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          potla11
          wrote on last edited by
          #4

          it's very nice thank u so much...but small problem happened i have 10 buttons when i clicked on this button it shows red colur ... if i click on the other button the previous button should have to show the normal colour...

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            Make the buttons exclusive by putting them in a QButtonGroup.

            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