QT安装和Hello,world
生活随笔
收集整理的這篇文章主要介紹了
QT安装和Hello,world
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
QT安裝環(huán)境介紹:
https://blog.csdn.net/hechao3225/article/details/52981007
教程:
http://c.biancheng.net/qt/
Hello,world簡(jiǎn)單示例,VS下編寫純代碼的界面:
http://c.biancheng.net/view/1824.html
第一步:
第二步:
myclass.h文件
myclass.cpp文件
#include "myclass.h" #include <QLayout>MyClass::MyClass(QWidget *parent): QDialog(parent) {InitWidget();ui.setupUi(this); }MyClass::~MyClass() {}void MyClass::InitWidget() {btn_ = new QPushButton("zhangsan btn");root_layout_ = new QWidget(this);QHBoxLayout* lay = new QHBoxLayout();root_layout_->setLayout(lay);lay->addWidget(btn_);setLayout(lay); }其他文件默認(rèn)即可。
效果圖如下:
總結(jié)
以上是生活随笔為你收集整理的QT安装和Hello,world的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C#课堂笔记(二)
- 下一篇: 吴恩达《机器学习》学习笔记十一——应用机