#pyqt | Logs for 2018-12-28

Back
[00:50:31] -!- cypher has quit [Ping timeout: 268 seconds]
[00:50:43] -!- cypher has joined #pyqt
[01:46:13] -!- JanC has quit [Remote host closed the connection]
[01:46:30] -!- JanC has joined #pyqt
[02:18:08] -!- kushal has quit [Remote host closed the connection]
[02:18:52] -!- kushal has joined #pyqt
[02:40:52] -!- kallesbar has joined #pyqt
[02:56:49] -!- mandeep has quit [Remote host closed the connection]
[02:59:05] -!- mandeep has joined #pyqt
[11:28:33] <altendky> any thoughts on the `QTabWidget` not getting it's parent set when loaded from the bad.ui? but... only the first time! :[ https://gist.github.com
[12:12:28] <Avaris> altendky: there is a second stackedwidget?
[12:13:44] <altendky> Avaris: I have an explicit one in bad.ui. for the others, aren't they part of a tabbed widget internals?
[12:14:18] <Avaris> is it? hmm, i thought it used stacked layout
[12:17:01] <altendky> Bonus, in my real code I could 'fix' it by having a custom widget inside the custom widget in the new problematic tab.
[12:18:05] <altendky> Fair warning, I did send this to the maillist now as well
[12:18:55] <Avaris> if you `view` it, it's fine, right?
[12:21:07] <altendky> Avaris: view what? Just ignore the situation and show it anyways? Wow, didn't try that :[
[12:21:33] <Avaris> yeah, view the widget
[12:21:43] <Avaris> err show
[12:22:06] <Avaris> count() is zero for the first run
[12:22:30] <altendky> Avaris: count()?
[12:22:40] <Avaris> stackedwidget.count()
[12:23:16] <Avaris> if you switch the order of good.ui and bad.ui, bad one is fine :)
[12:23:33] <altendky> Avaris: yup.
[12:23:50] <altendky> because it's not the first load... of... something. haven't tried to find the exact trigger.
[12:24:03] <Avaris> weird. did you try pyuic to .py and import?
[12:24:25] <altendky> Avaris: if you look in the uic code there's a commend about importance of order and a list or somesuch they have of the order to do things in so i think maybe something isn't quite right related to that
[12:24:42] <altendky> Avaris: i tried looking at them. the differences were mostly sensible
[12:26:55] <altendky> Avaris: showing them all now and the first one is empty. the rest have a tabbed widget with two tabs
[12:27:07] <altendky> a good thing to check but it shows what would be expected
[12:29:38] <Avaris> <wild guess>can you try wrapping tab widget in qwidget?</wild guess>
[12:29:48] <Avaris> i.e. stacked -> qwidget -> tab
[12:33:42] <altendky> Avaris: my stacked is outside the tab, not inside.
[12:33:52] <altendky> Avaris: it's for some translucent overlay labels
[12:34:00] <altendky> that aren't present in the example
[12:34:27] <Avaris> isn't stack container for tab?
[12:35:12] <altendky> Avaris: my real code has a stacked with two layers. one has the translucent overlay labels and the other, behind the labels, has a tab widget.
[12:35:49] <altendky> Avaris: see the red 'offline' in front? it's over the entire tab widget https://github.com
[12:36:15] <altendky> albeit when i took that screenshot i may still have had my hacky 'just shove a widget a place and keep it the right size' rather than a proper stacked widget doing it for me.
[12:37:07] <Avaris> i thought that was done with background
[12:37:21] <altendky> Avaris: no, it's in front
[12:37:47] <altendky> Avaris: you can see it going over the grayed out text boxes
[12:37:59] <Avaris> this looks suspicious: https://github.com
[12:38:34] <altendky> hmm, lemme try changing it
[12:39:58] <altendky> Avaris: welp, it alleviates the symptom anyways. good find
[12:40:34] <altendky> Avaris: i guess the expectation is that when you add it to the parent the parent will claim it
[12:40:57] <altendky> i thought i remembered something about that but when i checked the docs for stacked it didn't comment about not taking ownership
[12:40:58] <Avaris> it should
[12:41:42] <altendky> http://doc.qt.io
[12:41:54] <altendky> or the 5.11 http://doc.qt.io
[12:42:40] <altendky> "Ownership of widget is passed on to the QStackedWidget." seemed an odd way to say it but seems to claim it. makes me think there may be something missing elsewhere about it getting added properly.
[12:43:32] <Avaris> ownership ~= parented to this widget
[12:43:42] <altendky> hmm
[12:45:21] <altendky> http://doc.qt.io only (relevant) hits for 'own' are in the title. never mentioned again... :|
[12:45:43] <altendky> Avaris: so what is ownership if not the parent relationship?
[12:47:09] <Avaris> ownership is a general term. it's parent-child for Qt
[12:47:55] <altendky> Avaris: oh, wait, you meant ownership is roughly being parented? i think i was reading that with my matlab mind where iirc ~= is 'not equal to' :[
[12:48:32] <Avaris> oh yeah meant "almost identical"
[12:49:19] <altendky> Avaris: yeah, that's how i read the docs. not sure why that interpretation of ~= is what came into my head. it always seemed a bad choice.
[12:49:24] <altendky> https://www.mathworks.com
[12:50:34] <Avaris> they use ~ for not IIRC. then it's a natural extension
[12:50:52] <altendky> i'd expect ~ to be a bitwise not
[12:51:05] <altendky> but yeah
[12:55:27] <Avaris> try running with: `import logging; logging.basicConfig(level=logging.DEBUG)`
[12:55:47] <Avaris> gives a lot more information, and weirdly parent is None all the way for the first run
[12:55:52] <altendky> usually you add widgets to layouts, not widgets so maybe that's the hangup? still weird it works the second time though
[12:57:41] <altendky> when widget is the tabs, topwidget is None so it misses the addWidget elif for stacked.
[12:59:45] <altendky> so why is topwidget None on the first run... ha! topwidget is a class attribute on WidgetStack!
[13:00:09] <Avaris> yeah, I was starting get suspicious about that
[13:00:22] <altendky> inheriting from list... :[
[13:00:29] <altendky> i'll put in a passthrough init i guess
[13:00:35] <altendky> see if it gets broken for all runs with bad
[13:01:58] <altendky> nope, still only broken on the first run
[13:09:53] <Avaris> first pass is broken somehow
[13:10:31] <altendky> i mean a class attribute that gets changed seemed like a smoking gun... but oh well. back to reading the debug logs
[13:10:36] <Avaris> after this, goes all the way to the top again: `DEBUG:PyQt5.uic.uiparser:push QWidget files`
[13:11:11] <Avaris> technically, it's not the class attribute that gets changed :)
[13:11:28] <altendky> mm, the assignments were all self
[13:11:30] <Avaris> it's shadowed by instance attribute... sometimes
[13:11:55] <Avaris> but yeah, code smell
[13:14:12] <altendky> uh, the first one ends up logging UI version is 4.0 twice
[13:15:02] <altendky> i switched my prints to file=sys.stderr so at least that'd be synced
[13:15:33] <altendky> and the topwidget is none after that interlude
[13:20:21] <altendky> i think it's unintentionally re-entering itself somewhere maybe
[13:21:00] <altendky> oh, no, that's my custom plugin loading it's .ui
[13:21:04] <altendky> but hmm
[13:22:07] <altendky> i am admittedly doing .loadUi in one place (top level) and .loadUiType in the other (the custom widget)
[13:31:41] <altendky> if i just `import filesview` first so they aren't nested it's fine
[13:32:29] <Avaris> yeah it seems to choke at second custom widget filesview
[13:54:25] <altendky> a QWidget isn't an instance of QWidget? :| https://usercontent.irccloud-cdn.com
[13:54:38] <altendky> there's a bunch of module wrapping code and such
[13:56:11] <altendky> yeah, that's not good https://usercontent.irccloud-cdn.com
[13:57:31] <altendky> it's looking for a QWidget instance in popWidget after finishing the files view .ui load (back in the bad.ui load now) and it doesn't find it because we now have multiple copies of the class QWidget i think
[14:00:26] <Avaris> i still don't get how the re-parse is triggered
[14:01:17] <altendky> the bad.ui uses the custom widget that uses fileview.ui. so to finish loading bad.ui it first has to go handle fileview.ui in the middle. (if that's what you are referring to?)
[14:01:40] <Avaris> oh...
[14:01:46] <altendky> Avaris: since i don't import fileview anywhere, when uic does it then does the loadUiType
[14:01:48] <Avaris> yeah that was it
[14:02:15] <altendky> and i think when it does that it maybe mucks with the wrappers or somesuch making types not match properly
[14:02:22] <altendky> trying to double check taht
[14:02:52] <altendky> move my reporting into the log
[14:03:06] <Avaris> i don't know maybe there is a global state somewhere and loading ui inside ui messes things up
[14:03:29] <altendky> did you notice all the wrapper stuff?
[14:03:47] <altendky> i didn't look at what it did, just seemed to be a good bit of it. maybe also proxy
[14:04:24] <Avaris> yeah, probably trying to unify interface
[14:06:37] <altendky> search for 'checking' https://gist.github.com it finds stuff before the nested UI version but not after
[14:07:18] <altendky> it still thinks QtWidgets.QWidget is at address 94078989722680
[14:07:26] <altendky> but the instance of it no longer is.
[14:07:38] <altendky> oh, hey, the representations even change entirely...
[14:07:50] <altendky> this is stupid
[14:10:59] <Avaris> oh the qt modules are the global state
[14:11:38] <Avaris> but wait, they shouldn't change... even if you re-import. unless you muck with sys.modules
[14:12:08] <altendky> Avaris: the repr has changed as well. it's really a different thing
[14:12:17] <altendky> or it's been modified
[14:14:56] <altendky> just typing this up for the list. thanks for the help. i don't want to try to figure out how to unmuck proxying
[14:15:13] <altendky> and i have a tidy non-intrusive workaround by manually importing before loading the .ui
[14:18:49] * altendky for completeness https://www.riverbankcomputing.com
[14:21:23] <Avaris> i'm suspecting this: https://github.com
[14:21:41] <Avaris> somehow re-imports cached modules and breaks stuff
[14:21:44] <altendky> Avaris: where are the different repr coming from?
[14:21:58] <altendky> if it's just a multiple-import scenario
[14:22:06] -!- kallesbar has quit [Quit: Konversation terminated!]
[14:22:24] <altendky> or am i misreading my own debugging
[14:22:51] <Avaris> that essentially triggers this: https://github.com
[14:23:01] <Avaris> and that "fixes" the qt modules
[14:23:45] <altendky> so i'm starting to think this magic is way worse than my import hook that pyuic5s a .ui if it is present and then shuts up
[14:24:19] <altendky> just have to figure out how to handle that with pyinstaller
[14:24:33] <altendky> my .ui are already plain files so it might be fine
[14:24:42] <Avaris> iirc, nowadays __import__ should be avoided, i think importlib is the way
[14:25:38] <altendky> isn't pyqt5 still py2 compatible though? i guess you get something https://docs.python.org but not much
[14:26:13] <Avaris> yeah, but try importlib first than fallback usually
[14:27:27] <altendky> yep, manual pre-import confirmed to work in my real code
[14:29:05] <altendky> presumably pyuic5 wouldn't be bothering with any of this garbage when it runs, right? it'd just say 'the .ui says a thing of this name can be had when i import from this other name...' and write out some text
[14:29:57] <Avaris> yeah, it would just add imports and stuff. not actually try to instantiate classes
[15:15:03] -!- anqxyr has joined #pyqt
[17:51:34] -!- Bjander has joined #pyqt
[17:53:58] -!- Belxjander has quit [Ping timeout: 246 seconds]
[17:53:58] Bjander is now known as Belxjander
[18:09:00] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[18:10:12] -!- Belxjander has joined #pyqt
[18:20:41] -!- anqxyr has quit [Read error: Connection reset by peer]
[18:21:36] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[18:22:11] -!- Belxjander has joined #pyqt
[19:08:29] <altendky> Avaris: I guess we confirmed what Phil already knew? Ah well...
[19:11:57] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[19:13:50] -!- Belxjander has joined #pyqt
[19:19:52] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[19:20:19] -!- Belxjander has joined #pyqt
[19:50:22] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[19:51:02] -!- Belxjander has joined #pyqt
[20:02:36] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:03:06] -!- Belxjander has joined #pyqt
[20:13:15] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:13:39] -!- Belxjander has joined #pyqt
[20:30:54] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:31:20] -!- Belxjander has joined #pyqt
[20:37:28] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:38:04] -!- Belxjander has joined #pyqt
[20:55:14] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:55:42] -!- Belxjander has joined #pyqt