Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Designer is unable to load the custom widgets (PyQt) widgets.
Forum Updated to NodeBB v4.3 + New Features

Qt Designer is unable to load the custom widgets (PyQt) widgets.

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 2 Posters 578 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.
  • P Offline
    P Offline
    Pradson
    wrote on 6 Dec 2023, 04:38 last edited by
    #1

    Hello,

    I have a qt designer (built with version Qt-5.12.3) and it is able to load the custom widgets of PyQt-5.12.3. I have migrated the qt designer from Qt5.12.3 to Qt-6.4.0, now I am unable to load the same. I have shared the code snippet of the designer below. I am getting the "coll->customWidgets().count()" is zero ().

    void QDesignerPluginManagerPrivate::addCustomWidgets(QObject *o,
                                                         const QString &pluginPath,
                                                         const QString &designerLanguage)
    {
        QDesignerCustomWidgetInterface *c = qobject_cast<QDesignerCustomWidgetInterface*>(o);
        if (c != nullptr)
        {
            addCustomWidget(c, pluginPath, designerLanguage);
            return;
        }
    
        const QDesignerCustomWidgetCollectionInterface *coll = qobject_cast<QDesignerCustomWidgetCollectionInterface*>(o);
        if (coll != nullptr)
        {
    		QMessageBox::warning(0, QStringLiteral("coll->customWidgets().count()"), QString::number(coll->customWidgets().count()) );
            foreach(QDesignerCustomWidgetInterface *c, coll->customWidgets())
    			addCustomWidget(c, pluginPath, designerLanguage);
        }
    }
    

    But I have kept same PyQt6.dll in the designer's plugin directory of the actual Qt-6.4.0, then it is able to load. In mine migrated designer it is unable to load.

    I have checked that the PyQt6.dll is loaded and instantiated properly. Kindly suggest.

    Thanks

    C 1 Reply Last reply 6 Dec 2023, 05:37
    0
    • P Pradson
      6 Dec 2023, 04:38

      Hello,

      I have a qt designer (built with version Qt-5.12.3) and it is able to load the custom widgets of PyQt-5.12.3. I have migrated the qt designer from Qt5.12.3 to Qt-6.4.0, now I am unable to load the same. I have shared the code snippet of the designer below. I am getting the "coll->customWidgets().count()" is zero ().

      void QDesignerPluginManagerPrivate::addCustomWidgets(QObject *o,
                                                           const QString &pluginPath,
                                                           const QString &designerLanguage)
      {
          QDesignerCustomWidgetInterface *c = qobject_cast<QDesignerCustomWidgetInterface*>(o);
          if (c != nullptr)
          {
              addCustomWidget(c, pluginPath, designerLanguage);
              return;
          }
      
          const QDesignerCustomWidgetCollectionInterface *coll = qobject_cast<QDesignerCustomWidgetCollectionInterface*>(o);
          if (coll != nullptr)
          {
      		QMessageBox::warning(0, QStringLiteral("coll->customWidgets().count()"), QString::number(coll->customWidgets().count()) );
              foreach(QDesignerCustomWidgetInterface *c, coll->customWidgets())
      			addCustomWidget(c, pluginPath, designerLanguage);
          }
      }
      

      But I have kept same PyQt6.dll in the designer's plugin directory of the actual Qt-6.4.0, then it is able to load. In mine migrated designer it is unable to load.

      I have checked that the PyQt6.dll is loaded and instantiated properly. Kindly suggest.

      Thanks

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 6 Dec 2023, 05:37 last edited by
      #2

      Did you compile the plugin with the same Qt version as designer?

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

      P 1 Reply Last reply 6 Dec 2023, 06:37
      0
      • C Christian Ehrlicher
        6 Dec 2023, 05:37

        Did you compile the plugin with the same Qt version as designer?

        P Offline
        P Offline
        Pradson
        wrote on 6 Dec 2023, 06:37 last edited by
        #3

        @Christian-Ehrlicher

        Thanks for reply.

        Actually, I am trying to load pyqt6.4.0 custom widgets and I have built the PyQt6.4.0 with the Qt version 6.4.0

        C 1 Reply Last reply 6 Dec 2023, 06:48
        0
        • P Pradson
          6 Dec 2023, 06:37

          @Christian-Ehrlicher

          Thanks for reply.

          Actually, I am trying to load pyqt6.4.0 custom widgets and I have built the PyQt6.4.0 with the Qt version 6.4.0

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 6 Dec 2023, 06:48 last edited by
          #4

          @Pradson This does not matter if you want to use it in designer. Please read my post. You have to use the same Qt version as the designer was built with.

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

          P 1 Reply Last reply 7 Dec 2023, 04:37
          0
          • C Christian Ehrlicher
            6 Dec 2023, 06:48

            @Pradson This does not matter if you want to use it in designer. Please read my post. You have to use the same Qt version as the designer was built with.

            P Offline
            P Offline
            Pradson
            wrote on 7 Dec 2023, 04:37 last edited by
            #5

            @Christian-Ehrlicher

            Yes, I have built the designer, plugins, and the PyQt-6.4.0 with the Qt version 6.4.0. But still, I am unable to load PyQt-6.4.0 custom plugins into the designer. Even, I have set all the environment variables properly.

            Thanks,

            C 1 Reply Last reply 7 Dec 2023, 06:20
            0
            • P Pradson
              7 Dec 2023, 04:37

              @Christian-Ehrlicher

              Yes, I have built the designer, plugins, and the PyQt-6.4.0 with the Qt version 6.4.0. But still, I am unable to load PyQt-6.4.0 custom plugins into the designer. Even, I have set all the environment variables properly.

              Thanks,

              C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 7 Dec 2023, 06:20 last edited by
              #6

              @Pradson said in Qt Designer is unable to load the custom widgets (PyQt) widgets.:

              designer

              You still not answered if designer was built with Qt 6.4...
              Did you check that the plugin is in the correct place? Do you see your plugin in Help -> Plugins?

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

              P 1 Reply Last reply 7 Dec 2023, 07:04
              0
              • C Christian Ehrlicher
                7 Dec 2023, 06:20

                @Pradson said in Qt Designer is unable to load the custom widgets (PyQt) widgets.:

                designer

                You still not answered if designer was built with Qt 6.4...
                Did you check that the plugin is in the correct place? Do you see your plugin in Help -> Plugins?

                P Offline
                P Offline
                Pradson
                wrote on 7 Dec 2023, 07:04 last edited by
                #7

                @Christian-Ehrlicher said in Qt Designer is unable to load the custom widgets (PyQt) widgets.:

                You still not answered if designer was built with Qt 6.4...

                  Yes, I have build the designer with Qt-6.4.0  
                

                Did you check that the plugin is in the correct place?
                Yes, plugins are in correct place.

                Do you see your plugin in Help -> Plugins?
                Yes, PyQt6.dll is loaded without pyqt plugins.

                Thanks.

                1 Reply Last reply
                0

                1/7

                6 Dec 2023, 04:38

                • Login

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