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 ?
Forum Updated to NodeBB v4.3 + New Features

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 2 Watching
  • 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 10 Oct 2019, 16:18 last edited by JKSH 10 Oct 2019, 23:53
    #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
    */
    
    
    P J 2 Replies Last reply 10 Oct 2019, 16:27
    0
    • A Anonymous_Banned275
      10 Oct 2019, 16:18

      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
      */
      
      
      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 10 Oct 2019, 16:27 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
        10 Oct 2019, 16:18

        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
        */
        
        
        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 10 Oct 2019, 23:54 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

        J 1 Reply Last reply 11 Oct 2019, 07:42
        4
        • J JKSH
          10 Oct 2019, 23:54

          @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.

          J Offline
          J Offline
          JonB
          wrote on 11 Oct 2019, 07:42 last edited by JonB 10 Nov 2019, 07:43
          #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 11 Oct 2019, 07:48
          0
          • J JonB
            11 Oct 2019, 07:42

            @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 11 Oct 2019, 07:48 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

            1/5

            10 Oct 2019, 16:18

            • Login

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