Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt4 to qt5
Qt 6.11 is out! See what's new in the release blog

Qt4 to qt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 1.1k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    Extant
    wrote on last edited by
    #1

    Could someone please spare a minute to translate this to Qt5 to help me understand what I need to do to get an old qt4 program to run.
    "self.connect(self.drawWidget, SIGNAL('update_color'), self.colorPush.setStyleSheet)"

    Translation script gives me
    "self.drawWidget.update_color.connect(self.colorPush.setStyleSheet)"

    But "AttributeError: 'GUIDraw' object has no attribute 'update_color'"

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      The script is wrong, the old statement is correct

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Extant
        wrote on last edited by
        #3

        Thanks I'll reload originals and start again.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Extant
          wrote on last edited by
          #4

          Back where I started
          self.connect(self.drawWidget, SIGNAL('update_color'), self.colorPush.setStyleSheet)
          AttributeError: 'GUIDesign' object has no attribute 'connect'
          Which takes me back again to
          "Using QObject.connect() and similar in PyQt4 is known as "Old style signals", and is not supported in PyQt5 anymore, it supports only "New style signals","

          JonBJ 1 Reply Last reply
          0
          • E Extant

            Back where I started
            self.connect(self.drawWidget, SIGNAL('update_color'), self.colorPush.setStyleSheet)
            AttributeError: 'GUIDesign' object has no attribute 'connect'
            Which takes me back again to
            "Using QObject.connect() and similar in PyQt4 is known as "Old style signals", and is not supported in PyQt5 anymore, it supports only "New style signals","

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by
            #5

            @Extant

            self.drawWidget.update_color.connect(self.colorPush.setStyleSheet)
            
            1 Reply Last reply
            3
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Can you show the implementation of your DrawWidget class ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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