您的位置:首页 > 其它

N种内核注入DLL的思路及实现

2010-06-12 09:01 246 查看
还是上次的hello qt!这次增加一个自定义的槽函数,用来改变QDlabel的内容.

改后的hello.h

#ifndef _HELLO_H_
#define _HELLO_H_
#include<QtGui/QtGui>
#include<QDialog>
class hello:public QDialog
{
Q_OBJECT
public:
hello(QWidget* =0);
QLabel* label;
public slots:
void myslot();
};
#endif

改后的hello.cpp

#include"hello.h"
#include<QtCore/QTextCodec>
hello::hello(QWidget* parent):QDialog(parent)
{
QPushButton* closeBtn = new QPushButton(tr("关闭"));
QPushButton* changeBtn = new QPushButton(tr("请点击一下测试"));
label = new QLabel(tr("wait for test!"));
label->setFont(QFont("ubuntu",35,QFont::Bold));
QVBoxLayout* dlgLayout= new QVBoxLayout;
dlgLayout->addWidget(label);
dlgLayout->addWidget(changeBtn);
dlgLayout->addWidget(closeBtn);
connect(closeBtn,SIGNAL(clicked()),this,SLOT(close()));
connect(changeBtn,SIGNAL(clicked()),this,SLOT(myslot()));
setLayout(dlgLayout);
}
void hello::myslot()
{
label->setText(tr("hello,qt!"));
}








本文出自 “笔记” 博客,请务必保留此出处http://zero66.blog.51cto.com/2729872/920758
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: