Skip to content

Implementing signals and slots #44

Description

@nikhil-sethi

I'm trying to implement a custom signal and slot but there seem to be a few errors.
I can't inherit from QObject(which seems to be the recommended way) as it doesn't exist. This example throws:
AttributeError: module 'PythonQt.QtCore' has no attribute 'QObject'
The discussion here doesn't seem to be resolved either.

If I do it without classes like so:

from PythonQt.QtCore import Signal
def slot():
    print("something")
sig = Signal("QVariant") # also tried without QVariant
sig.connect(slot)
sig.emit()

It results in a crash due to segmentation fault.
I'm new to Qt itself so would love any suggestions/right way of doing things. Thank You.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions