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. It is any way to set C++ include guards automatycally?
QtWS25 Last Chance

It is any way to set C++ include guards automatycally?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.8k 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.
  • L Offline
    L Offline
    lukwoz
    wrote on last edited by
    #1

    Hi,
    I typically named C++ include guards in the format
    e.g. //src/project/file.hpp
    #ifndef SRC_PROJECT_FILE_HPP

    Is there any way to generate this format automatically
    in qt creator?

    mrjjM 1 Reply Last reply
    0
    • L lukwoz

      Hi,
      I typically named C++ include guards in the format
      e.g. //src/project/file.hpp
      #ifndef SRC_PROJECT_FILE_HPP

      Is there any way to generate this format automatically
      in qt creator?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      @lukwoz
      Yes using the New Wizard it will be inserted.

      alt text

      But if you mean in your format. then No. Not that I know of.

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

        Just a note
        You cannot use
        #pragma once
        ?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lukwoz
          wrote on last edited by
          #4

          I prefer based on the full path in a project's source tree. If somebody knows how to automate it in qt I will be grateful :)

          mrjjM 1 Reply Last reply
          0
          • L lukwoz

            I prefer based on the full path in a project's source tree. If somebody knows how to automate it in qt I will be grateful :)

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @lukwoz
            well those wizards are editable
            http://doc.qt.io/qtcreator/creator-project-wizards.html

            But i do not know if there is a key for the full path as its not inserted into project yet.

            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