Jump to content
Sign in to follow this  
kiryha

Stretch UI

Recommended Posts

I have a pyside window:

import hou

from PySide2 import QtCore, QtUiTools, QtWidgets, QtGui

class BatchRender(QtWidgets.QWidget):
    def __init__(self):
        # SETUP UI WINDOW
        super(BatchRender, self).__init__()
        ui_file = "C:/temp/test.ui"
        self.ui = QtUiTools.QUiLoader().load(ui_file, parentWidget=self)
        self.setParent(hou.ui.mainQtWindow(), QtCore.Qt.Window)
        
BR = BatchRender()
BR.show()

 This window does not scales as it usually happens with QT widgets. How could I fix this, and window name as well (houdinifx)?


scale_ui_01.thumb.PNG.57c979768d18188e9d0625663d8ccc1d.PNG

test.ui

Share this post


Link to post
Share on other sites

Because in your .ui file you have the width and height attributes are fixed values.? 

Share this post


Link to post
Share on other sites

But usually, it works fine in other apps... Can I delete width and height attributes (or set them to non-fixed values)? I had no luck with deleting  <width>296</width> and  <height>70</height>.
I suppose this is because of parenting my UI to Houdini main window.

Share this post


Link to post
Share on other sites
import hou

from PySide2 import QtCore, QtUiTools, QtWidgets, QtGui

class BatchRender(QtWidgets.QWidget):
    def __init__(self):
        # SETUP UI WINDOW
        super(BatchRender, self).__init__()
        ui_file = "C:/temp/test.ui"
        self.ui = QtUiTools.QUiLoader().load(ui_file, parentWidget=self)
        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addWidget(self.ui)
        self.setLayout(mainLayout)
        self.setParent(hou.ui.mainQtWindow(), QtCore.Qt.Window)
        
BR = BatchRender()
BR.show()

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×