flyonok

统计

留言簿(7)

ACE

book

boost

bsd

c study

c++

code download

codeblock

computer clound

Eclipse

embed system

erlang

ET++

gtk

ic card

java

KDE

libevent

linux

linux--MM

mysql

network education

one card

oracle

pcap relation

php

powerbuilder

python

QT

software config

software test

SQL server

UML

wireless

wxwidgets

陈宾

阅读排行榜

评论排行榜

Qt--help

#include <QApplication>
#
include <QFont>
#
include <QPushButton>

 int main(int argc
, char *argv[])
 {
     QApplication app(argc
, argv);

     QPushButton quit(
"Quit");
     quit
.resize(75, 30);
     quit
.setFont(QFont("Times", 18, QFont::Bold));

     QObject
::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));

     quit
.show();
     
return app.exec();
 }

1、
QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));

QObject::connect() is perhaps the most central feature of Qt. Note that connect() is a static function in QObject. Do not confuse it with the connect() function in the Berkeley socket library.

This connect() call establishes a one-way connection between two Qt objects (objects that inherit QObject, directly or indirectly). Every Qt object can have both signals (to send messages) and slots (to receive messages). All widgets are Qt objects, since they inherit QWidget, which in turn inherits QObject.



posted on 2007-12-26 17:54 flyonok 阅读(505) 评论(0)  编辑 收藏 引用 所属分类: program


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理