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



  • 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!



  • [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.



  • 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?



  • 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.



  • 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.



  • 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.


  • Moderators

    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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.