Comments (7)
It uses PySide.QUiTools
indirectly through the load_ui
function of Qt.py.
So for example, if you're running the boilerplate in Maya version <= 2016 or Nuke (any version), those will use PySide. For those software/versions, Qt.py will pick that up.
Basically, look into Qt.py and its load_ui
function: https://github.com/mottosso/Qt.py
This function will load the .ui files regardless of which Qt binding is available (PySide, PyQt4, PySide2 or PyQt5).
from pyvfx-boilerplate.
Thanks for the quick reply!
I was hoping to find a way to get common functionality between pyside and qt from Qt.py :
form_class, base_class = uic.loadUiType( uiFile )
but I guess it's not supported - just loading the widget itself via load_ui isn't enough for me :/
from pyvfx-boilerplate.
No, that's not supported exactly like that. But you can define a base class with a little bit of extra work around load_ui
. I've provided two examples here on that: https://github.com/mottosso/Qt.py/tree/master/examples/load_ui
I personally prefer this approach:
def setup_ui(uifile, base_instance=None):
"""Load a Qt Designer .ui file and returns an instance of the user interface
Args:
uifile (str): Absolute path to .ui file
base_instance (QWidget): The widget into which UI widgets are loaded
Returns:
QWidget: the base instance
"""
ui = QtCompat.load_ui(uifile) # Qt.py mapped function
if not base_instance:
return ui
else:
for member in dir(ui):
if not member.startswith('__') and \
member is not 'staticMetaObject':
setattr(base_instance, member, getattr(ui, member))
return ui
Call the function (example):
setup_ui('my_ui.ui', base_instance=self)
from pyvfx-boilerplate.
from pyvfx-boilerplate.
from pyvfx-boilerplate.
Cool!
from pyvfx-boilerplate.
from pyvfx-boilerplate.
Related Issues (15)
- launch as panel in nuke crop the window HOT 2
- Docked boilerplate in Nuke: restarting boilerplate doesn't delete old panel
- Maya palette not complete in standalone mode, PySide2/PyQt5 on OS X HOT 1
- Window will not stay on top of Nuke (OS X) without Qt.Tool or Qt.WindowStaysOnTopHint
- Escape key doesn't close window
- Have a look HOT 1
- nuke 12 menubar deleted upon creation of dockable boilerplate window
- Delete already existing windows in Nuke HOT 1
- Provide maya palette as separate file HOT 1
- Verify layout/central widget
- Screenshots HOT 1
- Incompatible with Nuke 10 on OS X HOT 2
- License missing
- Maya palette glitchy in standalone mode, PySide/PyQt4 on OS X
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvfx-boilerplate.