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. How to comment out block of lines in project file ?
QtWS25 Last Chance

How to comment out block of lines in project file ?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 5 Posters 3.7k 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by JKSH
    #1

    Is there accepted way to comment out block of lines in Qt project file ?
    Something similar to C style

    /* block start commented out

    */ block end commented out

    or is

    #   commented out 
    #   commented out 
    

    only way to do it?

    #-------------------------------------------------
    #
    # Project created by QtCreator 2019-10-10T11:08:52
    #
    #-------------------------------------------------
    /*
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = Stadard_Dialog_Example
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    FORMS    += mainwindow.ui
    */
    
    
    Pablo J. RoginaP JKSHJ 2 Replies Last reply
    0
    • A Anonymous_Banned275

      Is there accepted way to comment out block of lines in Qt project file ?
      Something similar to C style

      /* block start commented out

      */ block end commented out

      or is

      #   commented out 
      #   commented out 
      

      only way to do it?

      #-------------------------------------------------
      #
      # Project created by QtCreator 2019-10-10T11:08:52
      #
      #-------------------------------------------------
      /*
      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      TARGET = Stadard_Dialog_Example
      TEMPLATE = app
      
      
      SOURCES += main.cpp\
              mainwindow.cpp
      
      HEADERS  += mainwindow.h
      
      FORMS    += mainwindow.ui
      */
      
      
      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @AnneRanch please check documentation

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      4
      • A Anonymous_Banned275

        Is there accepted way to comment out block of lines in Qt project file ?
        Something similar to C style

        /* block start commented out

        */ block end commented out

        or is

        #   commented out 
        #   commented out 
        

        only way to do it?

        #-------------------------------------------------
        #
        # Project created by QtCreator 2019-10-10T11:08:52
        #
        #-------------------------------------------------
        /*
        QT       += core gui
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        TARGET = Stadard_Dialog_Example
        TEMPLATE = app
        
        
        SOURCES += main.cpp\
                mainwindow.cpp
        
        HEADERS  += mainwindow.h
        
        FORMS    += mainwindow.ui
        */
        
        
        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @AnneRanch said in How to comment out block of lines in project file ?:

        or is

        #   commented out 
        #   commented out 
        

        only way to do it?

        Yes, that's the only way.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        JonBJ 1 Reply Last reply
        4
        • JKSHJ JKSH

          @AnneRanch said in How to comment out block of lines in project file ?:

          or is

          #   commented out 
          #   commented out 
          

          only way to do it?

          Yes, that's the only way.

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by JonB
          #4

          @JKSH
          I don't use Qt Creator. Can one edit a .pro file in Creator so that you can see the text, it knows the syntax of a .pro file, and does Qt Creator have a command to "toggle" commenting in/out a block of lines (e.g. Ctrl+/), as other IDEs I use do, which would work on a .pro file? That would help the OP.

          jsulmJ 1 Reply Last reply
          0
          • JonBJ JonB

            @JKSH
            I don't use Qt Creator. Can one edit a .pro file in Creator so that you can see the text, it knows the syntax of a .pro file, and does Qt Creator have a command to "toggle" commenting in/out a block of lines (e.g. Ctrl+/), as other IDEs I use do, which would work on a .pro file? That would help the OP.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @JonB @AnneRanch Yes, this is possible: Ctrl+/ , or Edit/Advanced/Toggle Comment Section
            Works for me even when editing pro files.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            7

            • Login

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