AdvertisingDialog.h
#pragma once
#include <QDialog>
#include "ui_AdvertisingDialog.h"
#include "Controller.h"
class AdvertisingDialog : public QDialog, public Ui_AdvertisingDialog
{
Q_OBJECT
public:
AdvertisingDialog(Controller* ctrl, QWidget *parent = Q_NULLPTR);
~AdvertisingDialog();
private:
//Ui::AdvertisingDialog ui;
Controller *m_controller;
};
AdvertisingDialog.cpp
#include "AdvertisingDialog.h"
AdvertisingDialog::AdvertisingDialog(Controller* ctrl, QWidget *parent) : QDialog(parent)
{
//ui.setupUi(this);
m_controller = ctrl;
setFixedSize(486, 388);
setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);//去掉标题栏
m_controller->RegisterAdvertisingDialog(this);
}
AdvertisingDialog::~AdvertisingDialog()
{
}
ui_AdvertisingDialog.h
/********************************************************************************
** Form generated from reading UI file 'AdvertisingDialog.ui'
**
** Created by: Qt User Interface Compiler version 5.6.3
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ADVERTISINGDIALOG_H
#define UI_ADVERTISINGDIALOG_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QDialog>
#include <QtWidgets/QHeaderView>
QT_BEGIN_NAMESPACE
class Ui_AdvertisingDialog
{
public:
void setupUi(QDialog *AdvertisingDialog)
{
if (AdvertisingDialog->objectName().isEmpty())
AdvertisingDialog->setObjectName(QStringLiteral("AdvertisingDialog"));
AdvertisingDialog->resize(803, 505);
retranslateUi(AdvertisingDialog);
QMetaObject::connectSlotsByName(AdvertisingDialog);
} // setupUi
void retranslateUi(QDialog *AdvertisingDialog)
{
AdvertisingDialog->setWindowTitle(QApplication::translate("AdvertisingDialog", "AdvertisingDialog", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class AdvertisingDialog: public Ui_AdvertisingDialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ADVERTISINGDIALOG_H
AdvertisingDialog.ui
标签:Qt,Ui,UI,ui,自带,include,public,AdvertisingDialog From: https://www.cnblogs.com/zhuchunlin/p/18456708