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 plugin error

Qt Designer plugin error

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 455 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.
  • Q Offline
    Q Offline
    QuteNewbie
    wrote on last edited by
    #1

    I've managed to compile the code from here: https://github.com/PacktPublishing/Cross-Platform-Development-with-Qt-6-and-Modern-Cpp/tree/master/Chapter03/MyWidgets

    but under QT 5.14.2. My Qt Creator is version: 4.15.2, Deisgner is version as QT.
    I have widget collection plugin:one custom Qframe, MyFrame and one custom QLabel,MyLabel.
    I can use them (they are just skeletons basicaly,no useful code there). When I go to QtDesigner->Help-About Plugins->Refresh I get this error:
    "The class attribute for the class Mylabel does not match the class name MyLabel."

    My Question is : "Which class attribute is this message referring to??".
    I don't get it.

    Everything is labeled (where appropriate) "MyLabel".
    My label domXml function is this:

    QString MyLabelPlugin::domXml() const
    {
    return QLatin1String("<ui language="c++" displayname="MyLabel"><widget class="Mylabel" name="Mylabel">\n\n<property name="geometry">\n<rect>\n<x>0</x>\n<y>0</y>\n<width>100</width>n\n <height>16</height>n\n </rect>\n</property>\n\n<property name="text">\n<string>myLabel</string>\n</property>\n\n</widget>\n</ui>");
    }

    JonBJ 1 Reply Last reply
    0
    • Q QuteNewbie

      I've managed to compile the code from here: https://github.com/PacktPublishing/Cross-Platform-Development-with-Qt-6-and-Modern-Cpp/tree/master/Chapter03/MyWidgets

      but under QT 5.14.2. My Qt Creator is version: 4.15.2, Deisgner is version as QT.
      I have widget collection plugin:one custom Qframe, MyFrame and one custom QLabel,MyLabel.
      I can use them (they are just skeletons basicaly,no useful code there). When I go to QtDesigner->Help-About Plugins->Refresh I get this error:
      "The class attribute for the class Mylabel does not match the class name MyLabel."

      My Question is : "Which class attribute is this message referring to??".
      I don't get it.

      Everything is labeled (where appropriate) "MyLabel".
      My label domXml function is this:

      QString MyLabelPlugin::domXml() const
      {
      return QLatin1String("<ui language="c++" displayname="MyLabel"><widget class="Mylabel" name="Mylabel">\n\n<property name="geometry">\n<rect>\n<x>0</x>\n<y>0</y>\n<width>100</width>n\n <height>16</height>n\n </rect>\n</property>\n\n<property name="text">\n<string>myLabel</string>\n</property>\n\n</widget>\n</ui>");
      }

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @QuteNewbie said in Qt Designer plugin error:

      "The class attribute for the class Mylabel does not match the class name MyLabel."

      Look at the spelling/capitalization of your two different spellings in the message and in the file you show....?

      1 Reply Last reply
      2
      • Q Offline
        Q Offline
        QuteNewbie
        wrote on last edited by QuteNewbie
        #3

        This is the culprit: displayname="MyLabel"><widget class="Mylabel" name="Mylabel"

        Thanks. That does it! I have fixed the caps missmatch.

        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