0

I'm trying to change visibility of button after particular time in PyQt5 and Python but it's not working. it showing this error in console

self.done_btn.setVisible(True) AttributeError: 'MainWindow' object has no attribute 'done_btn'

Before timer Button should be hidden

done_btn = QAction(QIcon(os.path.join('images', 'done.png')), "Done", self)
    done_btn.setVisible(False)
    done_btn.triggered.connect(self.start_earning)
    guide.addAction(done_btn)

After Timer After timer completed button should be visible

def timeout(self):
    self.guidestate.setText('hello world')
    self.done_btn.setVisible(True)

Timer

t = Timer(5, self.timeout)
        t.start()
Muhammad Azeem
  • 309
  • 1
  • 2
  • 9

0 Answers0