helloworld.cpp

来自「《Linux程序设计权威指南》源代码」· C++ 代码 · 共 25 行

CPP
25
字号
	/* File: helloworld.cpp */	#include <kapp.h>	#include <klocale.h>	#include <qpushbutton.h>	int main( int argc, char **argv )	{		KApplication app(argc, argv , "HelloWorld"); 		//建立按钮		QPushButton *button = new QPushButton(i18n("Hello World!"), 0);		button->setAutoResize( TRUE ); 		//建立按钮回调		QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));		//把按钮组件设置为主窗口		app.setMainWidget(button);		button->show(); 		//进入循环		return app.exec();	}

⌨️ 快捷键说明

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