Adam Baker
2018-11-15 03:58:03 UTC
Hey all,
I am trying to add a QPushButton or any other QWidget to a QFileDialog.
QFileDialog gets pushed to the upper corner collapsing on it's self.
Thanks
Adam
I am trying to add a QPushButton or any other QWidget to a QFileDialog.
*from PySide2 import QtWidgets, QtCore, QtGui**class
fileOpen(QtWidgets.QFileDialog):*
* def __init__(self):*
* super(fileOpen, self).__init__()*
* self.setWindowTitle("ATK Open File")**
self.setObjectName('ATKOpenFile')*
* self.buildUI()*
* def buildUI(self):*
* btnLayout = QtWidgets.QHBoxLayout()*
* self.setLayout(btnLayout)*
* btn = QtWidgets.QPushButton('Click')**
btnLayout.addWidget(btn)*
*def showUI():*
* ui = fileOpen()*
* ui.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)*
* ui.show()** return ui*
The problem is that the button now takes up the while window and thefileOpen(QtWidgets.QFileDialog):*
* def __init__(self):*
* super(fileOpen, self).__init__()*
* self.setWindowTitle("ATK Open File")**
self.setObjectName('ATKOpenFile')*
* self.buildUI()*
* def buildUI(self):*
* btnLayout = QtWidgets.QHBoxLayout()*
* self.setLayout(btnLayout)*
* btn = QtWidgets.QPushButton('Click')**
btnLayout.addWidget(btn)*
*def showUI():*
* ui = fileOpen()*
* ui.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)*
* ui.show()** return ui*
QFileDialog gets pushed to the upper corner collapsing on it's self.
Thanks
Adam
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1633c52d-e9ce-4b4c-b09b-d4298883baf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1633c52d-e9ce-4b4c-b09b-d4298883baf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.