|

楼主 |
发表于 2003-11-3 08:34:28
|
显示全部楼层
- /****************************************************************************
- ** ui.h extension file, included from the uic-generated form implementation.
- **
- ** If you wish to add, delete or rename functions or slots use
- ** Qt Designer which will update this file, preserving your code. Create an
- ** init() function in place of a constructor, and a destroy() function in
- ** place of a destructor.
- *****************************************************************************/
- /* helloworld.cpp */
- #include <qapplication.h>
- #include <qlabel.h>
- #include <qstring.h>
- int main( int argc, char **argv)
- {
- QApplication app(argc,argv);
- QLable *label = new QLabel(NULL);
- QString string ("Hello, world");
- label->setText(string);
- label->setAlignment( Qt:AlignVCenter | Qt::AlignHCenter);
- label->setGeometry(0,0,180,75);
- label->show();
- app.setMainWidget(label);
- return (app.exec());
- }
复制代码
书上的例子,应该不会错吧!!! |
|