Hi Simon,

try the Qt.Tool flag.
E.g. in your widget's constructor use self.setWindowFlag(QtCore.Qt.Tool)




On 12/02/17 11:39 PM, Simon Björk wrote:
Bringing up this old topic again as I'm struggeling to get this to work (Windows 7) even with the suggestions above. Anyone have a snippet to share that keeps the panel on top?

Best regards,
Simon




-------------------------------
Simon Björk
Compositor/TD

+46 (0)70-2859503
www.bjorkvisuals.com <http://www.bjorkvisuals.com/>

2016-01-02 3:40 GMT+01:00 Frank Rueter|OHUfx <fr...@ohufx.com <mailto:fr...@ohufx.com>>:

    Hi Paul,

    sorry to make you repeat yourself, but I was already doing all
    that, so I was at a bit of a loss. However, your reply made me
    look a bit harder:
    I was parenting the widget to Nuke's main window in it's
    constructor, which yielded very unexpected results (bad practice
    anyway I guess).
    For some reason when passing the parent widget as an argument when
    creating an instance of the widget it works as expected.
    Thanks!

    Cheers,
    frank




    On 2/01/16 2:06 am, Paul Winex wrote:

    You need 3 things:
    1. Inherit your widget from QWidget/QMainWindow/QDialog
    2. Parent widget to main nuke window. Use this function

    def getMainWindow():
        for widget in qApp.topLevelWidgets():
            if widget.metaObject().className() ==
    'Foundry::UI::DockMainWindow':
                return widget

    3. If you inherited from QWidget you need to set flag Qt.Tool or
    Qt.Window.
    Its all. No need to register nuke panel if you need float window.

    01 янв. 2016 г. 14:47 пользователь
    <nuke-python-requ...@support.thefoundry.co.uk
    <mailto:nuke-python-requ...@support.thefoundry.co.uk>> написал:

        My function return correct result even if nuke not actively.

        29 дек. 2015 г. 14:48 пользователь
        <nuke-python-requ...@support.thefoundry.co.uk
        <mailto:nuke-python-requ...@support.thefoundry.co.uk>> написал:

            Send Nuke-python mailing list submissions to
            nuke-python@support.thefoundry.co.uk
            <mailto:nuke-python@support.thefoundry.co.uk>

            To subscribe or unsubscribe via the World Wide Web, visit
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            or, via email, send a message with subject or body 'help' to
            nuke-python-requ...@support.thefoundry.co.uk
            <mailto:nuke-python-requ...@support.thefoundry.co.uk>

            You can reach the person managing the list at
            nuke-python-ow...@support.thefoundry.co.uk
            <mailto:nuke-python-ow...@support.thefoundry.co.uk>

            When replying, please edit your Subject line so it is
            more specific
            than "Re: Contents of Nuke-python digest..."


            Today's Topics:

               1. Re: keep non-modal PySide panel above main app
                  (Frank Rueter|OHUfx)
               2. Re: keep non-modal PySide panel above main app
            (Erik Johansson)
               3. Re: keep non-modal PySide panel above main app
                  (Frank Rueter|OHUfx)


            
----------------------------------------------------------------------

            Message: 1
            Date: Tue, 29 Dec 2015 09:59:24 +1300
            From: Frank Rueter|OHUfx <fr...@ohufx.com
            <mailto:fr...@ohufx.com>>
            Subject: Re: [Nuke-python] keep non-modal PySide panel
            above main app
            To: nuke-python@support.thefoundry.co.uk
            <mailto:nuke-python@support.thefoundry.co.uk>
            Message-ID: <5681a2ac.6050...@ohufx.com
            <mailto:5681a2ac.6050...@ohufx.com>>
            Content-Type: text/plain; charset="windows-1252"

            so now that I have relaxed and enjoyed Christmas, any
            ideas? :)


            On 25/12/15 3:00 am, Howard Jones wrote:
            > relax and enjoy Christmas? ;)
            >
            > Howard
            >
            > On 24 Dec 2015, at 12:57 am, Frank Rueter|OHUfx
            <fr...@ohufx.com <mailto:fr...@ohufx.com>
            > <mailto:fr...@ohufx.com <mailto:fr...@ohufx.com>>> wrote:
            >
            >> Slight issue: the flag keeps the panel on top of
            everything system
            >> wide. I'd like it to only stay on top of Nuke, but not
            on top of
            >> other stuff (e.g.system's file browser) when Nuke is
            in the background.
            >> Any ideas?
            >>
            >> On 22/12/15 11:46 am, Frank Rueter|OHUfx wrote:
            >>> DOH, of course, thanks Hugo!
            >>>
            >>> On 22/12/15 11:31 am, Hugo Léveillé wrote:
            >>>> Have you tried:
            >>>>
            >>>> self.setWindowFlags(Qt.WindowStaysOnTopHint)
            >>>>
            >>>> Sent from my iPhone
            >>>>
            >>>> On Dec 21, 2015, at 5:27 PM, Frank Rueter|OHUfx
            <fr...@ohufx.com <mailto:fr...@ohufx.com>>
            >>>> wrote:
            >>>>
            >>>>> Hi guys,
            >>>>>
            >>>>> does anybody know if it's possible to keep a
            non-modal PySide
            >>>>> panel above the main Nuke window when focus is on
            the main app?
            >>>>>
            >>>>> Cheers,
            >>>>> frank
            >>>>>
            >>>>>
            >>>>>
            >>>>> --
>>>>> <ohufxLogo_50x50.png> <http://www.ohufx.com> *vfx compositing
            >>>>> <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >>>>> customisation and consulting
            >>>>> <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>>>>
            >>>>> _______________________________________________
            >>>>> Nuke-python mailing list
            >>>>> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>>>> <mailto:Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>>,
            >>>>> http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>>>
            >>>>
            >>>> _______________________________________________
            >>>> Nuke-python mailing list
            >>>> Nuke-python@support.thefoundry.co.uk
            
<mailto:Nuke-python@support.thefoundry.co.uk>,http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>>
            >>> --
>>> <mime-attachment.png> <http://www.ohufx.com> *vfx compositing
            >>> <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >>> customisation and consulting
            >>> <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>>
            >>>
            >>>
            >>> _______________________________________________
            >>> Nuke-python mailing list
            >>> Nuke-python@support.thefoundry.co.uk
            
<mailto:Nuke-python@support.thefoundry.co.uk>,http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>
            >> --
>> <ohufxLogo_50x50.png> <http://www.ohufx.com> *vfx compositing
            >> <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >> customisation and consulting
            >> <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>
            >> _______________________________________________
            >> Nuke-python mailing list
            >> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >> <mailto:Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>>,
            >> http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >
            >
            > _______________________________________________
            > Nuke-python mailing list
            > Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>,
            http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>

            --
            ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
            <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            customisation
            and consulting
            <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *

            -------------- next part --------------
            Skipped content of type multipart/related

            ------------------------------

            Message: 2
            Date: Tue, 29 Dec 2015 00:13:40 +0100
            From: Erik Johansson <erik.johans...@fido.se
            <mailto:erik.johans...@fido.se>>
            Subject: Re: [Nuke-python] keep non-modal PySide panel
            above main app
            To: Nuke Python discussion
            <nuke-python@support.thefoundry.co.uk
            <mailto:nuke-python@support.thefoundry.co.uk>>
            Message-ID:
<CAHE2vzvdOumY1gZMo5PT1E924nrPj-X8S6=dyrsyke6rafo...@mail.gmail.com
            <mailto:dyrsyke6rafo...@mail.gmail.com>>
            Content-Type: text/plain; charset="utf-8"

            Skipped content of type
            multipart/alternative-------------- next part --------------
            A non-text attachment was scrubbed...
            Name: ohufxLogo_50x50.png
            Type: image/png
            Size: 2666 bytes
            Desc: not available
            Url :
            
http://support.thefoundry.co.uk/cgi-bin/mailman/private/nuke-python/attachments/20151229/b4474ea1/ohufxLogo_50x50-0001.png
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/private/nuke-python/attachments/20151229/b4474ea1/ohufxLogo_50x50-0001.png>

            ------------------------------

            Message: 3
            Date: Tue, 29 Dec 2015 22:31:00 +1300
            From: Frank Rueter|OHUfx <fr...@ohufx.com
            <mailto:fr...@ohufx.com>>
            Subject: Re: [Nuke-python] keep non-modal PySide panel
            above main app
            To: nuke-python@support.thefoundry.co.uk
            <mailto:nuke-python@support.thefoundry.co.uk>
            Message-ID: <568252d4.1020...@ohufx.com
            <mailto:568252d4.1020...@ohufx.com>>
            Content-Type: text/plain; charset="windows-1252"

            If I register it as a panel I wouldn't have the
            stay-on-top problem, but
            that seems to lose the ability to scale the wrapping
            widget so it fits
            the custom widget, resulting in the user always having to
            resize the window.
            At the moment I am just opening it as a non-modal panel
            via show().

            Setting parent=QtGui.QApplication.activeWindow() crashes
            Nuke when the
            panel's show() method is called.
            Setting no parent leaves me with the original problem.

            Ideally I'd wrap it as a nuke panel via
            nukescripts.registerWidgetAsPanel(create=True), then call
            show() on the
            returned object. But as mentioned above, this creates a
            parent widget
            that does not scale according to the widget it's wrapping.

            frank

            On 29/12/15 12:13 pm, Erik Johansson wrote:
            > Are you registering it as a nuke panel or just showing
            a QDialog?
            >
            > If it's a QDialog what Hugo wrote should work if it
            have the correct
            > parent aka nuke mainwindow.
            >
            > On Mon, Dec 28, 2015 at 9:59 PM, Frank Rueter|OHUfx
            <fr...@ohufx.com <mailto:fr...@ohufx.com>
            > <mailto:fr...@ohufx.com <mailto:fr...@ohufx.com>>> wrote:
            >
            >     so now that I have relaxed and enjoyed Christmas,
            any ideas? :)
            >
            >
            >
            >     On 25/12/15 3:00 am, Howard Jones wrote:
            >>     relax and enjoy Christmas? ;)
            >>
            >>     Howard
            >>
            >>     On 24 Dec 2015, at 12:57 am, Frank Rueter|OHUfx
            <fr...@ohufx.com <mailto:fr...@ohufx.com>
            >>     <mailto:fr...@ohufx.com <mailto:fr...@ohufx.com>>>
            wrote:
            >>
            >>>     Slight issue: the flag keeps the panel on top of
            everything
            >>>     system wide. I'd like it to only stay on top of
            Nuke, but not on
            >>>     top of other stuff (e.g.system's file browser)
            when Nuke is in
            >>>     the background.
            >>>     Any ideas?
            >>>
            >>>     On 22/12/15 11:46 am, Frank Rueter|OHUfx wrote:
            >>>>     DOH, of course, thanks Hugo!
            >>>>
            >>>>     On 22/12/15 11:31 am, Hugo Léveillé wrote:
            >>>>>     Have you tried:
            >>>>>
            >>>>>  self.setWindowFlags(Qt.WindowStaysOnTopHint)
            >>>>>
            >>>>>     Sent from my iPhone
            >>>>>
            >>>>>     On Dec 21, 2015, at 5:27 PM, Frank Rueter|OHUfx
            >>>>>     <fr...@ohufx.com <mailto:fr...@ohufx.com>
            <mailto:fr...@ohufx.com <mailto:fr...@ohufx.com>>> wrote:
            >>>>>
            >>>>>>     Hi guys,
            >>>>>>
            >>>>>>     does anybody know if it's possible to keep a
            non-modal PySide
            >>>>>>     panel above the main Nuke window when focus is
            on the main app?
            >>>>>>
            >>>>>>     Cheers,
            >>>>>>     frank
            >>>>>>
            >>>>>>
            >>>>>>
            >>>>>>     --
>>>>>> <ohufxLogo_50x50.png> <http://www.ohufx.com> *vfx
            >>>>>>     compositing
            <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> |
            >>>>>>     *workflow customisation and consulting
            >>>>>>     <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>>>>>
            >>>>>>  _______________________________________________
            >>>>>>     Nuke-python mailing list
            >>>>>> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>>>>>     <mailto:Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>>,
            >>>>>> http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>>>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>>>>
            >>>>>
            >>>>>  _______________________________________________
            >>>>>     Nuke-python mailing list
            >>>>> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>>>>     <mailto:Nuke-python@support.thefoundry.co.uk
            
<mailto:Nuke-python@support.thefoundry.co.uk>>,http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>>>
            >>>>     --
            >>>>  <mime-attachment.png> <http://www.ohufx.com>  *vfx
            compositing
            >>>>     <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >>>>     customisation and consulting
            >>>>     <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>>>
            >>>>
            >>>>
            >>>>  _______________________________________________
            >>>>     Nuke-python mailing list
            >>>> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>>>     <mailto:Nuke-python@support.thefoundry.co.uk
            
<mailto:Nuke-python@support.thefoundry.co.uk>>,http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>>
            >>>     --
>>> <ohufxLogo_50x50.png> <http://www.ohufx.com> *vfx compositing
            >>>     <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >>>     customisation and consulting
            >>>     <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >>>
            >>>  _______________________________________________
            >>>     Nuke-python mailing list
            >>> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>>     <mailto:Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>>,
            >>> http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >>
            >>
            >>     _______________________________________________
            >>     Nuke-python mailing list
            >> Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >>     <mailto:Nuke-python@support.thefoundry.co.uk
            
<mailto:Nuke-python@support.thefoundry.co.uk>>,http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >
            >     --
            >     ohufxLogo 50x50 <http://www.ohufx.com>   *vfx
            compositing
            >     <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            >     customisation and consulting
            >     <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *
            >
            >
            >     _______________________________________________
            >     Nuke-python mailing list
            > Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>
            >     <mailto:Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>>,
            > http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
            >
            >
            >
            >
            > --
            >
            > *Erik Johansson */Pipeline TD/
            >
            > *Fido *Rosenlundsgatan 40 118 53 Stockholm, Sweden
            www.fido.se <http://www.fido.se>
            > <http://www.fido.se/>
            >
            >
            >
            > _______________________________________________
            > Nuke-python mailing list
            > Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>,
            http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            >
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>

            --
            ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
            <http://ohufx.com/index.php/vfx-compositing
            <http://ohufx.com/index.php/vfx-compositing>> | *workflow
            customisation
            and consulting
            <http://ohufx.com/index.php/vfx-customising
            <http://ohufx.com/index.php/vfx-customising>>* *

            -------------- next part --------------
            Skipped content of type multipart/related

            ------------------------------

            _______________________________________________
            Nuke-python mailing list
            Nuke-python@support.thefoundry.co.uk
            <mailto:Nuke-python@support.thefoundry.co.uk>,
            http://forums.thefoundry.co.uk/
            <http://forums.thefoundry.co.uk/>
            http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
            
<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>

            End of Nuke-python Digest, Vol 95, Issue 20
            *******************************************



    _______________________________________________
    Nuke-python mailing list
    Nuke-python@support.thefoundry.co.uk
    <mailto:Nuke-python@support.thefoundry.co.uk>,http://forums.thefoundry.co.uk/ 
<http://forums.thefoundry.co.uk/>
    http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
    <http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
-- ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
    <http://ohufx.com/index.php/vfx-compositing> | *workflow
    customisation and consulting
    <http://ohufx.com/index.php/vfx-customising>* *

    _______________________________________________ Nuke-python
    mailing list Nuke-python@support.thefoundry.co.uk
    <mailto:Nuke-python@support.thefoundry.co.uk>,
    http://forums.thefoundry.co.uk/ <http://forums.thefoundry.co.uk/>
    http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
    <http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>


_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to