摘要: #include <qapplication.h>#include <qhbox.h>#include <qslider.h>#include <qspinbox.h>int main(int argc,char *argv[]){ QApplication app(argc,argv); QHBox *hbox=new QHBox(0); hbox->setCaption("Enter your age:"); hbox->setMargin(6); hbox->setSpacing(6); QSpinBo 阅读全文
posted @ 2010-09-25 22:22 郭—大—侠 阅读(592) 评论(0) 推荐(0) 编辑
摘要: #include <qapplication.h>#include <qpushbutton.h>int main(int argc,char *argv[]){ QApplication app(argc,argv); QPushButton *button=new QPushButton("QUIT",0);QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit())); button->show(); return app.exec();}///这里我还象第二个例子似的还在 阅读全文
posted @ 2010-09-25 21:57 郭—大—侠 阅读(206) 评论(0) 推荐(0) 编辑
摘要: #include <qapplication.h>#include <qlabel.h>int main(int argc,char *argv[]){ QApplication app(argc,argv); QLabel *label=new QLabel("<h2><i>Hello""<font color=red> Qt!</font></h2>",0); label->show(); return app.exec();}编译方法类似第一个,qmake - 阅读全文
posted @ 2010-09-25 21:37 郭—大—侠 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 今天开始学习QT编程。其实我是比较讨厌界面编程的,感觉没有什么意思,项目需要就开始学习QT。打算从QT4学。虽然资料还不是很多。#include <qapplication.h>#include <qpushbutton.h>int main( int argc, char **argv ){ QApplication a( argc, argv ); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hell 阅读全文
posted @ 2010-09-25 21:22 郭—大—侠 阅读(351) 评论(0) 推荐(0) 编辑