QCreator, #ifdef and #endif with auto-intent?



  • Hello,

    within my code i define a "PlotDebug" to enable/disable Debug outputs and use it like followed:

            if (ui->splitter->sizes().at(0)==0)
            {
    #ifdef PlotDebug
                qDebug() << Q_FUNC_INFO << "Plot Pressure invisible";
    #endif
            }
    

    Is it possible to set an option in Qt Creator (which i didn't found) to auto-intent
    the lines #ifdef and #endif that at looks like this:
    Or can the coding-style be modified?

            if (ui->splitter->sizes().at(0)==0)
            {
                #ifdef PlotDebug
                    qDebug() << Q_FUNC_INFO << "Plot Pressure invisible";
                #endif
            }
    

    Thx,
    Stefan


  • Qt Champions 2016

    @HappyCoder
    Maybe you can install a Beautifier and config it to do like you want. the "Artistic " one i use format it like

    if ( ui->splitter->sizes().at ( 0 ) == 0 )
    {
    #ifdef PlotDebug
    	qDebug() << Q_FUNC_INFO << "Plot Pressure invisible";
    #endif
    }
    

    as default. Quite possible you can tweak it.

    http://doc.qt.io/qtcreator/creator-beautifier.html


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.