time_first_hbox = QtGui.QHBoxLayout()
start_rbtn = QtGui.QRadioButton("Start")
min_rbtn = QtGui.QRadioButton("Min")
min_rbtn.setChecked(True)
time_first_hbox.addWidget(start_rbtn)
time_first_hbox.addWidget(min_rbtn)
time_last_hbox = QtGui.QHBoxLayout()
end_rbtn = QtGui.QRadioButton("End")
max_rbtn = QtGui.QRadioButton("Max")
max_rbtn.setChecked(True)
time_last_hbox.addWidget(end_rbtn)
time_last_hbox.addWidget(max_rbtn)
options_time_hbox = QtGui.QHBoxLayout()
options_time_hbox.addLayout(time_first_hbox)
options_time_hbox.addLayout(time_last_hbox)
See http://doc.qt.io/qt-5/qradiobutton.html#details
Radio buttons are autoExclusive by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.
Looks like you’ll need two “groups”.
I would also like to add on that (unable to edit the post), if I clicked on the option - "Max", it will gets unchecked, and only 1 radio button selection can only be made thereafter..
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ed1782d9-0dc5-4dbb-9d31-45d6ad48872f%40googlegroups.com.
See http://doc.qt.io/qt-5/qradiobutton.html#details
Radio buttons are autoExclusive by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.
Looks like you’ll need two “groups”.
On 17 July 2018 at 18:13, yann19 <yang...@gmail.com> wrote:
I would also like to add on that (unable to edit the post), if I clicked on the option - "Max", it will gets unchecked, and only 1 radio button selection can only be made thereafter..
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
Alternatively, instead of two layouts, parent them to two widgets, each with their own layout, and put the two widgets in a third layout.
On 17 July 2018 at 18:20, Marcus Ottosson <konstr...@gmail.com> wrote:
See http://doc.qt.io/qt-5/qradiobutton.html#details
Radio buttons are autoExclusive by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.
Looks like you’ll need two “groups”.
On 17 July 2018 at 18:13, yann19 <yang...@gmail.com> wrote:
I would also like to add on that (unable to edit the post), if I clicked on the option - "Max", it will gets unchecked, and only 1 radio button selection can only be made thereafter..
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ed1782d9-0dc5-4dbb-9d31-45d6ad48872f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODzwGdymXZVfKeOdu0o0cLvmRTGGS7NvSvrQF%2BYF3rfTg%40mail.gmail.com.
On Wed, Jul 18, 2018, 5:21 AM Marcus Ottosson <konstr...@gmail.com> wrote:Alternatively, instead of two layouts, parent them to two widgets, each with their own layout, and put the two widgets in a third layout.I like your suggestion of using QButtonGroup as opposed to managing it by layout and parent. A group is more explicit about the logic and is the way I always go.
On 17 July 2018 at 18:20, Marcus Ottosson <konstr...@gmail.com> wrote:
See http://doc.qt.io/qt-5/qradiobutton.html#details
Radio buttons are autoExclusive by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.
Looks like you’ll need two “groups”.
On 17 July 2018 at 18:13, yann19 <yang...@gmail.com> wrote:
I would also like to add on that (unable to edit the post), if I clicked on the option - "Max", it will gets unchecked, and only 1 radio button selection can only be made thereafter..
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ed1782d9-0dc5-4dbb-9d31-45d6ad48872f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.