Suggested mod to qc_applicationwindow.cpp - LibreCad 2.1.3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Suggested mod to qc_applicationwindow.cpp - LibreCad 2.1.3

mad-hatter
Hello,

This stops a warning when using GCC/G++ and compiling from wthin Qt creator. (Windows 10 - 32bit)
Warning:- event unused

void QC_ApplicationWindow::changeEvent(QEvent* event)
{
    // author: ravas

    if (event->type() == QEvent::ActivationChange)
    {
        #if defined(Q_OS_MAC)
            // returning to LC via Command+Tab won't always activate a subwindow
            // https://github.com/LibreCAD/LibreCAD/issues/821

            if (isActiveWindow())
            {
                if (current_subwindow)
                    mdiAreaCAD->setActiveSubWindow(current_subwindow);
            }
            else
            {
                current_subwindow = mdiAreaCAD->currentSubWindow();
            }
        #endif
    }
//    #if defined(Q_OS_MAC)
//        // returning to LC via Command+Tab won't always activate a subwindow
//        // https://github.com/LibreCAD/LibreCAD/issues/821

//        if (event->type() == QEvent::ActivationChange)
//        {
//            if (isActiveWindow())
//            {
//                if (current_subwindow)
//                    mdiAreaCAD->setActiveSubWindow(current_subwindow);
//            }
//            else
//            {
//                current_subwindow = mdiAreaCAD->currentSubWindow();
//            }
//        }
//    #endif
}
Reply | Threaded
Open this post in threaded view
|

Re: Suggested mod to qc_applicationwindow.cpp - LibreCad 2.1.3

LordOfBikes
Administrator
Thanks for reporting this.

In the latest sources this is already solved, see latest source on github.

I'll check the stable 2.1 branch. As this is only cosmetics, it will not trigger a new bug fix release.
But if there will be one in future, I'd be glad to patch this.

Generally we have to check another issue with this method. As changeEvent() is an override, there maybe problems because the event is not forwarded to the base class. This is true for the latest sources too.


Many thanks for your efforts.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution