Jump to content

Stretch UI


kiryha

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

Link to comment
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.

Link to comment
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()

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...