⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 03-01.cpp

📁 qt实例代码!《24小时学通qt编程》 的代码!不错!已经在qt2.3.7调试ok!第3章
💻 CPP
字号:
#include <qapplication.h>
#include <qwidget.h>

//in the class declaration, wo only need
//to include a new constructor. The other
//methods are inherited from Qwidget:
class MyMainwindow : public QWidget
{
public:
	MyMainwindow();
};

MyMainwindow::MyMainwindow()
{
	//set the maximum and minimum size
	//of the window (widget). wo don't
	//need to use the this .point,
	//because c++ defaults to the current
	//class anyway:
	setMinimumSize(200, 100);
	setMaximumSize(200, 100);
}

int main(int argc, char **argv)
{
	//create the required QApplication
	//object. pass on the command line
	//argument to the QApplication object
	QApplication a(argc,argv);
	//Create a MyMainWindow object, and then
	//set it as the main widget:
	MyMainwindow w;
	a.setMainWidget(&w);
	//Paint the MyMainWindow object and all
	//its child widgets to the screen
	w.show();
	//
	a.exec();
}	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -