Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Qt.Connection Type error
Qt 6.11 is out! See what's new in the release blog

Qt.Connection Type error

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DAMSdevnationD Offline
    DAMSdevnationD Offline
    DAMSdevnation
    wrote on last edited by
    #1

    Hello all.

    When i run this code...

                self.timer = QTimer()
                self.timer.setInterval(1000)
                self.timer.timeout.connect(self.showtime, self.showbpm)
                self.timer.start()
    
        def showtime(self):
               time=QDateTime.currentDateTime()
               timeDisplay=time.toString(....) 
               self.label.setText(timeDisplay)
    
       def showbpm(self):
              bpm=sum(....)/100
              self.label2.setText(bpm)
    

    ... the output is:
    self.time.timeout.connect(self.showtime, self.showbpm)
    TypeError: Qt.ConnectionType expected, not 'method'

    How should I go about solving this error???

    jsulmJ 1 Reply Last reply
    0
    • DAMSdevnationD DAMSdevnation

      Hello all.

      When i run this code...

                  self.timer = QTimer()
                  self.timer.setInterval(1000)
                  self.timer.timeout.connect(self.showtime, self.showbpm)
                  self.timer.start()
      
          def showtime(self):
                 time=QDateTime.currentDateTime()
                 timeDisplay=time.toString(....) 
                 self.label.setText(timeDisplay)
      
         def showbpm(self):
                bpm=sum(....)/100
                self.label2.setText(bpm)
      

      ... the output is:
      self.time.timeout.connect(self.showtime, self.showbpm)
      TypeError: Qt.ConnectionType expected, not 'method'

      How should I go about solving this error???

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @DAMSdevnation said in Qt.Connection Type error:

      self.timer.timeout.connect(self.showtime, self.showbpm)

      You can't connect more than one slot to a signal in one connect() call...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • DAMSdevnationD Offline
        DAMSdevnationD Offline
        DAMSdevnation
        wrote on last edited by
        #3

        Ok, thanks!!!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved