Giter Site home page Giter Site logo

Comments (2)

yngve-sk avatar yngve-sk commented on June 5, 2024

I tried to reproduce this by just running the test on Mac and it does not produce it. However... The problem might be here?

def restore_text():
    self.copy_button.setIcon(QIcon(icon_path))

Timer(1.0, restore_text).start()

This does not check if the component has been destroyed. So if the user clicks it, then within 1sec does something that destroys the component (changing views or something like that), the timer will still trigger the restore_text function, which will try to modify a now non-existing component.

Maybe just a check for this in restore_text, something like this:

def restore_text():
    if self.copy_button.isVisible():
        self.copy_button.setIcon(QIcon(icon_path))

from ert.

eivindjahren avatar eivindjahren commented on June 5, 2024

Maybe just a check for this in restore_text, something like this:

def restore_text():
    if self.copy_button.isVisible():
        self.copy_button.setIcon(QIcon(icon_path))

Yes, the culprit is that the timer triggers after the object is destroyed, but isVisible doesn't solve this. Probably we will have to replace timer with a slot mechanism which can be disconnected.

from ert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.