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. Are there any official code style specification for Qt programming?
Forum Updated to NodeBB v4.3 + New Features

Are there any official code style specification for Qt programming?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.4k Views 1 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.
  • C Offline
    C Offline
    chcw
    wrote on last edited by
    #1

    Just wonder if there are any offical code style specification for Qt programming. I want to follow it so that it is consistent with the codes generated by Qt IDE Wizard.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      beowulf
      wrote on last edited by
      #2

      Do not know if I misunderstood your question, but I'll answer what I understood.

      Each IDE has its form of organization code (indentation), which can be modified in the same settings for the user that the user is accustomed to.

      I think the only rule or style you must follow are the specifications of the language you are using, for example, in C + + with a semicolon at the end of lines of code, among other mandatory issues of language and not Qt

      -- 0x00

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Maybe this can be helpful:
        "Qt Coding Style":http://qt-project.org/wiki/Qt_Coding_Style

        1 Reply Last reply
        0
        • C Offline
          C Offline
          chcw
          wrote on last edited by
          #4

          Though there is a unique way to write the codes acceptable by the compiler, it is possible to write in different code style.

          For example, in MFC/Microsoft, they use Cxxx for all the classes, such as CMainWindow for Main WIndow class. However, in Qt, it seems they do not use a prefix, use MainWindow for the class and all lower cases mainwindows.cpp for the class implementation file. To make sure our codes are consistent with those generated by the QT IDE automatically, we need to find the code sytle for Qt.

          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