Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-16 Thread Justin Israel
On Sat, Nov 17, 2018 at 6:05 PM Adam Baker  wrote:

> Ahah no worries. After all this info do you have any suggestions on how I
> can edit the QFileDialog and add the extra widgets in on the right hand
> side?
>

I don't really have any suggestions since I see it works differently in
PySide 1.x vs 2.x. The QFileDialog relies on system native calls so it
would be difficult I think to completely customise the existing one through
Qt.


>
> - Adam B.
>
> On Friday, 16 November 2018 23:42:53 UTC-5, Justin Israel wrote:
>>
>> Oh sorry about that. I was reading it wrong multiple times :-)
>> For me, your example mostly works as expected on linux under PySide 1.x.
>> But the reject signal is still mapped to the QFileDialog so when you hit
>> ESC, the QFileDialog disappears and leaves behind your button and main
>> widget. On PySide 2.x however, it completely doesn't work and pops up two
>> individual widgets. It seems in Qt5 the QFileDialog is doing some late
>> layout at the time its actually shown, so the child layouts and widgets
>> aren't available yet.
>>
>> On Sat, Nov 17, 2018 at 3:41 AM Adam Baker  wrote:
>>
>>> Hey Justin,
>>>
>>> I am using a QWidget.QDialog here. I named the class “MainWindow” so I
>>> think your getting it mixed up. Sorry for that should have been more clear
>>> with my class names.
>>>
>>> Any other ideas why I’d have this problem on OSX ? Haven’t tested with
>>> Windows yet.
>>>
>>> -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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/a328373e-1fce-47f7-af52-5aee20328636%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/a56eda2e-f966-423e-a50c-3a1136a737a1%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0k4EgmPmHaJ6P4mw8zFwB2FfXyhoYRydEMTOvpyO%2BOkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-16 Thread Adam Baker
Ahah no worries. After all this info do you have any suggestions on how I 
can edit the QFileDialog and add the extra widgets in on the right hand 
side?

- Adam B. 

On Friday, 16 November 2018 23:42:53 UTC-5, Justin Israel wrote:
>
> Oh sorry about that. I was reading it wrong multiple times :-)
> For me, your example mostly works as expected on linux under PySide 1.x. 
> But the reject signal is still mapped to the QFileDialog so when you hit 
> ESC, the QFileDialog disappears and leaves behind your button and main 
> widget. On PySide 2.x however, it completely doesn't work and pops up two 
> individual widgets. It seems in Qt5 the QFileDialog is doing some late 
> layout at the time its actually shown, so the child layouts and widgets 
> aren't available yet. 
>
> On Sat, Nov 17, 2018 at 3:41 AM Adam Baker  > wrote:
>
>> Hey Justin,
>>
>> I am using a QWidget.QDialog here. I named the class “MainWindow” so I 
>> think your getting it mixed up. Sorry for that should have been more clear 
>> with my class names. 
>>
>> Any other ideas why I’d have this problem on OSX ? Haven’t tested with 
>> Windows yet. 
>>
>> -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+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/a328373e-1fce-47f7-af52-5aee20328636%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a56eda2e-f966-423e-a50c-3a1136a737a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-16 Thread Justin Israel
Oh sorry about that. I was reading it wrong multiple times :-)
For me, your example mostly works as expected on linux under PySide 1.x.
But the reject signal is still mapped to the QFileDialog so when you hit
ESC, the QFileDialog disappears and leaves behind your button and main
widget. On PySide 2.x however, it completely doesn't work and pops up two
individual widgets. It seems in Qt5 the QFileDialog is doing some late
layout at the time its actually shown, so the child layouts and widgets
aren't available yet.

On Sat, Nov 17, 2018 at 3:41 AM Adam Baker  wrote:

> Hey Justin,
>
> I am using a QWidget.QDialog here. I named the class “MainWindow” so I
> think your getting it mixed up. Sorry for that should have been more clear
> with my class names.
>
> Any other ideas why I’d have this problem on OSX ? Haven’t tested with
> Windows yet.
>
> -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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/a328373e-1fce-47f7-af52-5aee20328636%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1_n-KSW36av3x%2BZr9ehGZb2EB8oRjpuCmadR6J_vFOwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-16 Thread Adam Baker
Hey Justin,

I am using a QWidget.QDialog here. I named the class “MainWindow” so I think 
your getting it mixed up. Sorry for that should have been more clear with my 
class names. 

Any other ideas why I’d have this problem on OSX ? Haven’t tested with Windows 
yet. 

-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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a328373e-1fce-47f7-af52-5aee20328636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-16 Thread Justin Israel
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  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  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 python_inside_maya+unsubscr...@googlegroups.com.
>>> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/dc53b860-3b14-48dd-a269-91f2465ec2b6%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+unsubscr...@googlegroups.com.
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.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-15 Thread Adam Baker
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 > 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 python_inside_maya+unsubscr...@googlegroups.com .
>> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/dc53b860-3b14-48dd-a269-91f2465ec2b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-15 Thread Justin Israel
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  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 python_inside_maya+unsubscr...@googlegroups.com.
> 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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA330X7Kw9bw2tRXMWYTzag1bgQB3RUi1s%2Bk3RxE6%3DQ%2Brw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-15 Thread abaker
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 python_inside_maya+unsubscr...@googlegroups.com.
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.


[Maya-Python] Re: Is it possible to add QPushButton to QFileDialog?

2018-11-14 Thread Michael Boon
I don't have it in front of me, but I think you need to use the existing 
layout instead of creating a new one. So in your buildUI, you need to call 
self.layout(), or self.centralWidget().layout() or something like that. 
Then examine that and figure out where you want to put your button in it.

On Thursday, 15 November 2018 14:58:03 UTC+11, 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
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/46815b6a-7798-438f-a1b7-61ced6e1b479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.