mbridak / not1mm

Not1MM != N1MM, An amateur radio contest logger for Linux.
GNU General Public License v3.0
89 stars 18 forks source link

Add name if lookuped into other_1 field. But...... #54

Closed DE8MSH closed 7 months ago

DE8MSH commented 8 months ago

I added this line (green):

image

But it creates a fine segmentation fault. Uhm... Why?

mbridak commented 8 months ago

That's a good question. I don't see a reason for it to segfault. But I would caution you against making field setting code in main.py

Only because the fields other_1 and other_2 are often modified and read by the contest plugins. They serve different purposes based on the contest chosen. You could nest it in code that makes sure it's running the general logging plugin. something like:

if self.contest:
    if self.contest.name ==  "General Logging":
        self.other_1.triggerCrash(True)

But back to the original question.... I really don't know.

DE8MSH commented 8 months ago

hmmmm. five lines deeper i use nick, too. no probs there. only if i settext to other_1 -- and i guess tabbing to name field (other_1) and focussing it. to me it makes no sense to xtract name/nickname and dont set it to other_1 (general logging). because of typing it manually from a to b ;) i dunno why its a difference if i type it manually or script does it.

mbridak commented 8 months ago

Yeah it's not the nick variable.

I inserted:

print(f"{type(self.other_1)}")
self.other_1.setText("test")

which resulted in:

<class 'PyQt5.QtWidgets.QLineEdit'>
Segmentation fault (core dumped)

So at the time self.other_1 is still a valid QLineEdit object, and I'm just passing in a plain vanilla string object. As far as I can tell it's crashing in the PyQt library.