#pyqt | Logs for 2019-02-27

Back
[03:37:45] -!- crmaurei has joined #pyqt
[04:30:26] -!- BPL has joined #pyqt
[07:33:17] -!- Bjander has joined #pyqt
[07:37:04] -!- Belxjander has quit [Ping timeout: 244 seconds]
[07:37:05] Bjander is now known as Belxjander
[08:38:32] -!- Siecje has joined #pyqt
[10:35:11] -!- kdas_ has joined #pyqt
[10:38:05] -!- kushal has quit [Ping timeout: 256 seconds]
[10:53:49] kdas_ is now known as kushal
[11:15:16] -!- AbleBacon has joined #pyqt
[11:16:29] -!- Afrix has joined #pyqt
[16:07:32] -!- Belxjander has quit [Ping timeout: 245 seconds]
[16:10:35] -!- Belxjander has joined #pyqt
[16:28:36] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[16:29:08] -!- Belxjander has joined #pyqt
[16:42:01] -!- mintograde has joined #pyqt
[16:54:12] -!- Belxjander has quit [Ping timeout: 245 seconds]
[16:58:30] -!- Belxjander has joined #pyqt
[16:58:30] Belxjander is now known as Belxjande
[16:59:25] -!- Siecje has parted #pyqt
[17:04:50] -!- Siecje has joined #pyqt
[17:08:02] -!- Siecje has parted #pyqt
[17:22:11] -!- storgance has joined #pyqt
[17:22:25] <storgance> altendky Avaris hello
[17:23:50] <altendky> storgance: i gotta run but ask away and i'll respond when i can
[17:28:04] -!- Belxjande has quit [Ping timeout: 258 seconds]
[17:30:38] -!- Belxjander has joined #pyqt
[17:32:09] -!- Belxjander has quit [Excess Flood]
[17:33:12] -!- Belxjander has joined #pyqt
[17:34:32] <storgance> altendky: Hopefully an easy question about set_text() and fill_from_index(): What is index? How would I use roles to set other kinds of text?
[17:38:12] -!- Belxjander has quit [Ping timeout: 250 seconds]
[17:49:02] -!- Belxjander has joined #pyqt
[17:52:11] -!- AbleBacon has quit [Quit: Leaving]
[17:53:26] -!- Belxjander has quit [Ping timeout: 255 seconds]
[18:01:05] -!- n1` has quit [Ping timeout: 255 seconds]
[18:03:30] <altendky> storgance: index will be a QModelIndex. The .data() method accepts a role parameter. https://doc.qt.io
[18:04:01] <altendky> storgance: you can store data to custom roles identified by numbers starting at the user role value.
[18:05:48] <storgance> altendky: Where do I define these ItemDataRoles? In the widget, or the delegate?
[18:15:27] <storgance> altendky: I will be back in a bit, won't get your messages, no bouncer.
[18:15:30] -!- storgance has quit [Quit: Page closed]
[19:31:08] -!- storgance has joined #pyqt
[19:31:10] <storgance> back
[19:31:24] <storgance> altendky did I miss anything?
[19:32:47] <altendky> storgance: nope. Side note, i use irccloud.com. you get a couple hours of bounce for free and logging too
[19:33:07] <altendky> storgance: the rules are just integers. I use an enumeration
[19:33:30] <altendky> storgance: when you set data into the model you can specify what role it is for.
[19:33:38] <altendky> storgance: can you share your code?
[19:34:33] <storgance> sure, not much different than it was before. here: https://pastebin.com
[19:36:08] <altendky> Down at the end you can .setData() on the item and specify the role
[19:38:18] <storgance> So, wait...where do I set the roles? In the example from https://qt-articles.blogspot.com , they set up a local enum in the delegate in the header file, but...in pyqt, would I just do it in init? In the top of the class?
[19:39:02] <altendky> storgance: I have it in my qt utility module
[19:40:04] -!- BPL has quit [Quit: Leaving]
[19:43:41] <altendky> I would just put it at the top of the file for now
[19:51:19] <storgance> Hmm, okay. Playing around with it now
[20:18:25] -!- storgance has quit [Ping timeout: 256 seconds]
[21:14:37] -!- mintograde has quit [Ping timeout: 245 seconds]
[22:55:43] -!- Afrix has quit [Quit: Leaving]