setupUi is not a member of my QT application
-
Depending on what that interface contains, it could be simpler to just rebuilt it from scratch and be done with it.
-
======================TestWidget.h============================
#include <QWidget>#include "ui_TestWidget.h"
class TestWidget : public QWidget
{
Q_OBJECTpublic:
explicit TestWidget(QWidget *parent = 0);
~TestWidget() {}private:
Ui::TestWidget ui;
}; -
==================TestWidget.ui file
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>TestWidget</class> <widget class="QWidget" name="TestWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1037</width> <height>664</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="QGroupBox" name="groupBox"> <property name="title"> <string>GroupBox</string> </property> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QScrollArea" name="scrollArea"> <property name="widgetResizable"> <bool>true</bool> </property> <widget class="QWidget" name="scrollAreaWidgetContents"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1175</width> <height>584</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QLabel" name="label"> <property name="text"> <string>Testing</string> </property> </widget> </item> </layout> </widget> </widget> </item> </layout> </item> </layout> </widget> </item> </layout> </widget> <resources/> <connections/> </ui> -
============================ui_TestWidget.h <=== this file is generated and you do not change it.
#ifndef UI_TESTWIDGET_H
#define UI_TESTWIDGET_H#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QScrollArea>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>QT_BEGIN_NAMESPACE
class Ui_TestWidget
{
public:
QVBoxLayout *verticalLayout_2;
QGroupBox *groupBox;
QHBoxLayout *horizontalLayout;
QVBoxLayout *verticalLayout;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QVBoxLayout *verticalLayout_3;
QLabel *label;void setupUi(QWidget *TestWidget) { if (TestWidget->objectName().isEmpty()) TestWidget->setObjectName(QString::fromUtf8("TestWidget")); TestWidget->resize(1037, 664); verticalLayout_2 = new QVBoxLayout(TestWidget); verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); groupBox = new QGroupBox(TestWidget); groupBox->setObjectName(QString::fromUtf8("groupBox")); horizontalLayout = new QHBoxLayout(groupBox); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); verticalLayout = new QVBoxLayout(); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); scrollArea = new QScrollArea(groupBox); scrollArea->setObjectName(QString::fromUtf8("scrollArea")); scrollArea->setWidgetResizable(true); scrollAreaWidgetContents = new QWidget(); scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents")); scrollAreaWidgetContents->setGeometry(QRect(0, 0, 1175, 584)); verticalLayout_3 = new QVBoxLayout(scrollAreaWidgetContents); verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); label = new QLabel(scrollAreaWidgetContents); label->setObjectName(QString::fromUtf8("label")); verticalLayout_3->addWidget(label); scrollArea->setWidget(scrollAreaWidgetContents); verticalLayout->addWidget(scrollArea); horizontalLayout->addLayout(verticalLayout); verticalLayout_2->addWidget(groupBox); retranslateUi(TestWidget); QMetaObject::connectSlotsByName(TestWidget); } // setupUi void retranslateUi(QWidget *TestWidget) { TestWidget->setWindowTitle(QCoreApplication::translate("TestWidget", "Form", nullptr)); groupBox->setTitle(QCoreApplication::translate("TestWidget", "GroupBox", nullptr)); label->setText(QCoreApplication::translate("TestWidget", "Testing", nullptr)); } // retranslateUi};
namespace Ui {
class TestWidget: public Ui_TestWidget {};
} // namespace UiQT_END_NAMESPACE
#endif // UI_TESTWIDGET_
-
============================ui_TestWidget.h <=== this file is generated and you do not change it.
#ifndef UI_TESTWIDGET_H
#define UI_TESTWIDGET_H#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QScrollArea>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>QT_BEGIN_NAMESPACE
class Ui_TestWidget
{
public:
QVBoxLayout *verticalLayout_2;
QGroupBox *groupBox;
QHBoxLayout *horizontalLayout;
QVBoxLayout *verticalLayout;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QVBoxLayout *verticalLayout_3;
QLabel *label;void setupUi(QWidget *TestWidget) { if (TestWidget->objectName().isEmpty()) TestWidget->setObjectName(QString::fromUtf8("TestWidget")); TestWidget->resize(1037, 664); verticalLayout_2 = new QVBoxLayout(TestWidget); verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); groupBox = new QGroupBox(TestWidget); groupBox->setObjectName(QString::fromUtf8("groupBox")); horizontalLayout = new QHBoxLayout(groupBox); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); verticalLayout = new QVBoxLayout(); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); scrollArea = new QScrollArea(groupBox); scrollArea->setObjectName(QString::fromUtf8("scrollArea")); scrollArea->setWidgetResizable(true); scrollAreaWidgetContents = new QWidget(); scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents")); scrollAreaWidgetContents->setGeometry(QRect(0, 0, 1175, 584)); verticalLayout_3 = new QVBoxLayout(scrollAreaWidgetContents); verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); label = new QLabel(scrollAreaWidgetContents); label->setObjectName(QString::fromUtf8("label")); verticalLayout_3->addWidget(label); scrollArea->setWidget(scrollAreaWidgetContents); verticalLayout->addWidget(scrollArea); horizontalLayout->addLayout(verticalLayout); verticalLayout_2->addWidget(groupBox); retranslateUi(TestWidget); QMetaObject::connectSlotsByName(TestWidget); } // setupUi void retranslateUi(QWidget *TestWidget) { TestWidget->setWindowTitle(QCoreApplication::translate("TestWidget", "Form", nullptr)); groupBox->setTitle(QCoreApplication::translate("TestWidget", "GroupBox", nullptr)); label->setText(QCoreApplication::translate("TestWidget", "Testing", nullptr)); } // retranslateUi};
namespace Ui {
class TestWidget: public Ui_TestWidget {};
} // namespace UiQT_END_NAMESPACE
#endif // UI_TESTWIDGET_
@JoeCFD I have it all the same except for one line in my pathloss.ui file. It has my widget class as a "QFrame" and it has to be changed in the design mode it says
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <author>free</author> <class>pathloss</class> <widget class="QFrame" name="pathloss"> <property name="geometry"> -
use upper case
<class>pathloss</class> ===> <class>Pathloss</class>
<widget class="QFrame" name="Pathloss"> <====not critical@JoeCFD I was able to edit the xml and change my widgets section to be a QWidget and I'm dealing with some other errors from here. Thanks