IC Python API:Float Slider

From Reallusion Wiki!
Revision as of 20:04, 14 May 2019 by Chuck (RL) (Talk | contribs) (Shiboken2)

Jump to: navigation, search
The slider and the spin-box are inter-related.

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