I wrote the following code to display 'σ' in my UI menu. But, instead 's' is shown in the UI menu.
Code :
Qt Code:To copy to clipboard, switch view to plain text mode
I wrote the following code to display 'σ' in my UI menu. But, instead 's' is shown in the UI menu.
Code :
Qt Code:To copy to clipboard, switch view to plain text mode
Last edited by babygal; 21st October 2010 at 08:31.
You code looks strange. In createMenu you create an action and in createActions you create a menu Anyway, you probably have in stalled a translator? Try without tr(). Second, try to display σ without & and see if it is displayed correctly. Also make sure your file is encoded with utf8.
The action is created in createActions
Franco Amato
What is "&σ" supposed to do? If you're trying to insert a character literal, you need the ampersand followed by the character code, not the character.
babygal (25th October 2010)
Ehm, thanks for that useful comment. If you would have compared the time stamp of my answer with the time stamp of the edit of babygal you would have noticed that the original comment was altered and corrected! Anyway, nice move of you babygal!
The & makes the action "selectable" with the keyboard. It underlines the character and thus it indicates which key to press to activate the action.
Yes, but it doesn't allow you to insert non-ASCII characters into a string or display element. You typically have to use the character code for such characters.
The code has to be directly accessible via keyboard. If there is no combination of keys that will output a sigma character then making it an accelerator doesn't make much sense.
Bookmarks