Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-25 Thread Nicolas Combecave
When we use a qt popupMenu to reproduce the maya native contextual menu, one of the things we noticed and did not like was that maya indicates that there is a contextual menu by changing the icon when you hover a widget. if you want to adhere to maya style and reproduce this, you have to use this

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-24 Thread ajrb25
On Wednesday, October 17, 2018 at 4:24:27 PM UTC-4, Justin Israel wrote: > On Wed, Oct 17, 2018 at 2:09 PM wrote: > On Tuesday, October 16, 2018 at 8:21:02 PM UTC-4, Michael Boon wrote: > > > I think Wexler has basically what you need there. > > > All the self.my_btn stuff should be in a

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-17 Thread Justin Israel
On Wed, Oct 17, 2018 at 2:09 PM wrote: > On Tuesday, October 16, 2018 at 8:21:02 PM UTC-4, Michael Boon wrote: > > I think Wexler has basically what you need there. > > All the self.my_btn stuff should be in a function, probably in __init__ > for a simple case. > > > > You might also need > >

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-17 Thread Daniel Wexler
Errors? Get any? The btn creation can be anywhere in the window/dialog class. Than you connect its context to the add_menu def' that execute as you press right click. On Tue, Oct 16, 2018 at 6:09 PM wrote: > On Tuesday, October 16, 2018 at 8:21:02 PM UTC-4, Michael Boon wrote: > > I think

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-16 Thread ajrb25
On Tuesday, October 16, 2018 at 8:21:02 PM UTC-4, Michael Boon wrote: > I think Wexler has basically what you need there. > All the self.my_btn stuff should be in a function, probably in __init__ for a > simple case. > > You might also need >

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-16 Thread Michael Boon
I think Wexler has basically what you need there. All the self.my_btn stuff should be in a function, probably in __init__ for a simple case. You might also need self.my_btn.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) and the connections don't need to use a partial function as long as you

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-16 Thread Wexler
Here is an example that *might* put you in the right track.. please note, I did not test this snippet from functools import partial class MyUI(window or dialog or widget or whatever...): # create a button self.my_btn = QtWidgets.QPushButton('Right Click Me') # left click

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-16 Thread Adam Baker
I’m looking to create a menu that is shown when you preform a right click on a button. The photo was an example for the maya.cmds.popupMenu() that I want to repeat using QT Instead. Hope this helps - Adam -- You received this message because you are subscribed to the Google Groups "Python

Re: [Maya-Python] Re: PYQT “pop up menu”

2018-10-16 Thread Justin Israel
On Wed, Oct 17, 2018, 2:29 AM wrote: > On Tuesday, October 16, 2018 at 1:52:51 AM UTC-4, Michael Boon wrote: > > It depends a lot on the context you're in. If you have created a custom > Qt button and you want to give it a right-click menu, a lot of the time you > have to do something like this