Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Are there any official code style specification for Qt programming?

    General and Desktop
    3
    4
    1260
    Loading More Posts
    • 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
      chcw last edited by

      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 Reply Quote 0
      • B
        beowulf last edited by

        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 Reply Quote 0
        • Q
          qxoz last edited by

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

          1 Reply Last reply Reply Quote 0
          • C
            chcw last edited by

            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 Reply Quote 0
            • First post
              Last post