#pyqt | Logs for 2018-12-18

Back
[02:05:16] -!- kallesbar has joined #pyqt
[03:04:42] -!- asaraf has joined #pyqt
[03:04:53] asaraf is now known as saraf
[03:51:10] -!- saraf has quit [Ping timeout: 250 seconds]
[04:50:16] -!- anqxyr has joined #pyqt
[04:53:51] -!- BPL has joined #pyqt
[05:14:33] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[05:14:57] -!- Belxjander has joined #pyqt
[05:29:13] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[05:29:48] -!- Belxjander has joined #pyqt
[06:24:37] -!- TechSmurf has quit [Ping timeout: 250 seconds]
[06:42:51] -!- mintograde has joined #pyqt
[06:58:29] -!- saraf has joined #pyqt
[07:07:37] -!- asaraf has joined #pyqt
[07:10:30] -!- saraf has quit [Ping timeout: 250 seconds]
[07:14:39] -!- kushal has quit [Remote host closed the connection]
[07:14:53] -!- kushal has joined #pyqt
[07:25:40] -!- mintograde has quit [Ping timeout: 250 seconds]
[08:43:32] -!- Dave_Elec has joined #pyqt
[08:57:07] -!- Dave_Elec has quit [Ping timeout: 240 seconds]
[09:17:26] -!- asaraf has quit [Quit: Leaving]
[09:44:59] -!- plasticfish has joined #pyqt
[09:46:37] <plasticfish> hi I have a problem with using QWebWiew when drawn in Designer: ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
[09:47:47] <plasticfish> how can I add a QWebView in designer and use it on my code?
[09:50:21] <altendky> Isn't web view the old web thing? What designer version are you using?
[09:50:28] <altendky> plasticfish: ^^
[09:57:12] -!- Siecje has joined #pyqt
[09:58:52] -!- mandeep has joined #pyqt
[09:59:24] -!- mandeep has quit [Remote host closed the connection]
[10:00:53] <plasticfish> version 5.9.5
[10:01:41] <plasticfish> altendky, ^^
[10:02:11] <altendky> plasticfish: and what pyqt5 are you working with? wand what os are you on?
[10:02:56] <plasticfish> I'm using ubuntu 18.04 and installed PyQt5 with pip on a virtualenv
[10:03:27] <plasticfish> altendky, ^^
[10:04:12] <plasticfish> I installed designer with the ubuntu repositories
[10:05:09] <plasticfish> and followed this: https://gist.github.com
[10:05:49] <altendky> plasticfish: you may want to install the latest from qt for latest designer
[10:06:00] <altendky> plasticfish: but --user isn't a virtualenv
[10:06:17] <plasticfish> i didnt follow that part
[10:06:43] <plasticfish> i created a virtual env, and did a pip install PyQt5
[10:07:47] <plasticfish> I just used that to install the Designer requirements
[10:09:00] <plasticfish> how do I install the the latest from qt for latest designer?
[10:09:10] <plasticfish> on Ubuntu 18.04
[10:11:19] <plasticfish> altendky, ^^
[10:12:02] <plasticfish> I think I'm using old designer with newer PyQt5
[10:13:05] <plasticfish> because of that designer saves QWebView, and PyQt5 can't access it
[10:13:20] <altendky> https://www.qt.io
[10:13:57] <The-Compiler> plasticfish: are you aware that QtWebKit/QWebView is old/insecure/unmaintained?
[10:14:08] <plasticfish> yes
[10:14:17] <plasticfish> I googled it
[10:14:41] <plasticfish> altendky, does that installs the Designer?
[10:14:48] <altendky> plasticfish: i would expect so
[10:14:55] <altendky> it's been awhile since i've bothered
[10:15:22] <plasticfish> I wanted a solution that keeps my PyQt5 virtualenv
[10:15:41] <altendky> plasticfish: i don't have pyqt5-tools for linux yet so... sorry
[10:16:01] <plasticfish> this will probably install a new Qt outside my virtualenv
[10:16:14] <altendky> plasticfish: sure, but you don't have to use it for anything more than designer
[10:17:04] <plasticfish> ok I will try, I expect this wont mix my repositories
[10:17:34] <altendky> plasticfish: it's just it's own installer, defaults to /opt iirc
[10:18:05] <altendky> just be careful you don't pick 'everything' because that'll be... huge
[10:18:17] <altendky> binaries etc for every platform
[10:19:09] <plasticfish> i dont know what I picked, it just said Linux 64 bits
[10:19:26] <plasticfish> but it's a run file, do I run it with sh?
[10:19:36] <altendky> plasticfish: i mean during the installation. you'll probably get to pick then
[10:19:54] <altendky> plasticfish: chmod it then ./whateveritis
[10:21:15] <altendky> so there's also the beineri stuff https://launchpad.net
[10:21:18] <altendky> i kinda forgot about it
[10:24:35] <plasticfish> what's the deal with the Qt account?
[10:24:51] <altendky> it's optional, isn't it?
[10:25:53] <plasticfish> idk I havent tryed it yet
[10:28:49] <plasticfish> is designer Qt Creator? Can't I install just Designer?
[10:29:38] <altendky> plasticfish: creator contains the designer functionality. designer is just the gui editor stuff. i don't know of a just-designer package. but you might go for the beineri packages and get the tools one. *shrug* up to you
[10:40:19] -!- rubenwardy has quit [Quit: Bye!]
[10:40:41] -!- rubenwardy has joined #pyqt
[10:58:02] -!- nimbleark has quit [Quit: iQuit]
[11:00:52] -!- nimbleark has joined #pyqt
[11:43:27] <Siecje> This a crazy chart! Qt will be bug free in no time. https://bugreports.qt.io
[12:13:26] <Siecje> Did anything come out of this? https://www.riverbankcomputing.com
[12:22:12] -!- plasticfish has quit [Read error: Connection reset by peer]
[12:23:34] -!- mandeep has joined #pyqt
[12:51:09] <Siecje> Phil replied and said this is fixed. https://www.riverbankcomputing.com
[12:51:09] <Siecje> When I try I get TypeError: unable to convert a QVariant of type 9 to a QMetaType of type 10 on the print.
[12:51:09] <Siecje> Is that supposed to be a Traceback?
[13:06:02] -!- mandeep has quit [Remote host closed the connection]
[13:12:23] <altendky> Siecje: it's trying to access the setting which is a dict as a string, so yes?
[13:12:29] <altendky> it works with type=dict
[13:12:50] <altendky> or without specifying any type
[13:19:53] <Siecje> altendky: Thanks
[13:24:08] -!- anqxyr has quit [Read error: Connection reset by peer]
[13:24:44] -!- anqxyr has joined #pyqt
[13:42:29] <altendky> Siecje: re: the email the processEvents stands out to me. that's asking for trouble... and now i see the edit noting that... but it makes sense. the event loop calls a slot which calls the event loop which calls a slot which calls the event loop....
[13:43:27] <altendky> processEvents is a bit hazardous
[13:48:23] <Siecje> What about QMetaObject.invokeMethod()?
[13:53:08] <altendky> Siecje: if you cross thread boundaries it has to go through the loop i would think
[13:53:44] <Siecje> Doesn't it always have to run on the event loop?
[13:55:08] <altendky> Siecje: signals going to slots in the same thread with automatic (or maybe some direct) connection mode don't, i don't think. did you think invokeMethod might make a difference?
[13:56:18] <Siecje> I thought we used processEvents() but we use invokeMethod() instead
[13:59:25] <altendky> Siecje: those aren't alternatives. invokeMethod is just emit without having to have a signal and connect it, i thought
[14:42:38] -!- plasticfish has joined #pyqt
[15:51:12] -!- TechSmurf has joined #pyqt
[15:57:07] -!- anqxyr has quit [Quit: Leaving]
[16:05:07] -!- plasticfish has quit [Quit: Leaving]
[16:10:09] -!- BPL has quit [Read error: Connection reset by peer]
[16:58:47] -!- mintograde has joined #pyqt
[17:13:44] -!- Siecje has quit [Quit: Leaving.]
[17:19:57] -!- Dave_Elec has joined #pyqt
[17:20:00] -!- Dave_Elec has quit [Client Quit]
[17:20:51] -!- Dave_Elec has joined #pyqt
[17:25:25] -!- BPL has joined #pyqt
[17:31:53] -!- JT-Shop has quit [Remote host closed the connection]
[17:42:12] -!- kallesbar has quit [Quit: Konversation terminated!]
[17:58:09] -!- fromBeyond has joined #pyqt
[17:59:08] <fromBeyond> Hi. Can someone please help me expain why this code causes segfault? https://bpaste.net
[17:59:18] <fromBeyond> I am a c++ programmer, and my c++ version works
[17:59:27] <fromBeyond> https://bpaste.net
[17:59:48] <fromBeyond> QPaintDevice: Cannot destroy paint device that is being painted
[17:59:52] <fromBeyond> this is the error i get
[18:06:54] <fromBeyond> anybody? I am really lost :)
[18:07:59] <fromBeyond> https://bpaste.net
[18:08:03] <fromBeyond> this is the entire code
[18:09:32] <fromBeyond> There is a runaway dot in the constructor, accident when copying
[18:11:48] <altendky> fromBeyond: nothing jumps out in a quick look, but I also haven't done any painting in awhile. If I get a chance I'll look more later and try to run it. Sorry
[18:16:40] <fromBeyond> i figured it out just now. Thank you anyway!
[18:34:15] <altendky> fromBeyond: what was it?
[18:39:25] <fromBeyond> in the resizeImage method, when (in the c++ implementation) the destructor of painter gets called, it "thinks" that it is still in use
[18:39:41] <fromBeyond> so it crashes the program, saying you cannot delete a painter that paints
[18:39:48] <fromBeyond> so i call painter.end()
[18:39:53] <fromBeyond> before the method ends
[18:41:29] <altendky> yeah, i didn't read quite enough. fifth paragraph in the docs :] thanks for the follow up
[18:43:20] <fromBeyond> i missed that in the docs, and i went and read the source code :)
[18:43:29] <fromBeyond> i will go look at the docs again now
[18:43:31] <fromBeyond> thanks
[20:27:40] <fromBeyond> Hi
[20:27:51] <fromBeyond> If I have two widgets which succesfully work on their own
[20:28:04] <fromBeyond> how can I put them side by side
[20:28:10] <fromBeyond> in the QMainWindow
[20:28:14] <fromBeyond> I cannot seem to make it work
[20:29:03] <altendky> fromBeyond: a widget with an hbox layout with your widget pair in that
[20:29:30] <altendky> fromBeyond: widgets generally get layouts put in them. qmainwindow is kinda special and you put a central widget in it...
[20:29:45] <altendky> setCentralWidget or whatever
[20:34:29] <fromBeyond> altendky: https://bpaste.net
[20:34:34] <fromBeyond> mind taking a look
[20:34:43] <fromBeyond> I try to join them in Main
[20:34:51] <fromBeyond> they both work nicely on their own
[20:35:50] <altendky> fromBeyond: there's no qmainwindow there? and what doesn't work?
[20:37:21] <altendky> fromBeyond: you should hold onto a reference to your layout in Main i think, for one. self.box
[20:37:45] <altendky> i'm not much for constructing a widget forcing it to immediately be shown. but that's almost certainly unrelated
[20:38:02] <fromBeyond> I am trying to join them in a QWidget now. Sorry for wording things badly. If I run each widget, it works. If I run Main, I get
[20:38:03] <altendky> consistently don't pass args to super
[20:38:04] <fromBeyond> QPainter::begin: Paint device returned engine == 0, type: 3
[20:38:32] <fromBeyond> and only Menu shows
[20:38:41] <fromBeyond> altendky: sorry, how should I have done it?
[20:38:57] <altendky> you don't have painter.end() in DrawPad.paintEvent for one
[20:39:17] <altendky> fromBeyond: how should you have done which thing?
[20:39:38] <fromBeyond> cinsistently dont pass args to super
[20:39:49] <fromBeyond> super(QWidget, self).__init__()
[20:39:51] <altendky> fromBeyond: just super() rather than super(DrawPad, self)
[20:39:59] <fromBeyond> OK, I see
[20:40:10] <altendky> fromBeyond: the latter is for py2 which lacks the feature that allows for zero-arg super calls in py3
[20:40:26] <altendky> passing them just encourages errors and makes readers double check the call
[20:40:54] <altendky> but so far i'm just listing random things... haven't found anything that is likely the cause
[20:41:31] <fromBeyond> thank you for looking
[20:43:21] <altendky> is it on stdout or stderr? maybe add some prints to the proper output to figure out where that happens. or step through debug for the same
[20:45:12] <fromBeyond> painter = QPainter(newImage)
[20:45:40] <fromBeyond> will try to figure it out further
[20:46:52] <altendky> fromBeyond:
[20:46:53] <fromBeyond> Maybe the problem is in method resizeImage
[20:46:54] <altendky> https://stackoverflow.com
[20:46:56] <altendky> uh...
[20:46:58] <altendky> https://stackoverflow.com
[20:47:44] <fromBeyond> yes, i tracked that the line where it breaks is when a new image is created from newSize
[20:47:52] <fromBeyond> as newSIze == (0,114)
[20:48:35] <fromBeyond> self.resizeImage(event.size())
[20:49:57] <altendky> fromBeyond: so you are trying to cache your draw?
[20:50:00] <altendky> or paint
[20:51:01] <fromBeyond> this is in the resizeEvent method
[20:51:08] <fromBeyond> where I resize the image
[20:51:20] <altendky> fromBeyond: right. but overall you are drawing to an image and copying to a pixmap and then painting that to the widget
[20:51:23] <altendky> i think
[20:51:35] <fromBeyond> yes.
[20:51:35] <altendky> fromBeyond: is that correct? are you doing that to try to cache your painting work?
[20:51:45] <fromBeyond> yes
[20:51:50] <fromBeyond> sorry, i did not understand before
[20:52:11] <altendky> fromBeyond: have you had an issue where paintEvent was getting called excessively and causing trouble?
[20:52:51] <fromBeyond> no. I am just playing around to learn qt, as i am a total novice
[20:52:53] <fromBeyond> in qt
[20:52:54] <altendky> as in i'd default to just painting directly when told to... (admittedly not having done much painting, as i mentioned before)
[20:53:26] <altendky> there are also graphics scenes or somesuch that may be relevant depending where you are going with this
[20:57:18] <fromBeyond> I fixed my issue
[20:57:26] <fromBeyond> the problem was in Main
[20:57:33] <fromBeyond> I had strech = 0
[20:57:36] <fromBeyond> for the DrawPad
[21:33:33] -!- mandeep has joined #pyqt
[21:35:24] -!- BPL has quit [Read error: Connection reset by peer]
[22:15:15] -!- mintograde has quit [Ping timeout: 246 seconds]
[22:31:46] -!- Dave_Elec has quit [Ping timeout: 250 seconds]
[22:36:56] -!- mandeep has quit [Remote host closed the connection]
[22:45:18] -!- mandeep has joined #pyqt
[23:12:48] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[23:13:29] -!- Belxjander has joined #pyqt
[23:22:30] -!- Belxjander has quit [Ping timeout: 244 seconds]
[23:23:39] -!- Belxjander has joined #pyqt
[23:24:15] -!- fromBeyond has quit [Ping timeout: 250 seconds]
[23:27:38] -!- Belxjander has quit [Client Quit]
[23:30:50] -!- Belxjander has joined #pyqt
[23:36:58] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[23:37:29] -!- Belxjander has joined #pyqt
[23:41:40] -!- Belxjander has quit [Client Quit]
[23:42:54] -!- Belxjander has joined #pyqt