Beispiel #1
0
wxWindowQt::~wxWindowQt()
{
    SendDestroyEvent();

    if ( s_capturedWindow == this )
        s_capturedWindow = NULL;

    DestroyChildren(); // This also destroys scrollbars

    delete m_qtPicture;
    delete m_qtPainter;

#if wxUSE_ACCEL
    m_qtShortcutHandler->deleteLater();
#endif

    // Delete only if the qt widget was created or assigned to this base class
    if (m_qtWindow)
    {
        wxLogDebug(wxT("wxWindow::~wxWindow %s m_qtWindow=%p"),
                   (const char*)GetName(), m_qtWindow);
        // Avoid sending further signals (i.e. if deleting the current page)
        m_qtWindow->blockSignals(true);
        // Reset the pointer to avoid handling pending event and signals
        QtStoreWindowPointer( GetHandle(), NULL );
        // Delete QWidget when control return to event loop (safer)
        m_qtWindow->deleteLater();
        m_qtWindow = NULL;
    }
    else
    {
        wxLogDebug(wxT("wxWindow::~wxWindow %s m_qtWindow is NULL"),
                   (const char*)GetName());
    }
}
Beispiel #2
0
wxFrame::~wxFrame()
{
    // central widget should be deleted by qt when the main window is destroyed
    QtStoreWindowPointer( GetHandle()->centralWidget(), NULL );
}