Again, I would suggest not using a QMainWindow here, because it requires
that you do setCentralWidget as opposed to setting a custom layout.

On Fri, Nov 16, 2018, 8:20 PM Adam Baker <[email protected]> wrote:

> I was testing my code I posted in OSX and notices that its not behaving
> the same as on Linux. It will create two separate windows one for the
> FileDalog and another for the pushbutton. Would anyone have a clue why it
> would do this ?
>
> - Adam
>
> On Thursday, 15 November 2018 21:19:49 UTC-5, Justin Israel wrote:
>>
>> My only suggestion for that code is that you probably don't need a
>> QMainWindow, since you aren't even setting the setCentralWidget. You could
>> just make it a QWidget or QDialog that nests the QFileDialog. If you made
>> it a QDialog, then it would be easy to wire up the QFileDialog signals to
>> it.
>>
>> On Fri, Nov 16, 2018 at 2:25 PM <[email protected]> wrote:
>>
>>> On Wednesday, November 14, 2018 at 10:58:03 PM UTC-5, Adam Baker wrote:
>>> > Hey all,
>>> >
>>> >
>>> > I am trying to add a QPushButton or any other QWidget to a QFileDialog.
>>> >
>>> >
>>> > Here is where I currently am:
>>> >
>>> > 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 the
>>> QFileDialog gets pushed to the upper corner collapsing on it's self.
>>> >
>>> >
>>> > Thanks
>>> > Adam
>>>
>>> This is my latest method that seams to be working. The only problem I
>>> have found is that I am unable to remove the size control form the
>>> QFileDialog. I am going to continue to try and make it function more like
>>> the maya open file with the Sizeable window on the right side.
>>>
>>> https://pastebin.com/DzemqXNc
>>>
>>> Please let me know if you have any more ideas.
>>>
>>> - Adam B.
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/cf6202ef-bff7-412a-ba4e-8ee25f5b4fc6%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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/dc53b860-3b14-48dd-a269-91f2465ec2b6%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/dc53b860-3b14-48dd-a269-91f2465ec2b6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2-LRnpKkwOm3npYQYowYq%2BbsUQ8rT-hBUL_nPSh9fGsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to