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. Multiple UI Files Compile Error
Forum Updated to NodeBB v4.3 + New Features

Multiple UI Files Compile Error

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 467 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.
  • T Offline
    T Offline
    tommygun
    wrote on last edited by
    #1

    Hi.

    I'm trying to edit an existing app for personal use which has 2 .ui files, but I'm getting one error when building a new project in Qt Creator.

    Here a list of files in the project:

    ExtendFrame.h
    MiniFrame.h
    ui_ExtendFrame.h
    ui_MiniFrame.h

    ExtendFrame.cpp
    main.cpp
    MiniFrame.cpp

    ExtendFrame.ui
    MiniFrame.ui

    The Error is in MiniFrame.cpp

    #include "MiniFrame.h"
    #include "ui_MiniFrame.h"
    
    miniplugin_bgwidget::miniplugin_bgwidget(QWidget *parent) :
        QWidget(parent),
        ui(new Ui::miniplugin_bgwidget)
    {
        ui->setupUi(this);
    }
    
    miniplugin_bgwidget::~miniplugin_bgwidget()
    {
        delete ui;
    }
    

    Error Message:

    ..\MiniFrame.cpp:8: error: no matching function for call to 'Ui::miniplugin_bgwidget::setupUi(miniplugin_bgwidget*)'
    ui->setupUi(this);
    ^

    In file included from ..\MiniFrame.cpp:2:0:

    ..\ui_MiniFrame.h:45: candidate: void Ui_miniplugin_bgwidget::setupUi(QFrame*)
    void setupUi(QFrame *miniplugin_bgwidget)
    ^

    ..\ui_MiniFrame.h:45: note: no known conversion for argument 1 from 'miniplugin_bgwidget*' to 'QFrame*'.

    Line 45 in ui_MiniFrame.h

    void setupUi(QFrame *miniplugin_bgwidget)
    

    Any advise how to fix this error would be very much appreciated.

    Thanks in advance for any feedback.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hmm it sounds like you first based your widget on QFrame and later edit files to
      inherited QWidgets.
      Maybe just try again and generate them?
      normally it just works if you use the wizard.

      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