#pyqt | Logs for 2019-02-21

Back
[00:32:38] <hazzy-m> hello, its been a while since I bugged you all :)
[00:33:32] <hazzy-m> I have a custom designer plugin that has a pyqtProperty with type str
[00:37:50] <hazzy-m> this property holds JSON formatted "rules" that are used by the widget, the problem is that uic tries to translate the property since it is a string, so it sets the propery in the retranslateUi method of the generated python code rather than in setupUi, where I want it
[00:38:42] <hazzy-m> if I uncheck the translatable property in designer it works how I want, but normaly this is not a designatable propert so there is no way of doing that
[00:39:19] <hazzy-m> any advice on how I would set the translatable property from code rather than in designer?
[00:40:34] <hazzy-m> here is the code in question: https://github.com
[01:45:29] -!- lee_76 has quit [Ping timeout: 255 seconds]
[02:07:36] -!- minto has quit [Ping timeout: 250 seconds]
[02:31:37] -!- a-l-e has joined #pyqt
[02:32:07] <a-l-e> hi, i have opened a ticket for pybind11... but it might be a pyqt bug... i don't know:
[02:32:13] <a-l-e> https://github.com
[02:32:34] <a-l-e> anybody around who uses both pybind11 and qt5?
[02:37:21] * a-l-e is installing pyside2 and see if the bug happens with it, too...
[03:42:23] -!- kdas_ has joined #pyqt
[03:42:43] -!- kushal has quit [Remote host closed the connection]
[04:15:33] -!- kushal has joined #pyqt
[04:16:45] -!- kdas_ has quit [Ping timeout: 256 seconds]
[05:21:40] <n1`> theoretical question... is it possible to wrap up foreign app/window and add some functionality?
[05:22:04] <n1`> i would like to wrap up whole crappy Spotify app and add tray icon with some controls.
[05:24:34] -!- BPL has joined #pyqt
[05:56:39] -!- Grange has joined #pyqt
[05:57:46] <Grange> Hi all. Anyone ever made a slider with labels attached to ticks? I tried using a grid layout but it only seems to work for a small number of ticks with a small sized slider.
[05:58:50] <Grange> I found a couple of hack subclassing paintEvent() but all in c++, which I'm having a hard time understanding.
[06:46:53] -!- kushal has quit [Remote host closed the connection]
[06:47:26] -!- kushal has joined #pyqt
[07:04:59] -!- Grange has quit [Remote host closed the connection]
[08:37:33] -!- Siecje has joined #pyqt
[10:35:18] -!- TechSmurf has quit [Ping timeout: 264 seconds]
[10:44:18] -!- TechSmurf has joined #pyqt
[11:09:28] <Avaris> n1`: nothing in qt, afaik. but if the spotify accepts keyboard shortcuts, you might emulate those with some os-level stuff from python (there from from pyqt)
[11:09:50] <Avaris> (*therefore from pyqt)
[11:10:42] -!- TechSmurf has quit [Ping timeout: 264 seconds]
[11:18:19] <n1`> :/
[11:18:35] <n1`> well maybe i can create api widget instead
[11:19:01] <altendky> if there's an api option, absolutely do that over gui automation
[11:20:54] <n1`> yup there is...reading now the docs
[11:21:14] <n1`> wel... i have no idea if anyone would appreciate small tray app to control spotify
[11:21:37] <altendky> i assume you are thinking about it because you would :]
[11:21:39] <n1`> i would...buy it seems to be a bit overkill to develop that just for myself
[11:22:23] <n1`> well...i have tons of ideas...if i should code every idea i have i would have to release and app every day :)
[11:22:24] <Avaris> doesn't the official spotify app do that?
[11:22:40] <n1`> Avaris: nah...official spotify app is electron crap
[11:23:07] <Avaris> :S, first thing i would implement is at least play/pause/next/prev in systray
[11:23:43] <n1`> Avaris: also... if someone like me has multiple desktops or even screens its pain in the ass to find the running app to stop the music
[11:24:18] <Avaris> though, keyboards now have media keys... usually
[11:26:25] <Avaris> so... looks like they have a web api to control desktop (or any actually) client. weird but neat at the same time
[11:27:11] <n1`> Avaris: yes...thats what i would like to do.... maybe if i could code some cool core then we could buid widgets like this one
[11:27:13] <n1`> https://linux-cdn.softpedia.com
[11:27:20] <n1`> upper right corner
[11:28:13] <altendky> Avaris: handy when streaming. worthless when offline. :|
[11:28:48] <altendky> (unless it's like a distributed system where you can connect to a local http server from the spotify app that's running)
[11:33:55] <Avaris> offline as in no internet or listening downloaded content?
[11:34:22] <altendky> no internet (and therefore listening to downloaded content)
[11:34:39] <altendky> (or, wishing you were but your play button just gives a connection error)
[11:34:59] <altendky> not saying i don't like the feature, sounds great
[11:35:48] * n1` seriously thinking about the app
[11:36:37] <altendky> have to query a list of controllables. let the user select. then submit a few http requests. sounds pretty straightforward. (oh, authentication of course)
[11:36:47] <altendky> so, what, 5 months? :]
[11:37:30] <altendky> n1`: do be sure the backend is not-gui (preferably not even qt in my opinion). so you can have a cli client as well
[11:38:06] <n1`> well im thinking about "lib" app and then "gui" app
[11:38:33] <altendky> https://pypi.org
[11:38:36] <n1`> something like spotify-py and then spotify-tray
[11:38:38] <altendky> anything actually useful in the list?
[11:38:55] <altendky> oh come on, spotipy
[11:39:15] <n1`> altendky: seems like no... some old craps but spotipy seems kinda up to date
[11:39:42] <altendky> of course, already taken...
[11:39:46] <n1`> :)
[11:40:05] <n1`> seems like that library could take the "lib" place in our story
[11:42:00] -!- AbleBacon has joined #pyqt
[11:48:22] <hazzy-m> altendky: any idea how I can set str pyqtProperties non translatable? I need something like the objectName property in designer
[11:49:01] <altendky> hazzy-m: i don't know translation. you have an application doing translation but you want this pyqtproperty to not have that applied?
[11:50:47] <hazzy-m> I don't need any translation, but uic translates all string properties, and I don't want it to
[11:51:57] <altendky> https://forum.qt.io ?
[11:52:11] <altendky> the translatable property of the property?
[11:58:14] <hazzy-m> Yes exactly, but my property is not exposed in designer, so there is no way to unckeck "translatable" (nor would that be convenient)
[11:59:08] <hazzy-m> I would think there is a way to set the property non translatable when defining it
[12:01:01] <hazzy-m> I am trying to achieve the same behavior as the objectName property
[12:01:59] <altendky> hazzy-m: do you know how to get through the descriptor interface to the actual descriptor object so you can look at them?
[12:02:16] <altendky> i think TheClass.the_property will work, but if not, i think inspect as a thing
[12:02:28] <altendky> might get lucky and be able to see something there
[12:03:35] <altendky> https://docs.python.org
[12:08:27] <hazzy-m> Thanks!
[12:22:06] <Avaris> hazzy-m: if it's not exposed in the designer, how do you create it and how does uic wrap it? i'm confused
[12:36:14] <hazzy-m> Avaris: The property holds a JSON formatted string, and is editable in designer via a custom edit dialog accessed thru the task menu
[12:36:39] <hazzy-m> Since I don't want users trying to edit the JSON directly I have set the properties designable argument to False, so it does not show up in the property editor, but is still stored in the XML file
[12:37:05] <hazzy-m> here is the dialog for editting the property: https://i.imgur.com
[12:37:38] <hazzy-m> I am somewhat proud of it :)
[12:46:26] <Avaris> imgur is blocked for me
[12:47:01] <Avaris> but .ui xml marks non-translatable values as `<string notr="true">asd</string>`
[12:48:08] <Avaris> and pyuic seems to respect that
[12:51:07] <hazzy-m> yes, but I can't find a way to set notr="true"
[12:51:30] <altendky> hazzy-m: were you able to get at the pyqtProperty obejcts to explore their attributes?
[12:51:41] <altendky> (though i suppose looking at source might be better...)
[12:55:40] <hazzy-m> altendky: yes, but I didn't see any think that looked promising
[12:55:41] <hazzy-m> I am starting to think it does not have anything to do with the proprieties, but with the way designer handles them
[12:55:43] <hazzy-m> https://doc.qt.io
[12:56:26] <hazzy-m> that has the setTranslatable(bool) that I am looking for
[12:58:12] <hazzy-m> so looks like I need to add a PropertySheetExtension so I can manipulate the property's translatable flag
[13:24:14] -!- TechSmurf has joined #pyqt
[13:26:38] -!- a-l-e has quit [Ping timeout: 244 seconds]
[14:25:00] -!- a-l-e has joined #pyqt
[16:36:57] -!- a-l-e has quit [Ping timeout: 246 seconds]
[16:53:54] -!- mintograde has joined #pyqt
[17:00:57] -!- Siecje has parted #pyqt
[17:27:57] <BPL> I wanted to port some c++ code that inherits from QSharedData to python but this hasn't been wrapped with sip. By looking very briefly the code itself https://code.woboq.org it seems that class is yet another implementation of a smart pointer... In the docs says "QSharedData provides thread-safe reference counting." . Anyway, trying to decide what's the best replacement here... the first
[17:27:57] <BPL> idea that comes to my mind is just using python "object" :/ , thoughts?
[17:42:07] -!- AbleBacon has quit [Quit: Leaving]
[19:25:59] -!- BPL has quit [Read error: Connection reset by peer]
[20:50:33] -!- stochastix has joined #pyqt
[22:15:18] -!- mintograde has quit [Ping timeout: 250 seconds]
[22:44:18] -!- TechSmurf has quit [Ping timeout: 264 seconds]