【QT】自我学习笔记第四章——整合一个小项目

这篇博客记录了作者在QT学习过程中整合一个小项目的实践过程,通过应用之前学到的知识,创建了一个包含基本布局的小程序。文章包括头文件和源文件的编写,并展示了最终的程序效果图。
摘要由CSDN通过智能技术生成

制作小项目

利用之前学习的方法,整合一个具有基本布局的小程序
头文件:

#pragma once

#include <QtWidgets/QMainWindow>
#include <QtGui>
#include <QtWidgets>
#include <QMainWindow>
#include "ui_Myproject01.h"

class Myproject01 : public QMainWindow
{
	Q_OBJECT

public:
	Myproject01(QWidget *parent = Q_NULLPTR);
	void Mytitle();
	void Mymenu();
	void Mytoolbar();
	void InitWindow();

private:
	Ui::Myproject01Class ui;
	QDockWidget *mainwindows;                    // 图像窗口
	QString currentPath;                        // 当前图像的路径
	QLabel *imgLabel;                           // 图像显示框


private slots:
	void myhelp();
	void File_open();
	void File_new();
};

源文件:

#include "Myproject01.h"
#include <QtWidgets>
#pragma execution_character_set("utf-8") //解决汉字乱码问题

Myproject01::Myproject01(QWidget *parent)
	: QMainWindow(parent)
{
	ui.setupUi(this);
	this->resize(800, 600)
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值