How to disable auto search highlighting in Qt Creator?



  • Hello,

    I am using C++ with Qt Creator. When I click on a word in the code it highlights all other occurrences of this word.

    How do I disable this behavior? I did search all of the Text Editor Options.

    THX!



  • I do not think that there is a configuration option for this. I really like this feature as it allows you to easily spot typos in variable names etc.

    I especially like the renaming feature that is coupled to it. Try pressing Ctrl-Shift-R and edit the name then hit enter - all occurrences will be renamed at once.


  • Moderators

    Actually it does not highlight the word but all occurances of a variable. There should not be any highlights outside of the scope you are currently in (even if the current variable is shadowing another variable of the same name).



  • That's correct.

    How can I disable that?


  • Moderators

    I am not aware of any option to turn this off.

    You can most likely adjust the color to be less obvious though, but that will of course not stop the look ups themselves from happening.



  • What is the setting to adjust the color so I could just hide it?

    I tried few, such as Occurrences but could not find it.

    Thanks!



  • Any changes since then? It's really annoying feature.



  • [quote author="vincegata" date="1308662180"]
    I tried few, such as Occurrences but could not find it.

    [/quote]

    Occurrences is working for me: if I change the color scheme of occurrences I can see that each variable I place the mouse onto is painted in such way.



  • Not that I am aware of, and I disagree: I think it is a great feature.



  • [quote author="Andre" date="1322570788"]I think it is a great feature. [/quote]

    So do I. If an highlight is not what you need or what you are searching for than e plain old editor could be your friend.



  • [quote author="Andre" date="1322570788"]Not that I am aware of, and I disagree: I think it is a great feature. [/quote]

    Well I agree that it is NOT. It's very annoying. QT Creator is a great IDE and ability to disable these all "blink-blank" spangles could make it even greater.



  • One reason why this is useful is that it allows you to see if all the highlighted words are what you mean they are. Suppose you write a variable named "myString" and on another line you have "mystring", having a glance to the fact that the two are not enlighten the same is an hint that there is a possible problem. Even better is the behavior of KDevelop, that assigns to each variable a different color to help preventing misspelled errors.



  • I am not discussing if it is usefull or if it is not. I am discussing why i can't turn it off. I know what I am writing in code and what I am reading from it. I can't remember such a case where I had a problem with mispelled variables (If I ever had one - compiler quickly solves the problem). Such a highlights maybe usefull for 5 year old kid when he is not sure what he is writing and what he is reading, but for expierenced programmer like me these all "blink-blank's" only disturbs and nothing more. I tried to turn it off through syntax highlight - no success, so I am asking maybe i could turn it off somewhere in configuration files. That's all.



  • [quote author="itech" date="1349419560"]Such a highlights maybe usefull for 5 year old kid when he is not sure what he is writing and what he is reading, but for expierenced programmer like me these all "blink-blank's" only disturbs and nothing more.[/quote]

    Well, let's say that QtCreator does that because QtCreator's developers, that I guess are talented and experienced, thought it was an useful feature. Having said that, if you are a so experienced developer, you will surely be able to use another IDE, like Eclipse or even a real editor, like Vi or Gnu Emacs.
    Moreover, while it is true that the compiler can catch (and surely has to) syntax errors, the trip to the compiler could be time expensive in the case of large projects, and this is why I strongly believe that any editor/IDE that can help you before you have to pass the toolchain is a good added value.



  • [quote author="fluca1978" date="1349420294"]Having said that, if you are a so experienced developer, you will surely be able to use another IDE, like Eclipse or even a real editor, like Vi or Gnu Emacs.[/quote]

    Surely I am using several of these when there is need and I am repeating once more that I am not asking about other IDE suggestions nor is this feature usefull or not, I am asking maybe someone know how to turn it off. If you know the answer you may say that you I can do it here or here, or I can't. That's all.



  • Go to the editing options, select the occurences line and change the background color to something very close to white (or you background text color), but not fully white. You will dim the effect. I don't believe you can remove this behavior.



  • Already tried this with no success.



  • I did on my Qt Creator 2.5 on Linux and it worked fine, and now I don't have the light around words, or better there is still an almost invisible frame around words that I cannot see until I get close to the monitor.



  • I have Qt Creator 2.41/Linux. Maybe that's the reason I could not see any changes. I'll check it out. Thanks!



  • I see this is old but found it searching for a solution to the same problem. Here's what I just discovered: Apparently the code does something clever if it thinks you haven't set the color - not only if you've set to default but also if the colors match. So you have to set the colors almost, but not exactly, like the default colors. This will make it so faint that it's much less irritating.


  • Qt Champions 2016

    On windows, it is only a while box/frame and
    barely noticeable so I wonder what you see?


Log in to reply
 

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