Suggested mod to qc_applicationwindow.cpp - LibreCad 2.1.3

Posted by mad-hatter on
URL: https://forum.librecad.org/Suggested-mod-to-qc-applicationwindow-cpp-LibreCad-2-1-3-tp5714993.html

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
}