question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addCallback in qtWidget

See original GitHub issue

Hello @marcomusy,

I have been used addCallback in vedo2020 version and it worked. Recently, I upgraded my vedo verison to 2021.0.2, and I just found that the addCallback function no longer works for my pyqt application. I realized in the 2021 version, you have simplified the addCallback. The mousehighlight example works for me. I tried to adjust the related code according to the example, but always get the error as AttributeError: 'Plotter' object has no attribute '_timer_event_id'

The related code is something like

class Qt_App(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(Qt_App, self).__init__(parent)
        self.setupUi(self)
        
        self.vp = Plotter(qtWidget=self.vtkWidget)
        self.vp.addCallback('LeftButtonPressEvent', self.select)

    def select(self, evn):
        print('hello!', evn)

Could you help me figure it out? Many thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Tai-Hsiencommented, Jun 12, 2021

Hello @marcomusy, Thanks a lot. The github version works!

1reaction
marcomusycommented, Jun 11, 2021

Hi Bruce, sorry for the late reply, after: pip install -U git+https://github.com/marcomusy/vedo.git you should be able to run the example: https://github.com/marcomusy/vedo/blob/master/examples/other/qt_window1.py

Let me know if you encounter any problems

Read more comments on GitHub >

github_iconTop Results From Across the Web

QCallbackMapping Class | Qt 3D 6.4.1 - Qt Documentation
Allows to map the channels within the clip onto an invocation of a callback object. More... Header: #include <QCallbackMapping>. CMake: ...
Read more >
python - How to write a simple callback function?
I wrote the following code to test a simple callback function. def callback(a, b): print('Sum = {0}' ...
Read more >
help about PyQt Twisted Thread - Google Groups
Hello, everyone, I have a twisted use in python. The red part of the problem in the following code. I want a process...
Read more >
Radio-Qt5/radio.py at main · aptrinh/Radio-Qt5 · GitHub
addCallback ("right", self.right_clicked). self.LircHandler.addCallback("power", self.power_clicked) ... setStyleSheet("QWidget#Dialog {background-image: ...
Read more >
Example usage for com.google.common.util.concurrent ...
addCallback (task, new FutureCallback<Integer>() { @Override public void ... resize(final int width, final int height) { final QWidget view = this.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found