#pyqt | Logs for 2019-02-01

Back
[01:13:28] -!- Grange has quit [Remote host closed the connection]
[02:17:16] -!- saraf has joined #pyqt
[02:35:08] -!- Belxjander has quit [Ping timeout: 250 seconds]
[02:42:25] -!- kushal has quit [Ping timeout: 256 seconds]
[02:42:35] -!- kdas_ has joined #pyqt
[03:39:13] kdas_ is now known as kushal
[03:59:07] -!- saraf has quit [Ping timeout: 240 seconds]
[04:24:04] -!- daegontaven has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
[04:25:00] -!- daegontaven has joined #pyqt
[04:47:31] -!- _AleX_ has quit [Quit: +++ath0]
[05:23:42] <Mrokii> Avaris: Regarding my "saved the old value"-issue with qTableViews. It's not about setData (which I know about), it's more about extending the functionality of a tableView. The specific problem I'm thinking about: A user can change a certain string in a column, but I want to make sure that it's unique (no other row contains the same string in the same column). If the user enters a string already present, the
[05:23:43] <Mrokii> cell should revert to waht it was before. But the signal only fires *after* the content was already changed, so the old value is lost. I have two solutions, both of which don't seem to be too elegant. 1: Save the initial value (when the rows are filled for the first time) in a backup-variable and change that one, when a valid name is entered - or 2: react on the selection-change-signal of the view, to save the
[05:23:45] <Mrokii> value in the cell (as that one has to fire before the user can make a change). I wonder if there's a more "elegant" solution.
[05:49:34] -!- _AleX_ has joined #pyqt
[05:52:27] -!- BPL has joined #pyqt
[06:16:51] <Avaris> Mrokii: which signal?
[06:18:49] <Avaris> note that view is only responsible with displaying stuff. dealing with data is model's job
[06:19:09] <Avaris> and model.setData is called before the change
[06:21:33] <Avaris> in fact that method is responsible for changing the data. so you'll have the old value in there
[06:29:20] <Mrokii> Avaris: Thanks, I'll take a look.
[08:00:32] -!- kushal has quit [Remote host closed the connection]
[08:00:52] -!- kushal has joined #pyqt
[08:59:08] -!- Siecje has joined #pyqt
[09:09:31] -!- kdas_ has joined #pyqt
[09:10:35] -!- kushal has quit [Ping timeout: 256 seconds]
[09:21:08] -!- Lauxley has joined #pyqt
[09:23:30] <altendky> This seems like the same situation as grange the other day. It's usually nice to give the user a chance to correct their entry without retyping everything. So maybe a delegate that doesn't submit until it's valid. Or retrigger the edit after a failed setData (with a later of remembering both the submitted value and the original value)
[09:23:45] <altendky> Mrokii: ^^^
[09:43:44] -!- Lauxley has quit [Remote host closed the connection]
[09:57:48] -!- BPL has quit [Quit: Leaving]
[10:49:25] kdas_ is now known as kushal
[12:25:33] -!- hazzy-m has joined #pyqt
[15:41:37] -!- mintograde has joined #pyqt
[16:56:46] -!- Siecje has quit [Quit: Leaving.]
[20:03:24] -!- JanC has quit [Remote host closed the connection]
[20:03:41] -!- JanC has joined #pyqt
[22:55:17] -!- Mrokii has quit [Ping timeout: 268 seconds]
[23:09:38] -!- Mrokii has joined #pyqt