#pyqt | Logs for 2018-11-07
Back
[00:10:43] -!- Mrokii_ has joined #pyqt
[00:11:14] -!- Mrokii_ has quit [Client Quit]
[00:12:16] -!- Mrokii has quit [Ping timeout: 246 seconds]
[01:52:39] -!- kushal has quit [Ping timeout: 256 seconds]
[01:54:09] -!- kushal has joined #pyqt
[02:35:18] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[02:35:41] -!- Belxjander has joined #pyqt
[02:54:45] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[02:55:17] -!- Belxjander has joined #pyqt
[03:09:15] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[03:09:39] -!- Belxjander has joined #pyqt
[03:20:22] -!- kallesbar has joined #pyqt
[04:05:57] -!- richar_d has joined #pyqt
[04:15:26] <richar_d> I have a couple of (non-urgent) questions that I hope someone can answer: 1. why does pyqtdeploy always pass `-commercial` when building Qt? how do I pass `-opensource` instead? 2. is it necessary for pyqtdeploy to recompile Qt every time you use it?
[04:32:38] -!- anqxyr has joined #pyqt
[04:32:39] -!- JT-Shop has quit [Read error: Connection reset by peer]
[05:48:44] -!- mintograde has joined #pyqt
[05:51:47] -!- Belxjander has quit [Ping timeout: 240 seconds]
[05:52:58] -!- Belxjander has joined #pyqt
[06:04:43] -!- richar_d has quit [Quit: richar_d]
[06:08:36] -!- richar_d has joined #pyqt
[06:42:44] -!- mintograde has quit [Ping timeout: 244 seconds]
[09:39:23] -!- Siecje has joined #pyqt
[10:33:59] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[10:34:35] -!- Belxjander has joined #pyqt
[12:10:36] <altendky> http://doc.qt.io "The default implementation treats Qt::EditRole and Qt::DisplayRole as referring to the same data" awesome... so since i am using the standard stuff for its no-python-in-the-model-view-loop aspect i'll now have to create my own c++ standard item inheriting class, override that behavior, then SIP it up? :| what fun
[12:11:35] <altendky> i like to show '-' (or maybe something else someday) for empty but editable cells leaving the non-editable cells actually blank
[12:14:27] <altendky> and the build instructions are saying to not use them due to sip5 changes http://pyqt.sourceforge.net -- http://pyqt.sourceforge.net
[12:15:27] -!- anqxyr has quit [Ping timeout: 240 seconds]
[12:26:27] <Avaris> altendky: what's wrong with using python in model-view?
[12:27:32] <altendky> Avaris: i admittedly haven't benchmarked my new stuff yet but i had performance issues and figured that hundreds or thousands of calls per second from the view back into my python model to get data and flags was the cause.
[12:27:52] <altendky> Avaris: flopping strings back and forth between python and c++ each time etc
[12:28:18] <Avaris> well... first question is, why do you have that many calls?
[12:28:25] <altendky> Avaris: i revisited performance a couple times a year for several years and have kept the application usable but it's insane
[12:29:24] <altendky> Avaris: incoming data off the bus updating quite often. also, the views don't cache anything so... they make a bunch of calls any time anything happens like a mouse cursor moving over the view
[12:29:44] <altendky> (but mostly the incoming data i suppose since the view doesn't even have to be displayed to have issues)
[12:29:57] -!- Lauxley has joined #pyqt
[12:30:15] <altendky> Avaris: it's honestly been awhile since i analyzed it. though i feel like we've talked through it before
[12:30:40] <Avaris> view don't need to cache, because they only query what's changed. are you sure you're emitting proper signals?
[12:31:23] <altendky> Avaris: naw, i don't buy that they only query what has changed. if that were the case then moving a cursor over them wouldn't trigger any queries (or at least not continue to do so)
[12:31:38] <Avaris> i.e. not doing modelReset or such for a couple of cell updates, instead dataChanged
[12:31:58] <altendky> Avaris: i revisited my data changed several times, so i certainly made effort to do it properly
[12:32:29] <altendky> Avaris: though one issue i had was emitting dataChanged for more than a single cell seemed to trigger a full update. so iirc i had it emitting separately for each changed cell
[12:32:49] <altendky> that was awhile back, might have been a bug, might have been fixed
[12:32:59] <Avaris> moving mouse over could cause query, sure. tooltips etc
[12:33:23] <altendky> Avaris: but if you say only querying 'changed data' then it should do that once and be done until it gets changed
[12:33:29] <altendky> pretty sure that isn't what i observed
[12:34:01] <Avaris> there are other cases. if you cause a redraw, then it'll query again
[12:34:07] <altendky> i've been kind of wanting to get into writing my own qt c++ wrapped into python anyways, shouldn't be a big deal.
[12:34:21] <altendky> Avaris: then isn't it querying for not-changed data like i said?
[12:34:51] <altendky> Avaris: iirc i would emit changed for a single role and it would query back about several other roles.
[12:35:07] <Avaris> those should be minor though. if that adds up to hundreds of thousands then there is some other issue
[12:35:41] <altendky> Avaris: i think the number was in the thousands. i've got hundreds of data points per second coming in to update in the gui
[12:36:29] <altendky> Avaris: the other interest was not having to think about any of these details. just stick an item where i want it and update it's value when i have a new value for it
[12:36:58] <altendky> Avaris: The-Compiler said they saw significant performance gains going to a standard item model (sure, that's a vague claim)
[12:37:14] <Avaris> that's definition of a model :)
[12:37:28] <Avaris> going to from what?
[12:37:29] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[12:37:41] <Avaris> abstractitemmodel?
[12:37:43] <altendky> Avaris: some custom abstract model i'd think?
[12:37:51] -!- Belxjander has joined #pyqt
[12:37:56] <altendky> Avaris: again, it's been awhile since my last pass at that stuff
[12:38:24] <altendky> i just last week replaced it (in some of my uses) with a standard item model. just swapped backends on my attrs-defined qt-model-creation stuff
[12:38:34] <Lauxley> Hello, I'm trying to setup a drag & drop where the dragging start on a click (no need to keep button pushed) and end on another click, is it feasible easily or is it going to be too hard ?
[12:38:43] <Avaris> any improvement on performance?
[12:39:20] <Avaris> Lauxley: what's dragged?
[12:39:33] <altendky> Avaris: i think so, but i was only using my attrsmodel in my static data editor, not in my dynamic cpu hog gui. so, i'll have to port it over at some point (or make a generic benchmark to compare)
[12:40:20] <Lauxley> right now it's a button but i'm wondering if i should even approach that as a drag & drop
[12:41:48] <Avaris> Lauxley: maybe the better question is what are you (trying to) do? :)
[12:42:33] <Avaris> altendky: i'm curious, my use of models weren't really heavy on updates. so i wasn't particularly concerned with performance
[12:43:25] <altendky> Avaris: i'm curious too... need to benchmark
[12:43:29] <Lauxley> Avaris, its a simple game i'm doing to learn pyqt, i'm trying to click on an attack and highlight possible targets and 'drop' the attack on one of those targets
[12:44:02] <Lauxley> Avaris thx for helping btw, its a learning tool so not critical that i succeed to do exactly what i want
[12:44:27] <altendky> Lauxley: just hold the state that you selected the attack and handle it when they click again. unless you want drag and drop then use 'real' drag and drop (with the button held down)
[12:44:29] <Avaris> Lauxley: yeah doesn't sound much like drag&drop
[12:45:45] <Lauxley> altendky, Avaris thing is drag & drop had some tools that i used event.source() and setPixmap()
[12:46:22] <Avaris> nah, play with mouse pointers
[12:46:48] <Avaris> also, event.source() isn't something you should use unless you have to
[12:47:50] <Lauxley> why ? other option is to serialize a bunch of stuff that i don't really want to
[12:48:01] <altendky> Lauxley: when the button is clicked set self.selected_attack to whatever. when they click somewhere else check if an attack is selected and if so apply it. obviously it gets more complicated with other activities as well, but still easier than drag and drop i'd think
[12:48:40] <altendky> Lauxley: or, don't use drag and drop :] since you don't really want the gui features of it and it is a very general mechanism meant even for inter-process stuff
[12:49:08] <Avaris> http://doc.qt.io
[12:49:33] <Avaris> Lauxley: event.source() leads to bad code usually :)
[12:50:50] <altendky> Lauxley: you might later want to be able to drag an 'attack' or other action around. as in, apply it over an area. draw a ring of fire around the enemy. drag and drop will only let you do that one thing
[12:50:53] <altendky> drop
[12:51:48] <Lauxley> ok guys i hear you i'll leave drag&drop behind
[12:51:50] <Lauxley> thx a bunch
[12:53:16] <Lauxley> just have to figure out where to store that state now
[12:53:44] <altendky> Lauxley: presumably you have other game state to store?
[12:53:47] <Avaris> on cursor? :)
[12:54:57] <Lauxley> yes i have different game states at different levels
[13:12:23] -!- mcon has joined #pyqt
[13:13:28] <mcon> Is it possible to use the "new" Qt WebGL backend with PyQt? if so: how?
[13:14:02] <altendky> mcon: how do you use it with c++?
[13:15:24] <mcon> altendky: no, I have a normal PyQt application and I would like to be able to access it remotely.
[13:16:19] <altendky> mcon: i asked how you enable it with c++. i would expect it to be the same and work the same (assuming it's included with whatever build of pyqt you are running, i don't know about the official wheels)
[13:17:03] <altendky> mcon: though i would default to a regular remote desktop solution instead, probably
[13:20:37] <mcon> altendky: Sorry, I misunderstood You. Apparently it should be enough to add "-platform webgl" option to the executable launch to enable the "-opengl es" extension available in Qt5.11 (see: http://blog.qt.io)
[13:21:10] <altendky> mcon: just be sure you are passing those through to your QApplication() constructor
[13:21:30] <altendky> mcon: and yeah, that may not be included in the .whl distribution, i don't know offhand
[13:21:50] <mcon> altendky: I suspect this is not as simple with PyQt ;)
[13:22:19] <altendky> mcon: i'm not sure what would be less simple other than it being included or not
[13:23:34] <altendky> mcon: at least for win x64 it looks to be included in the .whl
[13:23:57] <altendky> there's also a qoffscreen. hmm.
[13:24:00] <Avaris> https://www.riverbankcomputing.com
[13:27:39] <mcon> altendky: Apparently plugin is missing (I'm under Debian sid):
[13:28:06] <mcon> qt.qpa.plugin: Could not find the Qt platform plugin "webgl" in ""
[13:28:06] <mcon> This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[13:28:06] <mcon> Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[13:28:12] <altendky> mcon: look down inside and see if it's there. are you using the .whl?
[13:29:14] <altendky> mcon: https://usercontent.irccloud-cdn.com
[13:29:31] <mcon> altendky: as said I'm under Debian sid (unstable) and I installed via apt.
[13:29:46] <altendky> mcon: meh. work in a venv or virtualenv and install the .whl
[13:30:03] <altendky> mcon: or see if there's a package for it
[13:31:16] <altendky> mcon: and don't skip the venv/virtualenv and run pip directly unless you like broken stuff
[13:33:15] <mcon> altendky: Can You send a pointer to the "Right Way" to download/use a .whl? (I am aware that mixing debian packages and pip3 is asking for trouble ;) )
[13:33:30] <altendky> mcon: bit.ly/py-env is a starting point
[13:33:37] <altendky> mcon: shortcut commands are...
[13:34:10] <altendky> mcon: `sudo apt install virtualenv` `virtualenv -p python3 myenv` `myenv/bin/pip install pyqt5` `myenv/bin/python mything.py` (or install your own project in there as well)
[13:36:15] <mcon> altendky: I routinely use PyCharm, and it provides all venv support. I was scared by the ".whl". I know how to use pip.
[13:36:35] <altendky> mcon: oh. it's just a package that pip can install.
[13:37:06] <altendky> mcon: it can include binary stuff so you don't have to build it yourself. that's the format that pyqt5 is distributed 'officialy' (that's what's on pypi)
[13:37:19] <mcon> altendky: Yep! NOW I understood that bit. THANKS. I'll try...
[13:37:35] <Lauxley> Avaris, altendky well it's already working and even a bit better than before :) thx again
[13:37:45] <altendky> Lauxley: good deal :]
[13:50:06] -!- JanC has quit [Remote host closed the connection]
[13:50:55] -!- JanC has joined #pyqt
[13:56:12] <altendky> Avaris: https://gist.github.com though i think that's more similar than it would be if the request wasn't coming from python?
[13:56:58] <altendky> Avaris: the overhead of recreating the python string to return out of the .data() call is common and wouldn't be there with a view (but this was a simple first pass comparison)
[13:58:15] <Avaris> eh... sure... python one has one more call, obviously
[13:59:00] <altendky> Avaris: yeah, i don't mean that that test proves me right or anything. i'll try it with a static string
[14:04:08] <altendky> Avaris: hmm, so much for my string translation concerns? https://gist.github.com
[14:09:37] <altendky> Avaris: hmm, is this really testing anything about the boundary and the strings? or is it just qvarianting in all cases
[14:11:43] <altendky> https://gist.github.com
[14:30:48] <Avaris> i mean, all your "python" models doing is adding overhead (extra function call, mro, etc)
[14:31:17] <altendky> Avaris: yeah, that's what i was realizing. i need to get the view involved to consider the actual conversion
[14:32:05] <Avaris> i thought the original idea was subclassed abstract models vs standard item model
[14:32:20] <altendky> Avaris: this was trying (and failing) to test just a part of that
[14:32:28] <altendky> just the boundary
[14:32:37] <altendky> or, partially failing.
[14:32:54] <altendky> if i can save 30% two or three times over that's pretty useful
[14:35:56] <Avaris> add this to the mix? :) https://dpaste.de
[14:37:20] <Avaris> (too lazy to properly subclass QAbstractItemModel :))
[14:37:30] <altendky> exactly
[14:37:35] <altendky> but that's also part of the point
[14:37:52] <altendky> i hope was performance and less qt internals to deal with
[14:39:06] <Avaris> sometimes dealing with standarditems is more cumbersome
[14:39:30] <altendky> well, i went the abstract route a couple years ago... trying standard now :]
[14:39:44] <altendky> and i'm totally wrapping it up in my attrsmodel anyways so, meh
[14:40:50] <Avaris> i quite like writing models. standard feels... limited?
[14:41:29] <altendky> i like writing not-qt models apparently. it's really not the heart of the model, mostly just a cache in the qt c++ world
[14:43:25] <Avaris> qt model is basically an adapter to your "model". depending on your non-qt model, qt model could just be a very straightforward implementation
[14:45:54] <altendky> so all you added was an attribute access and a list index?
[14:46:57] <altendky> https://gist.github.com
[14:47:45] <altendky> i still think there's something to not crossing between the c++/python boundary. :]
[14:48:18] <altendky> so these tests might not be doing anything but creating and shuttling around qvariant's
[14:49:32] <altendky> well, except for the really standard item model that's got an actual c++ 'string' inside since the setText call on the item would do that conversion
[14:49:33] <Avaris> so... a python model will go python to c++ and back to python again?
[14:49:47] <altendky> here yes
[14:49:57] <altendky> because i'm calling .data() instead of the view calling it
[14:50:08] <altendky> with a standard item the boundary for the data is when i set the text
[14:50:24] <altendky> from their on out it goes to the view umpteen times without touching python (i think...)
[14:50:56] <altendky> with anything where python is picking the data it's going to be in the middle of every view query for data
[14:51:14] <altendky> extra layer(s) of function calls and the data conversion
[14:51:45] <Avaris> then you can wrap stuff in qvariant and be fine?
[14:52:08] <altendky> but that doesn't actually do the string conversion? because it'll just have the py object inside? or am i making that up
[14:54:26] <Avaris> i don't think python -> python goes to c++
[14:54:34] <Avaris> at least in between
[14:54:47] <altendky> maybe not
[14:54:58] <altendky> probably not
[14:55:23] <altendky> but that just makes this more unrelated to the actual concern
[14:55:30] <Avaris> e.g. you emit integers larger than c++ int and receive them in python with no issue.
[14:55:42] <Avaris> (from a custom signal)
[14:56:33] <Avaris> if you emit that to a c++ slot accepting integers, you get overflows
[14:58:16] <Avaris> actually i might be remembering wrong ^. you might need to define signal explicitly with python object rather than int
[15:17:18] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[15:17:48] -!- Belxjander has joined #pyqt
[15:51:33] -!- anqxyr has joined #pyqt
[15:57:13] -!- kallesbar has quit [Quit: Konversation terminated!]
[16:41:56] -!- mintograde has joined #pyqt
[17:02:20] -!- anqxyr has quit [Read error: Connection reset by peer]
[17:19:21] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[17:19:52] -!- Belxjander has joined #pyqt
[17:48:38] -!- Siecje has parted #pyqt
[17:57:49] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[17:58:27] -!- Belxjander has joined #pyqt
[18:03:04] -!- Belxjander has quit [Client Quit]
[18:03:31] -!- Belxjander has joined #pyqt
[18:19:59] -!- Lauxley has quit [Remote host closed the connection]
[18:31:23] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[18:33:53] -!- Belxjander has joined #pyqt
[19:19:00] -!- JanC has quit [Ping timeout: 252 seconds]
[19:19:47] -!- JanC has joined #pyqt
[19:39:00] -!- swalladge has quit [Ping timeout: 252 seconds]
[19:43:47] -!- TunaLobster has joined #pyqt
[20:05:08] -!- TunaLobster has quit [Read error: Connection reset by peer]
[20:53:02] -!- swalladge has joined #pyqt
[22:30:28] -!- mintograde has quit [Ping timeout: 245 seconds]
[22:34:42] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[22:35:06] -!- Belxjander has joined #pyqt
[22:51:25] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[22:51:51] -!- Belxjander has joined #pyqt
[23:04:39] -!- kallesbar has joined #pyqt
[23:49:19] -!- Belxjander has quit [Ping timeout: 268 seconds]
[23:50:35] -!- Belxjander has joined #pyqt