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. Ability to 'lock' Qt classes in Qt Creator to prevent accidental rename

Ability to 'lock' Qt classes in Qt Creator to prevent accidental rename

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 4 Posters 3.5k 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.
  • S Offline
    S Offline
    styne666
    wrote on last edited by
    #1

    Is there a feature which you can turn on to prevent accidental renaming of a Qt Class in Qt Creator? I know it sounds rather stupid, but I accidentally did a CTRL+SHIFT+R(ename) on a QString (I'm not fully awake) and changed every occurrence including the ones in the Qt source to a QStringList. This seems like the kind of thing which should really be disabled in Qt Creator unless you're working in something like a 'Qt dev mode'? Mainly because I can't see an easy way to 'undo' this edit without a reinstall!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      [quote author="styne666" date="1321950905"]Is there a feature which you can turn on to prevent accidental renaming of a Qt Class in Qt Creator? I know it sounds rather stupid, but I accidentally did a CTRL+SHIFT+R(ename) on a QString (I'm not fully awake) and changed every occurrence including the ones in the Qt source to a QStringList.[/quote]

      Remove the keyboard shortcut for RenameSymbolUnderCursor.

      [quote author="styne666" date="1321950905"]This seems like the kind of thing which should really be disabled in Qt Creator unless you're working in something like a 'Qt dev mode'? Mainly because I can't see an easy way to 'undo' this edit without a reinstall![/quote]

      Make files you do not want to modify accidentally read-only. I do not like the concept of an additional "Qt developer mode". But I could cotton up to an option to prevent Qt files from beeing modified.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        styne666
        wrote on last edited by
        #3

        Not quite: I don't want to disable refactoring, just prevent the refactoring of Qt classes.

        And your proposed solution is not what I would call a solution, rather, a work around. I suspect most people installing Qt Creator do not want to modify the Qt headers. Therefore the ability to edit the Qt headers installed with Creator should be blocked by default, wouldn't you agree?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          Of course it is, or both are, a workaround - for the simple fact that there is no such functionality yet.

          It would make sense having such a feature but I wouldn't call it "Qt Development Mode" because I find it quite confusing - in the end we are all "Qt Developers" no matter if we are working with or on it. "Prevent pre-installed files from beeing modified" is technically the same, but much less confusing.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            Qt Creator already provides a preview of the changes that would have been made. ~11,000 matches would be alarming to me...

            I'm not decided if it's a task of Creator to decide what should be changed and what not. To prevent such catastrophes I would advocate for setting the headers to read only by the installer.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • S Offline
              S Offline
              styne666
              wrote on last edited by
              #6

              I personally don't sift through all the proposed re-factoring results unless I predict that there might be some questionable refactors. I agree it's not something which may not happen often, but when it does, it's a right pain in the rump.

              As for implementation of feature, file locks would be one way of doing it. I have proposed it "here":https://bugreports.qt.nokia.com/browse/QTCREATORBUG-6598 anyway.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                tobias.hunger
                wrote on last edited by
                #7

                I agree with Leandro closing the feature request: That is too intrusive to implement for very little gain.

                But I do think that you have a valid point there, so I opened "another feature request":https://bugreports.qt.nokia.com/browse/QTSDK-1121 with our Qt SDK team to install the headers read-only by default. I hope that is OK with you.

                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