Remove "Insert Unicode control character" from QTextEdit context
Hello,
I noticed that the context menu of a QTextEdit has an extra menu at the bottom - "Insert Unicode control character" and it has 10 items:
- LRM Left-to-right mark
- RLM Right-to-left mark
- ZWJ Zero width joiner
- ZWNJ Zero width non-joiner
- ZWSP Zero width space
- LRE Start of left-to-right embedding
- RLE Start of right-to-left embedding
- LRO Start of left-to-right override
- RLO Start of right-to-left override
- PDF Pop directional formatting
I find it kinda annoying since I haven't seen such a thing in any program before. I must admit - I don't really like it and I just can't find a way to get rid of them? I know I could reimplement my own context menu which is the exact same (except those unicode control character thingies) but it's kinda pointless? There has got to be some other solution?
I'm using Qt 4.2.1 on Windows XP SP2.
Any clue?
Thanks in advance!
Re: Remove "Insert Unicode control character" from QTextEdit context
It's probably caused by some accessibility plugin or something like that. I also have it under Linux but I'm in that happy situation that I don't find it annoying :)
Edit: removing accessibility plugins did not help, so it's probably something different...
Re: Remove "Insert Unicode control character" from QTextEdit context
I looked into the qtextview.cpp and you can find it at the very bottom. It has its own class QUnicodeControlCharacterMenu which is derived from QMenu.
There are no macros or whatsoever to turn it on/off so it's kinda like hard coded into it.
So what am I supposed to do now? I just don't see any other programs having these entries in text edit context menues and in my opinion the majority of users doesn't even know what that is good for (actually, I don't even know why an average user would need THAT).
Re: Remove "Insert Unicode control character" from QTextEdit context
If it's there then probably many people were asking for it or it's part of some standard. I suggest you ask the Trolls if there is any possibility to turn this off other than recompiling the library itself (that's always an option and I'm sure in that situation you can safely use that option - you won't hurt others and you'll stop being annoyed by that menu). My guess is that it is being used with non-latin alphabets or Right-To-Left languages.
Re: Remove "Insert Unicode control character" from QTextEdit context
I've the same problem, someone have an idea on this issue ?
Re: Remove "Insert Unicode control character" from QTextEdit context
It's easy.
First open gui/text/qtextcontrol.cpp and search for "QUnicode" and comment these three lines out:
Code:
menu->addSeparator();
QUnicodeControlCharacterMenu *ctrlCharacterMenu = new QUnicodeControlCharacterMenu(this, menu);
menu->addMenu(ctrlCharacterMenu);
Now open gui/widgets/qlineedit.cpp and there's a similar code which you need to comment out:
Code:
popup->addSeparator();
QUnicodeControlCharacterMenu *ctrlCharacterMenu = new QUnicodeControlCharacterMenu(this, popup);
popup->addMenu(ctrlCharacterMenu);
Now simply recompile QtGui and you're done :)
Re: Remove "Insert Unicode control character" from QTextEdit context
Quote:
Originally Posted by
durbrak
I looked into the qtextview.cpp and you can find it at the very bottom. It has its own class QUnicodeControlCharacterMenu which is derived from QMenu.
There are no macros or whatsoever to turn it on/off so it's kinda like hard coded into it.
So what am I supposed to do now? I just don't see any other programs having these entries in text edit context menues and in my opinion the majority of users doesn't even know what that is good for (actually, I don't even know why an average user would need THAT).
You can interprete the right click functionality.
... and BTW, I use that menu :)
Re: Remove "Insert Unicode control character" from QTextEdit context
Sorry, I don't get it. You can do what? "...interpret the right click functionality" ?!
Re: Remove "Insert Unicode control character" from QTextEdit context
when you click the mouse on the widget, an event is risen, right?
just catch that event (subclass and reimplement event()), and don't call the parent method.
See:
http://doc.trolltech.com/4.4/qwidget.html#event or http://doc.trolltech.com/4.4/qwidget...ousePressEvent
Re: Remove "Insert Unicode control character" from QTextEdit context
Huh? Wouldn't I end up with no context menu at all? I'd also have to do it for every QLineEdit/QTextEdit widget in my applications.
So, what are you using those Unicode-Control-Characters in the context menu for anyway?
Re: Remove "Insert Unicode control character" from QTextEdit context
If user has chosen OS language other than English (specially like Hebrew, Chinese or Japanese), the "Insert Unicode control character" menu item will be displayed to support some Unicode operation.
If you will choose English as your OS language, the "Insert Unicode control character" menu item will not be displayed.
I am using Qt 5.1 and Windows 7.