一起看代码来玩玩QT之03coordinate
来源:互联网 发布:php调用c语言接口 编辑:程序博客网 时间:2024/06/04 08:13
coordinate:坐标
geometry:几何
/* 应用程序抽象类 */#include <QApplication>/*窗口类*/#include <QWidget>/* 按钮 */#include <QPushButton>int main(int argc, char* argv[]){ QApplication app(argc, argv); /* 构造一个窗口*/ QWidget w; /*显示窗口*/ w.show(); /* 按钮也是个窗口 */ QPushButton button; button.setText("Button"); /* 窗口对象的父子关系,影响显示位置 */ /* 没有父窗口的窗口,我们称之为主窗口 */ button.setParent(&w); button.show(); button.setGeometry(30, 30, 100, 30); /* QT对C++的拓展 */ // std::bind std::function QObject::connect(&button, SIGNAL(clicked()), &w, SLOT(close())); w.setWindowTitle("Hello World"); /*在exec中有一个消息循环*/ return app.exec();}
1 0
- 一起看代码来玩玩QT之03coordinate
- 一起看代码来玩玩QT之01Hello world
- 一起看代码来玩玩QT之02LineEdit
- 一起看代码来玩玩QT之04 Layout
- 一起看代码来玩玩QT之05 Controls
- 一起看代码来玩玩QT之06Event
- 一起看代码来玩玩QT之07 Painter
- 一起看代码来玩玩QT之10 Graphics
- 一起看代码来玩玩QT之11 Dialog
- 一起看代码来玩玩QT之17 json
- 一起看代码来玩玩QT之19 Process(进程)
- 一起看代码来玩玩QT之21 HttpClient
- 一起看代码来玩玩QT之23 audioRecord
- 一起看代码来玩玩QT之24 AudioPlayer
- 一起看代码来玩玩QT之06EventFilter (事件过滤)
- 一起看代码来玩玩QT之08 Draw(first projiect 画板)
- 一起看代码来玩玩QT之09 Signal and SLOT ( 信号和槽)
- 一起看代码来玩玩QT之12 MainWindow(menubar menu ……)
- nginx源码初读(2)--让烦恼从数据结构开始(ngx_buf/ngx_chain)
- Python3.5中IDLE打不开,显示IDLE‘s subprocess didn't make connection.
- 学习数据挖掘的顺序
- Android分析Universal-Image-Loader源码解析收获
- leetcode笔记--Ugly Number
- 一起看代码来玩玩QT之03coordinate
- Spark源码分析之六:Task调度(二)
- 函数式编程思想
- java(15)--servlet中Request相关知识
- Aapche自带的并发测试工具
- 一起看代码来玩玩QT之04 Layout
- 数组名的指针
- hdu4540 威威猫系列故事——打地鼠(简单DP)
- 无线热点(AP)不稳定之信道的配置优化实践-分析周围信道修改本地使用信道