#pyqt | Logs for 2019-02-24
Back
[00:10:27] -!- mintograde has quit [Ping timeout: 245 seconds]
[02:16:27] -!- Safa_[A_boy] has joined #pyqt
[02:17:32] <Safa_[A_boy]> Avaris, Hi! I'd like to thank you very much! "what action is causing memory increase?
[02:17:32] <Safa_[A_boy]> ". After enough sleep, it was one other object that is killing the ram, not the images as I thought
[02:43:13] -!- a-l-e has joined #pyqt
[03:06:02] -!- Safa_[A_boy] has quit [Ping timeout: 246 seconds]
[03:29:42] -!- crmaurei has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
[03:29:43] -!- tijensse has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
[04:26:19] -!- n1` has joined #pyqt
[04:35:17] -!- BPL has joined #pyqt
[04:36:22] -!- Safa_[A_boy] has joined #pyqt
[05:03:59] -!- Safa_[A_boy] has quit [Quit: Leaving]
[05:32:53] -!- BPL has quit [Quit: Leaving]
[05:47:41] -!- n1` has quit [Ping timeout: 244 seconds]
[05:48:13] -!- BPL has joined #pyqt
[06:03:51] <ntome> is it possible to use QUiLoader in pyqt?
[06:09:06] <The-Compiler> ntome: there's https://www.riverbankcomputing.com FWIW
[06:10:56] <ntome> will look, thanks
[06:11:44] <ntome> my underlying problem is having setup.py building .ui files or build them before, so i'm trying another approach, load .ui at runtime
[06:13:02] <The-Compiler> sounds like you want uic.loadUi then
[06:13:58] <ntome> loadUiType fails with some exception KeyError: "'__name__' not in globals"
[06:14:58] <ntome> i would rather create a type rather than an instance, btw i have "promoted types" that are in other .ui files
[06:18:35] -!- n1` has joined #pyqt
[06:34:15] <ntome> is it a problem to call uic in a module toplevel?
[06:34:42] <ntome> i mean, not in a function or a class but directly in a module
[07:21:46] -!- BPL has quit [Quit: Leaving]
[07:35:59] <The-Compiler> ntome: no idea
[07:36:05] <The-Compiler> I've never used it myself
[07:41:36] -!- mintograde has joined #pyqt
[07:59:55] <altendky> ntome: this is what I do presently https://github.com
[08:01:48] <altendky> Though I really into an issue in one case and while debugging found that the dynamic ui handling is a bit crazy. Not sure why it needs to be messing with global qt modules, or whatever it was.
[08:03:08] <altendky> I'm a bit tempted to use https://github.com which catches importing of modify ending with _ui. When found it looks for a corresponding .ui file and compiles it then let's the import continue and find that new .py file
[08:04:04] <altendky> *importing of modules
[08:06:14] <altendky> Though even then, you would probably want some manner to build them all before pyinstaller processes everything for example. Or maybe the pyinstaller exploration would itself trigger the the import hook
[08:27:06] <ntome> by compiling it requires write access though
[08:31:28] -!- a-l-e has quit [Ping timeout: 244 seconds]
[08:32:46] <ntome> but thanks i'll do something that load either ui or module
[08:32:50] <altendky> ntome: sure. i shared a couple options. If they don't work as is you can describe your scenario in more detail
[08:33:35] <altendky> The first one doesn't compile or write files
[08:34:05] <ntome> yes, looks nice
[08:37:05] <altendky> ntome: my specific issue was I had a .ui that used a custom widget that loaded a .ui in the same way without having loaded the inner .ui before. The uic system can't handle that because it uses some messy global state
[08:37:49] <altendky> For now I just preload the inner widget. But, the messy code left me not particularly happy to be using that
[08:38:30] <altendky> Also, many people like having the .py file for completion assistance in their ide etc
[08:39:14] <altendky> ntome: you want to avoid file writing at runtime?
[08:39:57] <ntome> what do you mean exactly the ui loads has a custom widget loading the .ui?
[08:40:38] <altendky> ntome: I use custom widgets a lot. They are mostly just built from other widgets and I use .ui files for the layout.
[08:40:50] <ntome> promoted widgets?
[08:41:07] <altendky> ntome: no, directly the custom widget
[08:42:26] <ntome> for example your custom widget is B and has a b.ui with stuff in it, and you want to use B in a.ui ?
[08:47:34] <altendky> ntome: yes
[08:49:40] <ntome> i think you can use promoted widgets for that :) i do something similar
[08:50:29] <altendky> https://www.riverbankcomputing.com
[08:51:29] <ntome> if B is a QWidget subclass, when editing a.ui, add a QWidget in the place where you would use B, then choose "promote to" and then use B there
[08:51:33] <altendky> ntome: i'd rather just move away from using the code that seems pointlessly terrible, I think
[08:51:56] <altendky> ntome: then you can't see your custom widget on designer or the effects of changing the properties
[08:52:04] <altendky> *in designer
[08:52:05] <ntome> well, it seems to work for me, i may be doing something a little different
[08:52:47] <ntome> well, i don't see b.ui's contents in a.ui, yes, i have to open them separately
[08:52:51] <altendky> ntome: it mostly works for me too
[08:54:25] <altendky> ntome: https://github.com almost entirely custom widgets in the screen shot. Properties control what config file to load and what entries to use to configure the custom widget
[08:55:07] <altendky> Designer loses a lot of value if you can't see the results
[08:56:23] <ntome> i see what you mean
[08:57:47] <ntome> how do you do this? (except the part where it fails to load .ui :) )
[08:58:49] <altendky> Yeah, uic messes with even the QtWidgets module and so widgets are no longer detected as being of type QtWidgets.QWidget...
[08:59:00] <altendky> Or just seems absolutely horrible
[08:59:06] <altendky> *it just
[08:59:32] <altendky> ntome: for designer you need the pyqt designer plugin
[08:59:45] <altendky> ntome: what os are you working on?
[09:01:17] <altendky> For the .ui files... https://github.com
[09:01:56] -!- a-l-e has joined #pyqt
[09:04:18] <ntome> linux
[09:07:19] <altendky> ntome: you may have system packages for the plugin but last I tried (not very hard) they didn't work for me on Debian. I should try again
[09:07:51] <altendky> ntome: in windows I made pyqt5-tools to distribute a built copy of the plugin (and the qt tools)
[09:13:28] <altendky> Maybe even just the wrapper for designer from pyqt5-tools would be good in Linux as a stop gap until I get it fully building
[09:13:47] -!- n1` has quit [Ping timeout: 245 seconds]
[09:39:42] -!- n1` has joined #pyqt
[09:55:36] -!- a-l-e has quit [Quit: Leaving]
[10:09:16] -!- Afrix has joined #pyqt
[13:09:05] -!- BPL has joined #pyqt
[13:09:55] <BPL> Hi, consider this https://bpaste.net could anyone explain why the widget created by the class `MainNotWorking` won't spawn the context menu of the subwidget attached to the QScrollArea?
[13:18:46] <Avaris> BPL: put it inside layout
[13:19:04] <BPL> Avaris: yeah, ty
[13:19:29] <BPL> Avaris: I've realized about that fact by using a QLabel instead of a QWidget :D
[13:19:41] <Avaris> or define sizeHint
[13:19:46] <BPL> exactly
[13:20:01] <Avaris> or setWidgetResizable(True)
[13:20:08] <BPL> yup :D
[13:25:43] <BPL> just for the record, i've discovered the issue on my real case was because the fact of using `WA_TransparentForMouseEvents`. After reading the docs makes total sense why the menu wasn't being shown
[13:33:19] <altendky> BPL: was a menu not being shown? or was a mouse click not being detected? seems like that flag would relate to the latter, not the former
[14:24:41] -!- frispete has quit [Quit: Konversation terminated!]
[15:07:35] -!- Dave_Elec has joined #pyqt
[15:49:27] -!- frispete has joined #pyqt
[16:09:06] -!- Dave_Elec has quit [Ping timeout: 272 seconds]
[19:01:06] -!- Afrix has quit [Quit: Leaving]
[19:57:11] -!- n1` has quit [Ping timeout: 255 seconds]
[20:03:00] -!- BPL has quit [Quit: Leaving]