Important: Please read the Qt Code of Conduct -

Qt Creator Toggle PushButton

  • 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 or

    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.





    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?

  • 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": will get you going! :)

Log in to reply