On lundi 27 février 2017 13:19:16 CET David Faure wrote:
> On lundi 27 février 2017 13:09:11 CET Ted Felix wrote:
> > On 02/26/2017 11:28 PM, D. Michael McIntyre wrote:
> > > Load a document, and dozens of things break instantly.  This is
> > > infinitely repeatable here.  (Only testing with Qt5 builds here.)
> > > 
> >    Ah ha!  That's it.  I'm seeing this with Qt4 too.  Should be easy to
> > 
> > bisect and find.  I'll take a look sometime this week.
> 
> No need to bisect, it's clear that this is related to my redesign of the
> parameter area (was a (useless) stack widget inside a dockwidget,
> now it's a simple widget in a layout, the only thing I kept was that it's a
> scrollarea). I didn't think of testing with a document as cmdline param.

Found it. Nasty nasty use of QObject::blockSignals(true).
This blocking was done on "all children of the old view" before swapping to 
the new view, which now includes the parameter area that will get reparented 
into the new view (before my change the parameter area was a dockwidget, so 
not a child of the view). Obviously after that blockSignals(true) nothing 
works in the parameter area, it has all its signals blocked forever.

Does anyone remember the actual reason for this code?
The comment is not specific enough.

void
RosegardenMainWindow::initView()
{
    [...]
    // The plan is to set the new central view via setCentralWidget() in
    // a moment, which schedules the old one for deletion later via
    // QObject::deleteLater().  However, we need to make sure that the old one
    // behaves as if it's already been deleted -- i.e. that it and its
    // entire tree of children send no signals between now and its
    // actual deletion.
    // 
    RosegardenMainViewWidget *oldView = m_view;
    if (oldView) {
        oldView->blockSignals(true);
        // a qt-ism that I have never actually used before.  brief innit
        foreach (QObject *o, oldView->findChildren<QObject *>()) {
            o->blockSignals(true);
        }
    }

Which signals exactly is this trying to prevent against? Not much code will 
happen between here and the view swapping anyway.

I vote for killing all this blockSignals(true) usage, but the question is what 
happens then. In my quick test (start with cmdline arg, then open another 
doc), it all seems to work fine without the above code, but presumably it was 
added for a reason?

-- 
David Faure, fa...@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to