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 579 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 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

    Christian EhrlicherC 1 Reply Last reply
    0
    • P Pradson

      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

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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
      0
      • Christian EhrlicherC Christian Ehrlicher

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

        P Offline
        P Offline
        Pradson
        wrote on 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

        Christian EhrlicherC 1 Reply Last reply
        0
        • P Pradson

          @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

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 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
          0
          • Christian EhrlicherC Christian Ehrlicher

            @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 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,

            Christian EhrlicherC 1 Reply Last reply
            0
            • P Pradson

              @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,

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 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
              0
              • Christian EhrlicherC Christian Ehrlicher

                @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 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

                • Login

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