Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator: How do I switch pragma-style header guard to "old-style" include guards when generating a new header file?

Qt Creator: How do I switch pragma-style header guard to "old-style" include guards when generating a new header file?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 2.4k 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.
  • B Offline
    B Offline
    benj_qt_account
    wrote on 23 Apr 2019, 17:56 last edited by
    #1

    I recently noticed that the automatically generated header guards use #pragma once instead of #ifndef MYFILE_H... How do I get the old functionality back?

    I found the wizard files (Tools/QtCreator/share/qtcreator/templates/wizards) and found that I could edit them to get the correct behavior, but that seems hacky as there is already a variable Cpp:PragmaOnce (see wizards/classes/cpp/file.h for an example) that seems to dictate which guard is used. The only issue is that I don't know how to set this variable. Is there a place to set this in the Qt Creator GUI?

    1 Reply Last reply
    2
    • O Offline
      O Offline
      Oleg Shalnev
      wrote on 12 May 2019, 07:12 last edited by
      #2

      0_1557645113649_ed035a77-f887-4904-b2ce-634ffa44f07f-image.png

      1 Reply Last reply
      3

      • Login

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