Page 1 of 1

Queued connection in dialog oddity

Posted: Tue Mar 23 2021 9:15 pm
by seasoned_geek

This just started popping up. I updated from the tip of tip this past week so maybe this will jog a memory.

Code: Select all

        // check the box
        setSynType( m_syntaxEnum );

        qDebug() << "queueRunSyntax() called with : " << synFName << " type: " << m_syntaxEnum;
        queueRunSyntax( synFName, m_syntaxEnum );

void RedDiamondTextEdit::runSyntax( QString synFName, SyntaxTypes type )
    qDebug() << "runSyntax() called with: " << synFName << "  type: " << type;
    // save syntax file name
    setSyntaxFile( synFName );

    setSyntaxParser( new Syntax( nullptr, synFName, type, m_spellCheck ) );
    m_syntaxParser->setDocument( document() );
synFName is a QString and m_syntaxEnum is just an enum. The widget class itself makes the connection.

Code: Select all

 connect( this, &RedDiamondTextEdit::queueRunSyntax, this, &RedDiamondTextEdit::runSyntax, Qt::QueuedConnection );
When this widget is on the MainWindow, everything is unicorns and rainbows.

When this widget is on a QDialog though.

Code: Select all

returning syntax file name:  /home/roland/sf_projects/reddiamond_debug/syntax/syn_cpp.json
queueRunSyntax() called with :  /home/roland/sf_projects/reddiamond_debug/syntax/syn_cpp.json  type:  0
runSyntax() called with:     type:  18
The parameters get lost. It appears the connection actually does get queued. Just something about the QDialog event loop suddenly not handling parameters for queue connections.

Doesn't matter what parameters are queue. Always getting a default constructed QString and 18, the last value of the emum.