Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator Toggle PushButton
Forum Updated to NodeBB v4.3 + New Features

Qt Creator Toggle PushButton

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 3.5k 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.
  • E Offline
    E Offline
    erm15
    wrote on last edited by
    #1

    Hi all,

    I am new to Qt Creator. I would like to create 3 vertical buttons to toggle between the display of lists. For example, showing a list of colors as blue, red, and yellow, as opposed to program.blue or program.red.

    What may be the best way to go about doing this?

    I think that I should use the PushButton widget and connect the three so that only one list format shows at a time, and then use a connect function to show when a button is clicked.

    Thanks!

    Best,

    erm15

    Edit***

    I was able to make the buttons appear, but I cannot do anything with them except for click them. This is because something is not set up correctly in my actions editor or my signals & slots editor but I am not sure how to use them. I have set up both for each corresponding button but no luck.

    Any ideas?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      Hi erm15.

      Welcome to Qt :)

      With no code to go on, I suggest you read up on signals and slots (it seems that you already have, but it looks like you haven't connected the buttons' output signals to your processing slots).

      Also important is layouts and for your particular case, I suggest you have a look at QButtonGroup (if you need buttons to be exclusive in case they are checkable).

      Hopefully "this":http://qt-project.org/doc/qt-4.8/how-to-learn-qt.html will get you going! :)

      http://www.goblincoding.com

      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