#pyqt | Logs for 2019-02-16
Back
[00:45:16] -!- thebigj has joined #pyqt
[00:46:33] <thebigj> Hello
[00:47:10] <thebigj> The project https://github.com is developed using pyQT5
[00:47:36] <thebigj> Somehow after Yesterday, it is crashing with Segmentation fault
[00:47:59] <thebigj> I need help for debugging the cause of segmentation fault
[00:48:27] <thebigj> I tried going down the commits, but it is raising the same error
[00:48:37] <thebigj> Can anyone help to identify? Thanks!
[00:49:40] <thebigj> I can guide with making build of that software. Thanks
[01:13:17] <thebigj> Latest version 5.12 of PyQT is causing a Segmentation fault.
[01:13:45] <thebigj> and PyQt-sip 4.19.14
[01:14:38] <thebigj> Thanks
[03:09:11] daloko is now known as plasma_
[04:37:50] -!- n1` has joined #pyqt
[05:01:11] -!- n1` has quit [Quit: WeeChat 2.3]
[05:19:30] <The-Compiler> thebigj: do you get any output in a console? What if you add "import faulthandler; faulthandler.enable()" somewhere early in the startup process?
[05:19:54] <The-Compiler> thebigj: if that doesn't help with tracking it down, you can get a C++ stacktrace like described here: https://github.com
[05:48:30] -!- n1` has joined #pyqt
[05:49:46] <n1`> is i possible to embed and app for pyqt?
[05:50:01] <n1`> or at least run an app and be able to manage its window?
[05:55:08] <Avaris> n1`: https://doc.qt.io
[05:56:28] <Avaris> also https://doc.qt.io
[06:05:10] <n1`> thx ... any real examples please? :)
[06:20:20] -!- Grange has joined #pyqt
[06:21:46] <Grange> Hi all. when enabling the drag/drop for a TreeWidget, what do you do in the dragMoveEvent()? I don't quite understand what's the difference from dragEnterEvent().
[06:42:25] <Grange> I found that if I re-write dragMoveEvent() the same as dragEnterEvent(), which is doing an accept/ignore decision based on mime, I don't the dropIndicatorPosition is always 0. Without dropMoveEvent() I can get 0,1 or 2.
[06:43:50] -!- n1` has quit [Ping timeout: 272 seconds]
[06:44:06] <Grange> qt is so hard.
[06:45:35] -!- n1` has joined #pyqt
[06:48:07] <Grange> is it because the gaps between treeWidgetItems has a separate mime type?
[06:58:46] -!- mintograde has joined #pyqt
[07:10:21] -!- Grange has quit [Remote host closed the connection]
[07:10:46] -!- Grange has joined #pyqt
[07:11:13] -!- Grange has quit [Remote host closed the connection]
[07:11:21] <n1`> Grange: from my web based knowledge ... drag move is the moment you are dragging the item
[07:11:58] <n1`> Grange: and the drag enter is the event when the dragging item enters an item it can be dropped onto
[08:47:48] <altendky> Pretty sure I didn't touch either of those for my dnd. Qt calls something else to check droppability. But, they're gone so...
[09:03:01] -!- frispete has quit [Quit: Konversation terminated!]
[09:05:18] -!- frispete has joined #pyqt
[10:09:01] <Avaris> dragMoveEvent is useful if you want to do something while drag is ongoing. say, restrict the drop onto items only in treeview and not empty area. or auto-scroll view when your drag goes to the edges, etc.
[10:17:56] <Avaris> n1`: sorry, i have real example handy for qwindow thingy
[10:18:03] <Avaris> *i have no
[12:59:20] <altendky> Avaris: auto scroll is built-in. And... Lemme check my code...
[13:01:43] <Avaris> altendky: i know... and it's built in because it's in the overridden dragMoveEvent of qabstractitemview. i was showing it as an example for stuff that you can do
[13:02:47] <altendky> https://doc.qt.io
[13:02:58] <altendky> (perhaps also called in the exiting drag move event)
[13:05:02] <Avaris> (maybe i shouldn't have used model/view for my examples...)
[13:05:19] <altendky> BPL had an explanation of embedding external windows. https://stackoverflow.com
[13:05:24] <altendky> err, *example
[13:05:51] <altendky> n1`: ^^
[13:18:09] <n1`> altendky: cool thx...will have a look
[15:17:17] -!- n1` has quit [Ping timeout: 246 seconds]
[15:18:36] -!- Safa_[A_boy] has joined #pyqt
[15:19:31] -!- n1` has joined #pyqt
[15:20:58] <Safa_[A_boy]> Hello people. Using PyQt5.12. I have this code in Python (I rewrote it to show my issue) https://pastebin.com And this code in QML: "listObj.currentDataInfo['x'] = parseInt(myQQC2TextField)"
[15:21:38] <Safa_[A_boy]> The idea is that the value isn't updated, maybe because there is a setter for currentDataInfo but not for what's inside it. Is there a workaround other than setting the whole currentDataInfo?
[15:24:56] <altendky> Safa_[A_boy]: you'd have to create a custom object with the interface you want (like being able to `...['x'] = ...`) and have it call the proper stuff to trigger emitting the signal when there's a change
[15:25:07] <altendky> specifically that'd be __setitem__
[15:27:33] -!- n1` has quit [Ping timeout: 245 seconds]
[15:30:20] <Safa_[A_boy]> That would be it! Thanks a lot, altendky :)
[15:33:38] <Avaris> is the issue no signal emitting, or is it actually not changing the data?
[15:36:55] <Avaris> also, not sure if that's intentional or not but `somelist[-1]` will return something.` currentIndex = -1` sounds like no selection to me
[15:52:36] <Safa_[A_boy]> currentIndex is changed of course in QML. and I check the data. Only the assignment isn't done, and I was having the idea of this, that I'm changing what's inside with no setter
[15:53:16] <Safa_[A_boy]> tbh, I didn't know about __setitem__ but now. Learning things by time :)
[15:54:40] <Safa_[A_boy]> And yes, that's "listObj.currentDataInfo['x'] = parseInt(myQQC2TextField.text)"
[15:55:06] <Avaris> if the assignment isn't done with that, __setitem__ probably won't help.
[15:57:52] <Safa_[A_boy]> __setitem__ with a new interface object, instead of the dict.
[15:57:58] <Safa_[A_boy]> s/object/QObject
[15:58:06] <Avaris> what's the difference?
[15:58:34] <Safa_[A_boy]> When I actually set a value, with the __setitem__ special function I can emit that it has changed
[15:58:57] <Safa_[A_boy]> But now I can't, as I don't set the value of 'x', but the whole currentDataInfo
[15:58:59] <Avaris> that's what i was asking? is the value actually changing with that qml line or not?
[15:59:50] <Safa_[A_boy]> and not only that, I can actually *set* the value with a proper setter
[16:00:38] <Safa_[A_boy]> That qml line requires 'x' to have a setter, which can't happen, as it's a value in a dict
[16:01:08] <Safa_[A_boy]> With the interface object, __setitem__ will be it's setter
[16:01:14] <Avaris> __setitem__ and setter are different things
[16:01:21] -!- n1` has joined #pyqt
[16:02:22] <Avaris> besides, dict has __setitem__ already
[16:04:35] <altendky> i may have been off as to what's needed here, but if you want to be aware of item setting on an object you'll generally need to make a custom class and add the awareness in __setitem__
[16:05:11] <Avaris> that's what i was trying to understand :)
[16:06:22] <Avaris> when you do `whatever['x'] = foo` in qml does the `'x'` of that dict actually change, but no signal was emitted and your issue is not getting the signal emitted?
[16:06:47] <Avaris> or the `'x'` of that dict doesn't change? (which is a whole different issue)
[16:06:55] <altendky> agreed
[16:07:05] <altendky> might end up being one then the other
[17:10:25] -!- BPL has joined #pyqt
[17:30:16] -!- Safa_[A_boy] has quit [Quit: Leaving]
[18:05:53] -!- n1` has quit [Ping timeout: 245 seconds]
[18:30:53] -!- BPL has quit [Quit: Leaving]
[22:56:38] -!- mintograde has quit [Ping timeout: 272 seconds]