当前位置:网站首页>QT is the most basic layout, creating a window interface
QT is the most basic layout, creating a window interface
2022-07-26 15:25:00 【AdleyTales】
#include "mainwindow.h"
#include <QMenuBar>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QDockWidget>
#include <QTextEdit>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
resize(400,300);
QMenuBar *menubar = new QMenuBar(this);
setMenuBar(menubar);
QMenu *filename = menubar->addMenu(" file ");
QMenu *editmenu = menubar->addMenu(" edit ");
QMenu *buildname = menubar->addMenu(" structure ");
filename->addAction(" New file ");
filename->addAction(" Open file ");
filename->addSeparator();
filename->addAction(" Close file ");
editmenu->addAction(" recovery ");
buildname->addAction(" Build all projects ");
// ToolBar
QToolBar *toolbar = new QToolBar(this);
addToolBar(Qt::TopToolBarArea, toolbar);
toolbar->addAction(" newly build ");
toolbar->addSeparator();
toolbar->addAction(" open ");
toolbar->addSeparator();
toolbar->addAction(" close ");
// statusbar
QStatusBar *statusbar = new QStatusBar(this);
setStatusBar(statusbar);
QLabel *label = new QLabel(this);
label->setText(" status bar ");
statusbar->addWidget(label);
// DockWidgets Floating window Docking window Docking position of the central part
// verification : Whether the floating window is on the left side of the central part
QDockWidget *dockWidget = new QDockWidget(" A small window ", this);
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
// Center Widget Text editor or browser section
QTextEdit *edit = new QTextEdit(this);
setCentralWidget(edit);
}
MainWindow::~MainWindow()
{
}

边栏推荐
- R语言使用lm函数构建多元回归模型(Multiple Linear Regression)、并根据模型系数写出回归方程、使用fitted函数计算出模型的拟合的y值(响应值)向量
- 软测(七)性能测试(1)简要介绍
- Pytorch installation CUDA corresponding
- R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize dot plot, set the add parameter to add the mean and standard deviation vertical lines, and set the error.plo
- Prometheus adds redis and MySQL node monitoring
- MYSQL 命令大全
- 桌面应用布局图
- Interview with data center and Bi business (IV) -- look at the essence of ten questions
- USB to serial port parameter configuration function
- 2023 catering industry exhibition, China catering supply chain exhibition and Jiangxi catering Ingredients Exhibition were held in February
猜你喜欢
![[leetcode daily question] - 121. The best time to buy and sell stocks](/img/51/ae7c4d903a51d97b70d5e69c6fffaa.png)
[leetcode daily question] - 121. The best time to buy and sell stocks

Prometheus adds redis and MySQL node monitoring

Deep packet inspection using cuckoo filter paper summary

The IPO of shengtaier technology was terminated: it was planned to raise 560million yuan, and Qiming and Jifeng capital were shareholders

【C】 Flexible array

C# 给Word每一页设置不同文字水印

anaconda No module named ‘cv2‘

QCF for deep packet inspection paper summary

Devsecops, speed and security

信用卡数字识别(opencv,代码分析)
随机推荐
李宏毅《机器学习》丨3. Gradient Descent(梯度下降)
OSPF and mGRE experiments
兆骑科创高端人才项目引进落地,双创大赛承办,线上直播路演
cs224w(图机器学习)2021冬季课程学习笔记5
Within a week, I developed my own knowledge sharing platform
Prometheus adds redis and MySQL node monitoring
Bluetooth ble4.0-hm-10 device pairing Guide
桌面应用布局图
R语言使用lm函数构建多元回归模型(Multiple Linear Regression)、并根据模型系数写出回归方程、使用fitted函数计算出模型的拟合的y值(响应值)向量
2023餐饮业展,中国餐饮供应链展,江西餐饮食材展2月举办
How do college students apply for utility model patents?
pytorch---进阶篇(函数使用技巧/注意事项)
【C】 Flexible array
How to translate academic documents?
R language tests the significance of correlation coefficient: use Cor The test function calculates the value and confidence interval of the correlation coefficient and its statistical significance (if
C# 给Word每一页设置不同文字水印
R语言ggplot2可视化:使用ggplot2可视化散点图、使用ggpubr包的theme_pubclean函数设置可视化图像不包含坐标轴线的主题(theme without axis lines)
Continuous integration (II) introduction to the basic use of Jenkins
R语言ggplot2可视化:使用ggpubr包的ggballoonplot函数可视化气球图(可视化由两个分类变量组成的列联表)、配置guides函数中的size参数指定不显示数据点大小的图例
R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize dot plot, set the add parameter to add the mean and standard deviation vertical lines, and set the error.plo