45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
//
|
|
// Created by HW on 2023/07/26.
|
|
//
|
|
|
|
// You may need to build the project (run Qt uic code generator) to get "ui_MainWindowLagout.h" resolved
|
|
|
|
#include "mainwindowlayout.h"
|
|
#include "ui_MainWindowLayout.h"
|
|
|
|
|
|
MainWindowLayout::MainWindowLayout(QWidget *parent) :
|
|
QWidget(parent), ui(new Ui::MainWindowLayout) {
|
|
ui->setupUi(this);
|
|
layout=new QVBoxLayout(this);
|
|
buttons=new ButtonStruct[4];
|
|
buttons[0].text="主页";
|
|
buttons[0].logo=".\\images\\home.png";
|
|
buttons[0].index=0;
|
|
buttons[1].text="我的网址";
|
|
buttons[1].logo=".\\images\\address.png";
|
|
buttons[1].index=1;
|
|
buttons[2].text="我的资产";
|
|
buttons[2].logo=".\\images\\money.png";
|
|
buttons[2].index=2;
|
|
buttons[3].text="个人中心";
|
|
buttons[3].logo=".\\images\\personalcenter.png";
|
|
buttons[3].index=3;
|
|
for(auto i=0;i<4;i++){
|
|
list<<&buttons[i];
|
|
}
|
|
navBar=new NavBar(list,this);
|
|
layout->addWidget(navBar,1);
|
|
layout->addStretch(4);
|
|
layout->setMargin(0);
|
|
setLayout(layout);
|
|
}
|
|
|
|
MainWindowLayout::~MainWindowLayout() {
|
|
|
|
delete[] list[0];
|
|
delete navBar;
|
|
delete layout;
|
|
delete ui;
|
|
}
|