#pyqt | Logs for 2018-09-14

Back
[01:22:13] -!- kushal has quit [Remote host closed the connection]
[01:24:43] -!- kushal has joined #pyqt
[21:18:05] -!- logs has joined #pyqt
[22:30:03] -!- daniel-molina has joined #pyqt
[22:31:20] <daniel-molina> I want to get dead keys from keyPressEvent, but it seems that it is not easy
[22:31:53] <daniel-molina> the best answer I found on the internet is this https://stackoverflow.com
[22:32:07] <altendky> daniel-molina: what are dead keys?
[22:32:20] <daniel-molina> this one in particular: ^
[22:32:30] <daniel-molina> in my keyboard (es)
[22:32:48] <daniel-molina> I need a combination of keys for getting them
[22:33:42] <daniel-molina> in the english keyboard to get that key is not a problem
[22:34:02] <altendky> daniel-molina: so not a key but a character
[22:34:16] <daniel-molina> yes
[22:34:43] <altendky> daniel-molina: and what widget do you want to detect this with? What's the scenario?
[22:35:24] <daniel-molina> for example QMainWindow
[22:37:01] <altendky> daniel-molina: so you want a global shortcut... That's hard to type?
[22:38:39] <daniel-molina> I want to catch it through event.text()
[22:38:52] <daniel-molina> this is the code I use as example
[22:39:03] <daniel-molina> http://dpaste.com
[22:40:06] <altendky> daniel-molina: you don't want a shortcut?
[22:41:01] <daniel-molina> no, I want to know when the user introduced the character as s/he was typing in a text entry
[22:41:21] <altendky> daniel-molina: and you can't monitor it for changes and check?
[22:41:38] <altendky> daniel-molina: and wouldn't you catch that in the edit not the main window?
[22:41:52] <altendky> daniel-molina: the edit would presumably be consuming the event
[22:41:55] <altendky> (I think)
[22:43:09] <daniel-molina> I know that the character appears in QInputDialog.getText, for example
[22:44:02] <altendky> daniel-molina: have you tried to catch it in a line edit widget rather than main window?
[22:44:24] <daniel-molina> I will try
[22:44:40] <altendky> daniel-molina: what is your real scenario? You've said main window, input dialog, text entry
[22:44:53] <altendky> daniel-molina: and what are you going to do if you catch it?
[22:45:35] <daniel-molina> I want to execute a function when I get that key
[22:46:13] <altendky> daniel-molina: right, but what is the functionality? What is the feature from the user perspective?
[22:46:46] <daniel-molina> Pressing the key ^, the user will be able to set a superscript in the equation that he is editing
[22:47:59] <altendky> daniel-molina: and what widget are you implementing this in?
[22:48:22] <altendky> daniel-molina: and have you searched for an existing equation editor widget? Including in c++
[22:50:03] <daniel-molina> it is a QLabel that loads the image of the equation
[22:50:11] <daniel-molina> no, I didn't
[22:55:38] <altendky> daniel-molina: I would also try catching in a line edit, something that captures the text. Even if the key press event doesn't work, you might be able to do it via text change and sneak that behind the label or somesuch. Sorry I don't have a better answer yet
[22:56:05] <daniel-molina> ok, thanks anyway
[23:06:49] -!- kallesbar has joined #pyqt
[23:16:09] -!- daniel-molina has quit [Ping timeout: 252 seconds]
[23:17:01] <altendky> daniel-molina: good luck, let me know if you figure anything out or have other questions. I'm imagining that worst case they type in an invisible text edit and you just process the characters from there
[23:33:16] -!- mintograde has quit [Ping timeout: 246 seconds]
[23:42:02] -!- delipickle has joined #pyqt
[23:49:53] -!- mintograde has joined #pyqt
[23:58:47] -!- mintograde has quit [Ping timeout: 240 seconds]