Profile Picture

Python: Case of the missing slider

Posted By videodv Last Month
You don't have permission to rate!
Author
Message
videodv
videodv
Posted Last Month
View Quick Profile
Veteran Member

Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 156, Visits: 3.9K
Hi
After trying out the Create You Own UI example in the Python API examples, I have found after putting a QSlider into the code it wil not show?

https://forum.reallusion.com/uploads/images/b3f033ba-80c9-463b-a8ca-46fb.jpg

Anyone else found this.
This is the code that I am using

    ########################
    # Cant see the slider? #
    ########################
    some_slider = QtWidgets.QSlider()
    some_slider.setValue(1)
    some_slider.setMinimum(0)
    some_slider.setMaximum(99)
    sample_layout.addWidget(some_slider)

Regards
Chris.

Here is the link to the example
Edited
Last Month by videodv
jlittle
jlittle
Posted Last Month
View Quick Profile
Distinguished Member

Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)

Group: Forum Members
Last Active: 30 minutes ago
Posts: 1.5K, Visits: 11.5K
I believe you forgot to specify the orientation:
some_slider = QSlider(Qt.Horizontal)
or
some_slider = QSlider()
some_slider.setOrientation(Qt.Horizontal)


Jeff




See my CTA Tutorials on the YouTube channel CTAStepByStep
Check out EZColors for CTA. The easy way to change Render Styled (RS) colors.

videodv
videodv
Posted Last Month
View Quick Profile
Veteran Member

Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 156, Visits: 3.9K
jlittle (1/21/2019)
I believe you forgot to specify the orientation:
some_slider = QSlider(Qt.Horizontal)
or
some_slider = QSlider()
some_slider.setOrientation(Qt.Horizontal)


Jeff



Hi jlittle

tried both of those and it still will not show

Chris.
videodv
videodv
Posted Last Month
View Quick Profile
Veteran Member

Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 156, Visits: 3.9K
jlittle (1/21/2019)
I believe you forgot to specify the orientation:
some_slider = QSlider(Qt.Horizontal)
or
some_slider = QSlider()
some_slider.setOrientation(Qt.Horizontal)


Jeff



You was correct but I forgot to put at the top 
from PySide2.QtCore import Qt

Regards
Chris.
videodv
videodv
Posted Last Month
View Quick Profile
Veteran Member

Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)Veteran Member (666 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 156, Visits: 3.9K
Many Thanks jlittle
Chris
jlittle
jlittle
Posted Last Month
View Quick Profile
Distinguished Member

Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)

Group: Forum Members
Last Active: 30 minutes ago
Posts: 1.5K, Visits: 11.5K
videodv (1/21/2019)
... I forgot to put at the top: from PySide2.QtCore import Qt

Hehe yes, that always helps.

Don't forget to look at the python "console log" for error messages which can help narrow down issues.

Jeff


See my CTA Tutorials on the YouTube channel CTAStepByStep
Check out EZColors for CTA. The easy way to change Render Styled (RS) colors.




Reading This Topic