Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt Creator Toggle PushButton
erm15 last edited by
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.
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.
goblincoding last edited by
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! :)