Difference between revisions of "IC Python API:Float Slider"

From Reallusion Wiki!
Jump to: navigation, search
m
m
Line 2: Line 2:
 
{{Parent|IC_Python_API:RL_Python_Samples|RL Python Samples}}
 
{{Parent|IC_Python_API:RL_Python_Samples|RL Python Samples}}
  
[[File:Ic_python_api_float_slider_01.png|frame|The slider and the spin-box are inter-related. ]]
+
[[File:Ic_python_api_float_slider_01.png|frame|left|The slider and the spin-box are interrelated. ]]
  
 
This article will go over the creation of the popular float slider interface widget.  The float slider widget includes a slider bar and a floating point spin-box that are linked in a way that an adjustment on one will effect the other to maintain correlation.
 
This article will go over the creation of the popular float slider interface widget.  The float slider widget includes a slider bar and a floating point spin-box that are linked in a way that an adjustment on one will effect the other to maintain correlation.
 
+
{{Clear}}
 
== Necessary Modules ==
 
== Necessary Modules ==
  

Revision as of 19:13, 14 May 2019

Main article: RL Python Samples.
The slider and the spin-box are interrelated.

This article will go over the creation of the popular float slider interface widget. The float slider widget includes a slider bar and a floating point spin-box that are linked in a way that an adjustment on one will effect the other to maintain correlation.

Necessary Modules

Get started by loading the required modules for the script.

import RLPy
from PySide2 import QtWidgets
from PySide2.shiboken2 import wrapInstance
from PySide2.QtCore import *

We'll need RLPy to access iClone's Python API and Pyside2 related modules to create a functional interface.

Qt Widgets

The Qt Widgets module extends Qt GUI with C++ widget functionality. This is the building blocks for composing the user interface. To learn more about Qt user interface creation with Pyside2, see Pyside2 QtWidgets

Shiboken2

Shiboken is the Python binding generator that Qt for Python uses to create the PySide module, in other words, its the system used to expose the Qt C++ API to Python. The name Shiboken2 and Pyside2 make reference to the Qt5 compatibility, since the previous versions (without the 2) refer to Qt4. For more information, see the Shiboken documentation

QtCore

QtCore provides core non-GUI functionality with all other Qt modules relying on this module. For more information, see the QtCore documentation