#pyqt | Logs for 2019-01-02

Back
[01:05:31] -!- kallesbar has joined #pyqt
[01:48:08] -!- mandeep has quit [Remote host closed the connection]
[01:50:22] -!- mandeep has joined #pyqt
[03:05:40] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[03:06:08] -!- Belxjander has joined #pyqt
[03:53:45] -!- anqxyr has joined #pyqt
[04:51:17] -!- Bjander has joined #pyqt
[04:53:59] -!- Belxjander has quit [Ping timeout: 250 seconds]
[04:54:00] Bjander is now known as Belxjander
[05:05:04] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[05:05:34] -!- Belxjander has joined #pyqt
[05:17:04] -!- BPL has joined #pyqt
[05:24:48] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[05:25:14] -!- Belxjander has joined #pyqt
[05:36:24] -!- Belxjander has quit [Ping timeout: 250 seconds]
[05:37:04] -!- Belxjander has joined #pyqt
[05:38:30] -!- BPL has quit [Read error: Connection reset by peer]
[05:52:21] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[05:52:44] -!- Belxjander has joined #pyqt
[06:15:35] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[06:16:09] -!- Belxjander has joined #pyqt
[06:25:41] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[06:27:05] -!- Belxjander has joined #pyqt
[06:32:15] -!- mintograde has joined #pyqt
[07:10:25] -!- mintograde has quit [Ping timeout: 244 seconds]
[08:04:28] -!- nsizemor has joined #pyqt
[09:48:57] -!- Bjander has joined #pyqt
[09:52:30] -!- Belxjander has quit [Ping timeout: 250 seconds]
[09:52:30] Bjander is now known as Belxjander
[09:56:16] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[09:56:39] -!- Belxjander has joined #pyqt
[10:12:33] -!- Bjander has joined #pyqt
[10:12:52] -!- Belxjander has quit [Ping timeout: 250 seconds]
[10:12:56] Bjander is now known as Belxjander
[13:53:54] -!- kallesbar has quit [Quit: Konversation terminated!]
[14:18:14] -!- AbleBacon has joined #pyqt
[14:30:30] -!- mandeep has quit [Remote host closed the connection]
[15:07:59] <AbleBacon> is there a way to bind a signal to a property setter, like the ones shown in this example? http://pyqt.sourceforge.net
[15:20:30] -!- Dave_Elec has joined #pyqt
[15:36:09] -!- Dave_Elec has quit [Quit: Dave_Elec]
[15:36:37] -!- Dave_Elec has joined #pyqt
[15:45:43] <altendky> AbleBacon: i'm looking, but worst case you put a callable (def, lambda) in the middle
[15:46:09] <AbleBacon> but i need the lambda to do an assignment, so i'd have to write a named function
[15:46:27] <altendky> true
[15:47:25] <altendky> AbleBacon: https://repl.it seems to work
[15:48:07] -!- Dave_Elec has quit [Ping timeout: 244 seconds]
[15:48:39] <altendky> AbleBacon: so `the_signal.connect(functools.partial(TheClass.a_property.fset, the_instance_of_the_class))`
[15:49:00] <AbleBacon> oh yikes. that's what i'll need?
[15:49:11] <altendky> or `lambda value: TheClass.a_property.fset(the_instance_of_the_class, value)`
[15:49:32] -!- Dave_Elec has joined #pyqt
[15:50:12] <altendky> AbleBacon: you have to access the 'property' not on the instance or it decides what you get. accessing it on the class gets you 'it' rather than the value it's presenting you. then you can .fset to get the setter. then you have to pass it the instance and let the signal/slot mechanism pass it the value
[15:50:24] <altendky> so yes, there are a couple layers
[15:50:31] <AbleBacon> ok thanks for the help. i'll look into using this
[15:50:57] -!- linuxson has joined #pyqt
[15:51:08] <altendky> AbleBacon: btw, properties are descriptors. descriptors have the special ability to give you back something other than themselves when you access them.
[15:51:19] <altendky> pyqtSignal's themselves are actually descriptors
[15:51:48] <altendky> that's how it can be a class attribute yet you still get a per-instance signal rather than one shared signal among all class instances
[15:52:00] <linuxson> Quick question...what kind of widget would I use to construct a canvas a user would be able to draw on and manipulate shapes?
[15:52:30] <Avaris> qgraphicsview would be my first choice
[15:52:35] <AbleBacon> ah--okay. trying to wrap my head around this. not sure i know enough about python. it all seems straightfoward in C++, but switching to python stuff feels like it's missing
[15:53:08] <linuxson> Avaris, would they be able to manipulate lines or shapes directly in the widget after they've been drawn?
[15:53:48] <Avaris> linuxson: yeah graphicsview has built-in interactions (select, drag etc) or you can customize those
[15:53:59] <altendky> AbleBacon: at the same time, any callable anywhere defined at any time can be the target of a signal... so, some good some bad
[15:54:07] <linuxson> Avaris: Thanx, will have a look at that then
[15:56:40] <Avaris> AbleBacon: is property your doing? i.e. can you add a method version of the setter?
[15:56:58] <AbleBacon> what do you mean by a "method version of the setter"?
[15:57:15] <Avaris> not `@foo.setter`ed one
[15:57:32] <AbleBacon> yes, i can use decorations
[15:57:48] <AbleBacon> idk if it works without it
[15:58:05] <Avaris> i'm saying one additional method without decorator :)
[15:58:34] <Avaris> def _set_value(self, val): ...
[15:58:52] <altendky> https://repl.it
[15:59:01] <AbleBacon> oh, i want to avoid that because then it gets confusing and makes things difficult to refactor
[15:59:24] <altendky> AbleBacon: what are you connecting?
[15:59:56] <Avaris> ok, then i'd define a local function tbh. that fset is... meh, lets say not very commonly used
[15:59:57] <AbleBacon> i want a property to change when QLineEdit.textChanged triggers
[16:00:21] <Avaris> qsignalmapper?
[16:00:32] <AbleBacon> ah--i'll try that. thanks
[16:01:28] <Avaris> that might still need slots though. i forgot
[16:02:26] <altendky> hmm "This class is obsolete"
[16:02:44] <altendky> We strongly advise against using it in new code
[16:03:09] <Avaris> possible. my mind is qt4 based most of the time :)
[16:03:10] <altendky> Avaris: reading the description i think maybe you meant something else?
[16:03:28] <altendky> This class collects a set of parameterless signals, and re-emits them with integer, string or widget parameters corresponding to the object that sent the signal
[16:03:53] <altendky> their signal has the value they want?
[16:03:57] <altendky> http://doc.qt.io
[16:06:24] <Avaris> wait this might not be it. there was a thing that was used to sync stuff
[16:07:38] <Avaris> ah qdatawidgetmapper
[16:08:54] <Avaris> yeah, this is model stuff. ignore :)
[16:10:07] <Avaris> "q" and "mapper" was correct though ;)
[16:14:25] -!- Dave_Elec has quit [Read error: Connection reset by peer]
[16:15:07] <altendky> unless maybe there's more and a model would be an appropriate thing to consider
[16:15:30] <Avaris> AbleBacon: btw, you can do this: https://dpaste.de
[16:15:41] <Avaris> then you get methods _and_ property
[16:16:11] -!- Dave_Elec has joined #pyqt
[16:24:25] <Avaris> or `lineEdit.textChanged.connect(functools.partial(setattr, myobj, 'prop'))` is an option. but still feels dirty :)
[16:25:53] -!- mintograde has joined #pyqt
[16:33:12] -!- Dave_Elec has quit [Ping timeout: 246 seconds]
[16:38:34] -!- anqxyr has quit [Read error: Connection reset by peer]
[16:39:13] -!- Dave_Elec has joined #pyqt
[16:44:38] -!- thomasross has quit [Remote host closed the connection]
[16:45:05] -!- thomasross has joined #pyqt
[16:55:04] -!- linuxson has quit [Remote host closed the connection]
[16:55:43] -!- Belxjander has quit [Ping timeout: 246 seconds]
[16:57:59] -!- Belxjander has joined #pyqt
[16:58:02] -!- Dave_Elec has quit [Ping timeout: 250 seconds]
[17:06:03] -!- Dave_Elec has joined #pyqt
[17:10:19] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[17:10:46] -!- Belxjander has joined #pyqt
[17:13:51] <altendky> or the opposite of the dpaste https://repl.it
[17:14:09] <altendky> (whatever, there's 27 options and none of them are terribly beautiful)
[17:38:47] -!- Dave_Elec has quit [Read error: Connection reset by peer]
[17:39:08] -!- Dave_Elec has joined #pyqt
[18:05:35] -!- Bjander has joined #pyqt
[18:06:18] -!- Belxjander has quit [Ping timeout: 246 seconds]
[18:06:18] Bjander is now known as Belxjander
[18:11:16] -!- Dave_Elec has quit [Ping timeout: 250 seconds]
[18:12:22] -!- Dave_Elec has joined #pyqt
[18:29:39] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[18:30:06] -!- Belxjander has joined #pyqt
[18:50:07] -!- mandeep has joined #pyqt
[20:48:29] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[20:48:56] -!- Belxjander has joined #pyqt
[21:03:38] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[21:04:04] -!- Belxjander has joined #pyqt
[21:33:24] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[21:33:50] -!- Belxjander has joined #pyqt
[21:42:20] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[21:43:44] -!- Belxjander has joined #pyqt
[21:57:20] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[21:57:44] -!- Belxjander has joined #pyqt
[22:10:43] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[22:11:14] -!- Belxjander has joined #pyqt
[22:36:32] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[22:36:56] -!- Belxjander has joined #pyqt
[22:46:00] -!- Belxjander has quit [Ping timeout: 250 seconds]
[22:49:29] -!- Belxjander has joined #pyqt
[23:03:56] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[23:04:26] -!- Belxjander has joined #pyqt
[23:13:00] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[23:13:27] -!- Belxjander has joined #pyqt
[23:31:03] -!- Dave_Elec has quit [Ping timeout: 244 seconds]
[23:56:36] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[23:57:05] -!- Belxjander has joined #pyqt