> On Mar 4, 2016, at 11:24 AM, René J. V. Bertin <rjvber...@gmail.com> wrote:
> 
> Indeed. But it seems it *is* possible to be notified when the widget 
> (finally) 
> does become visible using something like

Which is exactly what we do because we need to know *before* a window is 
minimized:

 void IgorNormalWindow::showEvent(QShowEvent *event) {
        QWidget::showEvent(event);
        emit windowVisibilityChanged(this, true);
        TellIgorWindowStatus(this, WINDOW_STATUS_DID_SHOW, 0);

#ifdef MACIGOR
        if (!igorNSWindowNotifier)
        {
                if (!IgorApp()->IsMDI())
                {
                        igorNSWindowNotifier = 
CreateMinimizeNotification(reinterpret_cast<void *>(effectiveWinId()), 
reinterpret_cast<void *>(this));
                        SetNSWindowParticipatesInCycle(this, false);
                }
        }
        else
        {
                if (IgorApp()->IsMDI())
                {
                        DeleteIgorCocoaWindowNotifier(igorNSWindowNotifier);
                        igorNSWindowNotifier = NULL;
                }
        }
#endif

}

The CreateMinimizeNotification() function wraps Objective C++ code that 
ultimately does this:

        [[NSNotificationCenter defaultCenter]
                                                        addObserver:self
                                                        
selector:@selector(handleMinimizationNotification:)
                                                        
name:@"NSWindowWillMiniaturizeNotification"
                                                        object:cocoaWindow];

 

-John

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to