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. New Suggestion for Code Folding
Forum Updated to NodeBB v4.3 + New Features

New Suggestion for Code Folding

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 3 Posters 7.8k 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.
  • B Offline
    B Offline
    bijanbina
    wrote on last edited by
    #1

    1. Partitioning Code
    add something that start with @Region"smt"@ and end with @endRegion@ that the code between these tag can fold and display "smt" in the summery of the folded code.it's very use full for access to your code faster!
    2. Remember code folding
    when a user save a code the fold state save and restore in next launch

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      bijanbina, could you clarify your idea a bit? Do you want code folding on DevNet, or in Creator? Anyway, it is probably best to file a suggestion in "Jira":http://bugreports.qt.nokia.com for this.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bijanbina
        wrote on last edited by
        #3

        i want this feature add to QT Creator for code editing.
        for example your code is:
        @#include <iostream>

        using namespace std;

        void hello();
        void bye();

        void hello()
        {
        cout << "Hi" << endl;
        }

        void bye()
        {
        cout << "Good Bye" << endl;
        }

        int main(int argc, char *argv[])
        {
        int i = 0;
        hello()
        cout << "argc is " << argc << endl;
        for (i = 1;i<argc;i++)
        {
        cout << "the argumet number is " << i << " and the value is " << argv[i] << endl;
        }
        bye();
        return 0;
        }@

        and then you change it to

        @#include <iostream>

        using namespace std;

        Region "Prototypes"
        void hello();
        void bye();
        endRegion

        void hello()
        {
        cout << "Hi" << endl;
        }

        void bye()
        {
        cout << "Good Bye" << endl;
        }

        int main(int argc, char *argv[])
        {
        int i = 0;
        hello()
        cout << "argc is " << argc << endl;
        for (i = 1;i<argc;i++)
        {
        cout << "the argumet number is " << i << " and the value is " << argv[i] << endl;
        }
        bye();
        return 0;
        }
        @

        now you can fold your code like this
        @#include <iostream>

        using namespace std;

        ["Prototypes"]

        void hello()
        {
        cout << "Hi" << endl;
        }

        void bye()
        {
        cout << "Good Bye" << endl;
        }

        int main(int argc, char *argv[])
        {
        int i = 0;
        hello()
        cout << "argc is " << argc << endl;
        for (i = 1;i<argc;i++)
        {
        cout << "the argumet number is " << i << " and the value is " << argv[i] << endl;
        }
        bye();
        return 0;
        }
        @

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          So, you want it like MSVS does it (see "MSDN":http://msdn.microsoft.com/en-us/library/b6xkz944(v=VS.80) ) ?

          @
          // pragma_directives_region.cpp
          #pragma region Region_1
          void Test() {}
          void Test2() {}
          void Test3() {}
          #pragma endregion Region_1

          int main() {}
          @

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bijanbina
            wrote on last edited by
            #5

            yes it is actually i want

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Such a thing, as long as it is not overused, might be useful, I guess.
              One solution might be to define a macro Q_CODE_REGION (or something like that), and let Qt Creator's code parser use that for code folding. For MSVC, it might expand to #pragma region, but AFAIK GCC does not have such a thing, so it should probably expand to nothing there.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bijanbina
                wrote on last edited by
                #7

                yes you can create a define in qt like
                @#define Q_CODE_REGION //@
                and qt detect it for fold it's no problem for gcc and other compiler

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  So... did you file that suggestion yet in Jira?

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bijanbina
                    wrote on last edited by
                    #9

                    yes you can find it "here":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-5170

                    i just add my first post to it

                    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