On Wed, Aug 10, 2016 at 5:50 PM Fredrik Averpil <fredrik.aver...@gmail.com>
wrote:

> Just tried it on my mac and it worked fine when the Qt.Tool flag was set
>
> Hi Johan, yeah - that’s what I found was weird too. It works when the flag
> is set in Maya on OS X, but not in Maya on Windows.
>
> You aren’t actually passing the parent argument from your own constructor
> to the superclass constructor. Is that still a typo?
> If it is a typo and you are properly passing the parent, try moving the
> Tool window flag into the superclass constructor call as well, instead of
> calling it afterwards.
>
> Hey Justin, hm… what typo were you referring to?
> I mistakenly copy-pasted the wrong code in my initial email, if that's
> what you meant. The gist is here
> <https://gist.github.com/fredrikaverpil/b76bd91b9924435465ecb1b2270c1a9d>.
>
Look at your gist. Where are you actually passing that parent value to
the QMainWindow constructor? I see you accepting it in your custom subclass
but you don't do anything with it.


> I tried also doing a super(ToolWindow,
> self).setWindowFlags(QtCore.Qt.Tool) but that didn’t change anything. Is
> that what you meant?
>
No I meant actually passing it into the QMainWindow constructor as a
windowflag:

http://doc.qt.io/qt-5/qmainwindow.html#QMainWindow

QMainWindow::QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags
= Qt::WindowFlags())

I have seen it not work properly on OSX when you try and set it after the
constructor via setWindowFlags() instead of at the time the constructor is
called.

// Fredrik
> ​
>
> --
> 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/CAD%3DwhWOa3wJe-pVw9QD8rSSOpaoJyhKzHGpNLf7SEGTG2M%2B8yw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWOa3wJe-pVw9QD8rSSOpaoJyhKzHGpNLf7SEGTG2M%2B8yw%40mail.gmail.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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1U58MdH7R5enQ-H1Q8%2B4HogHtXBRkNnSkCf%2Bg6Ry0MCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to