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. I have made drag&drop for ProjectExplorer. Where is replaced header names for #include statement?
Forum Updated to NodeBB v4.3 + New Features

I have made drag&drop for ProjectExplorer. Where is replaced header names for #include statement?

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 3 Posters 889 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.
  • I Offline
    I Offline
    iss7gli7
    wrote on last edited by iss7gli7
    #1

    I have made drag&drop for ProjectExplorer. For it, I make method
    FolderNavigationModel::dropMimeData and set some properties of m_listView & m_fileSystemModel.

    In result, it can move files from one folder to another, and it changes path in .pro file.

    Remain make replace header names for #include statement, which work for simple rename, but not for change path.

    It take place somewhere in DocumentManager::renamedFile, and farther probably in CppEditorDocument through signal filePathChanged.

    Can someone explane me where take place the replacement of statement #include?

    aha_1980A 1 Reply Last reply
    0
    • I iss7gli7

      I have made drag&drop for ProjectExplorer. For it, I make method
      FolderNavigationModel::dropMimeData and set some properties of m_listView & m_fileSystemModel.

      In result, it can move files from one folder to another, and it changes path in .pro file.

      Remain make replace header names for #include statement, which work for simple rename, but not for change path.

      It take place somewhere in DocumentManager::renamedFile, and farther probably in CppEditorDocument through signal filePathChanged.

      Can someone explane me where take place the replacement of statement #include?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @iss7gli7,

      The replacement is done in CppModelManager::renameIncludes.

      That feature was added in https://codereview.qt-project.org/c/qt-creator/qt-creator/+/95658

      Do you want to make your drag&drop function an official addition to QtCreator?

      Regards

      Qt has to stay free or it will die.

      I 1 Reply Last reply
      3
      • I Offline
        I Offline
        iss7gli7
        wrote on last edited by iss7gli7
        #3

        The replacement is done in CppModelManager::renameIncludes

        Thanks, this what I need.

        Do you want to make your drag&drop function an official addition to QtCreator?

        I post it here a little bit later, if it interestingly. This feature is quite convenient.
        I can make patch for official addition, if there accepted such my changes.

        1 Reply Last reply
        0
        • aha_1980A aha_1980

          Hi @iss7gli7,

          The replacement is done in CppModelManager::renameIncludes.

          That feature was added in https://codereview.qt-project.org/c/qt-creator/qt-creator/+/95658

          Do you want to make your drag&drop function an official addition to QtCreator?

          Regards

          I Offline
          I Offline
          iss7gli7
          wrote on last edited by
          #4

          @aha_1980
          I did it!!! And even improve checks names in renameIncludes for a simple rename, it made mistakes, and very annoyed in big project.

          Now remain make x-copy&paste. In big tree, drag&drop not always convenient.

          aha_1980A 1 Reply Last reply
          1
          • I iss7gli7

            @aha_1980
            I did it!!! And even improve checks names in renameIncludes for a simple rename, it made mistakes, and very annoyed in big project.

            Now remain make x-copy&paste. In big tree, drag&drop not always convenient.

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi @iss7gli7,

            cool!

            I post it here a little bit later, if it interestingly. This feature is quite convenient.
            I can make patch for official addition, if there accepted such my changes.

            I don't have the last word, but your patch sounds interesting for other users, so I see a high chance of getting accepted.

            All contributions to Qt have to go through Gerrit. Don't get frightened, it looks like a big setup at first sight, but it's rather straigthforward.

            If you have questions in that process, don't hesitate to ask here!

            Regards

            Qt has to stay free or it will die.

            I 2 Replies Last reply
            2
            • aha_1980A aha_1980

              Hi @iss7gli7,

              cool!

              I post it here a little bit later, if it interestingly. This feature is quite convenient.
              I can make patch for official addition, if there accepted such my changes.

              I don't have the last word, but your patch sounds interesting for other users, so I see a high chance of getting accepted.

              All contributions to Qt have to go through Gerrit. Don't get frightened, it looks like a big setup at first sight, but it's rather straigthforward.

              If you have questions in that process, don't hesitate to ask here!

              Regards

              I Offline
              I Offline
              iss7gli7
              wrote on last edited by
              #6

              @aha_1980
              Ok, thanks. But while I have mistake somewhere. Replace #include all work fine, but after in snapshot() collection of Document remain duplicate of file with previous path and in some cases it shows. When I fix it bag and other if has another, I will contribute it.

              1 Reply Last reply
              1
              • aha_1980A aha_1980

                Hi @iss7gli7,

                cool!

                I post it here a little bit later, if it interestingly. This feature is quite convenient.
                I can make patch for official addition, if there accepted such my changes.

                I don't have the last word, but your patch sounds interesting for other users, so I see a high chance of getting accepted.

                All contributions to Qt have to go through Gerrit. Don't get frightened, it looks like a big setup at first sight, but it's rather straigthforward.

                If you have questions in that process, don't hesitate to ask here!

                Regards

                I Offline
                I Offline
                iss7gli7
                wrote on last edited by
                #7

                @aha_1980
                Hi, I did it again, and solve all errors, except my poor English).
                I try push it to Gerrit, but it says:

                remote: error: branch refs/heads/master:        
                remote: To push into this reference you need 'Push' rights.        
                remote: User: (my email)
                remote: Contact an administrator to fix the permissions        
                remote: Processing changes: refs: 1, done            
                To ssh://codereview.qt-project.org/qt-creator/qt-creator
                 ! [remote rejected]       master -> master (prohibited by Gerrit: not permitted: update)
                error: failed to push some refs to 'ssh://codereview.qt-project.org/qt-creator/qt-creator'
                The command "/usr/bin/git" terminated with exit code 1.
                

                What I need to do for the push?

                In documentation "Setting up Gerrit" mentioned the init-repository script, but not says what it is. I simply did "git clone ..." and setting up connection, user and SSH.
                Through "ssh codereview.qt-project.org gerrit stream-events" it connected.

                In message says, that I need contact to an administration, but where is button for it?

                jsulmJ aha_1980A 2 Replies Last reply
                0
                • I iss7gli7

                  @aha_1980
                  Hi, I did it again, and solve all errors, except my poor English).
                  I try push it to Gerrit, but it says:

                  remote: error: branch refs/heads/master:        
                  remote: To push into this reference you need 'Push' rights.        
                  remote: User: (my email)
                  remote: Contact an administrator to fix the permissions        
                  remote: Processing changes: refs: 1, done            
                  To ssh://codereview.qt-project.org/qt-creator/qt-creator
                   ! [remote rejected]       master -> master (prohibited by Gerrit: not permitted: update)
                  error: failed to push some refs to 'ssh://codereview.qt-project.org/qt-creator/qt-creator'
                  The command "/usr/bin/git" terminated with exit code 1.
                  

                  What I need to do for the push?

                  In documentation "Setting up Gerrit" mentioned the init-repository script, but not says what it is. I simply did "git clone ..." and setting up connection, user and SSH.
                  Through "ssh codereview.qt-project.org gerrit stream-events" it connected.

                  In message says, that I need contact to an administration, but where is button for it?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @iss7gli7 It is explained here: https://wiki.qt.io/Building_Qt_5_from_Git

                  $ cd qt5
                  $ perl init-repository
                  

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  aha_1980A 1 Reply Last reply
                  0
                  • I iss7gli7

                    @aha_1980
                    Hi, I did it again, and solve all errors, except my poor English).
                    I try push it to Gerrit, but it says:

                    remote: error: branch refs/heads/master:        
                    remote: To push into this reference you need 'Push' rights.        
                    remote: User: (my email)
                    remote: Contact an administrator to fix the permissions        
                    remote: Processing changes: refs: 1, done            
                    To ssh://codereview.qt-project.org/qt-creator/qt-creator
                     ! [remote rejected]       master -> master (prohibited by Gerrit: not permitted: update)
                    error: failed to push some refs to 'ssh://codereview.qt-project.org/qt-creator/qt-creator'
                    The command "/usr/bin/git" terminated with exit code 1.
                    

                    What I need to do for the push?

                    In documentation "Setting up Gerrit" mentioned the init-repository script, but not says what it is. I simply did "git clone ..." and setting up connection, user and SSH.
                    Through "ssh codereview.qt-project.org gerrit stream-events" it connected.

                    In message says, that I need contact to an administration, but where is button for it?

                    aha_1980A Offline
                    aha_1980A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi @iss7gli7,

                    for Gerrit, the command is git push origin HEAD:refs/for/master.

                    Or you can use Creators Push to Gerrit dialog.

                    Regards

                    Qt has to stay free or it will die.

                    I 1 Reply Last reply
                    2
                    • jsulmJ jsulm

                      @iss7gli7 It is explained here: https://wiki.qt.io/Building_Qt_5_from_Git

                      $ cd qt5
                      $ perl init-repository
                      
                      aha_1980A Offline
                      aha_1980A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @jsulm yeah, but the OP works on Creator, not Qt itself.

                      Qt has to stay free or it will die.

                      1 Reply Last reply
                      0
                      • aha_1980A aha_1980

                        Hi @iss7gli7,

                        for Gerrit, the command is git push origin HEAD:refs/for/master.

                        Or you can use Creators Push to Gerrit dialog.

                        Regards

                        I Offline
                        I Offline
                        iss7gli7
                        wrote on last edited by
                        #11

                        @aha_1980
                        Thanks, I solve it also.
                        Through command line git was more verbose, and says what I need.
                        Only command was git push gerrit HEAD:refs/for/master
                        In result:
                        https://codereview.qt-project.org/c/qt-creator/qt-creator/+/275376

                        aha_1980A 1 Reply Last reply
                        1
                        • I iss7gli7

                          @aha_1980
                          Thanks, I solve it also.
                          Through command line git was more verbose, and says what I need.
                          Only command was git push gerrit HEAD:refs/for/master
                          In result:
                          https://codereview.qt-project.org/c/qt-creator/qt-creator/+/275376

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @iss7gli7 ah, your remote is called gerrit instead origin.

                          Glad you solved it!

                          Qt has to stay free or it will die.

                          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