I am a newbie to QT. I'm using the Qt Designer to create a ui file then writing Python code to make things happen. I have a QSlider, and in the python code I can act when the value of the slider changes with this:
widget = QWidget()
widget.mySlider.valueChanged[int].connect(myChangeMethod)
or I use this to access the value of the QSlider
widget.mySlider.value()
If I add a QGroupBox around the QSlider, then I cannot slide the QSlider in the GUI. When surrounded by a QGroupBox, how can I do get QSliders to work meaning I can move the slider and use .valueChanged or .value() in my code?
Thanks in advance!
UPDATE: Here is the .ui file:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QSlider" name="mySlider">
<property name="geometry">
<rect>
<x>90</x>
<y>100</y>
<width>221</width>
<height>16</height>
</rect>
</property>
<property name="toolTip">
<string>No Comment</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>0</x>
<y>20</y>
<width>381</width>
<height>171</height>
</rect>
</property>
<property name="title">
<string>MyGroup</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>