Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCreator, #ifdef and #endif with auto-intent?

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 832 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HappyCoder
    wrote on last edited by HappyCoder
    #1

    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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved