init code

This commit is contained in:
2025-07-24 04:08:36 +08:00
commit 0430307f4b
22 changed files with 1186 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#include "widget.h"
#include "ui_widget.h"
using namespace NS_QGobangClient;
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
+37
View File
@@ -0,0 +1,37 @@
#ifndef WIDGET_H
#define WIDGET_H
/***************************************************************
* @file Widget.h
* @author Art_Sakura
* @date 2025-07-24
* @brief 该Ui为示例类, 后续会删除
***************************************************************/
#include <QWidget>
//记得加命名空间 添加命名空间后 UI文件也得加
//你也可以将UI的命名空间声明到外面, 这样就可以不用加命名空间了, 当然不推荐
namespace NS_QGobangClient
{
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = nullptr);
~Widget();
private:
Ui::Widget *ui;
};
}
#endif // WIDGET_H
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NS_QGobangClient::Widget</class>
<widget class="QWidget" name="NS_QGobangClient::Widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Widget</string>
</property>
</widget>
<resources/>
<connections/>
</ui>