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. [SOLVED] QDesignerCustomWidgetInterface Compiler errors when calling setupUi(this)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QDesignerCustomWidgetInterface Compiler errors when calling setupUi(this)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 1.8k 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.
  • Q Offline
    Q Offline
    QMartin
    wrote on last edited by
    #1

    Hi everyone!

    I have integrated a custom widget within QtDesigner, using the plugin approach. When creating a form which uses this widget, from Designer alone from scratch, and integrate it in my project .pro with

    @FORMS += ../newWidget.ui@

    I get after compilation three errors:

    @error: expected type-specifier before 'newWidget'
    error: cannot convert 'int*' to 'newWidget*' in assignment
    error: expected ';' before 'newWidget'@

    But when using the newWidget from a new project with a generated form, I get no errors. I can't find the reason... Any ideas?

    Thanks in advance

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QMartin
      wrote on last edited by
      #2

      Well, I think I haven't explained myself very much... The newWidget I'm talking about is produced from myWidget.h and myWidget.cpp. Both files are located in a folder named customWidget. Then I have a project, myWidgetPlugin, which creates the lib for this widget adding to it the existing files. Until here everything seems all right (libmywidget.so is generated and loaded correctly in QtDesigner).

      Then with QtDesigner I create a form which I saved as newWidget.ui, and one of its widgets is the custom widget I created before. But after I import this .ui to another project is when I get those errors messages, from the generated uic file ui_newWidget.h.

      Thanks!

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QMartin
        wrote on last edited by
        #3

        For any one who wants to know: it was something as simple as a naming conflict: the .ui title was the same as the class's... and ui_newWidget confused when calling

        @newWidget = new newWidget(centralWidget);@

        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