QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1094|回复: 1

Qt 图片显示问题???

[复制链接]
发表于 2005-3-25 16:16:28 | 显示全部楼层 |阅读模式
显示图片的程序是如何实现的.我用下面的方法可是不起作用!
#include<qpixmap.h>
#include<qwidget.h>
#include<qapplication.h>
#include<qvbox.h>
#include<qlabel.h>


class MyLabel : public QLabel
{
public:
MyLabel(QLabel *parent=0,const char *name=0);
};

MyLabel::MyLabel(QLabel *parent,const char *name)
: QLabel(parent,name)
{
QPixmap *pix = new QPixmap();
pix -> load("bird.bmp");
pix -> resize(622,98;
}

class MyWidget : public QVBox
{
public:
MyWidget(QWidget *parent=0,const char *name=0);
};


MyWidget::MyWidget(QWidget *parent,const char *name)
: QVBox(parent,name)
{
MyLabel *pic = new MyLabel();
connect(pic,SIGNAL(clicked()),qApp,SLOT(setPixmap()));
// pic -> indent(Qt::AlignHCenter);
}
}
int main(int argc , char **argv)
{
QApplication a(argc,argv);

MyWidget w;
w.setGeometry(0,0,622,220);
a.setMainWidget( &w );
w.show();
return a.exec();
}
发表于 2005-3-25 17:56:05 | 显示全部楼层
qt阿,目前不懂。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-10-6 13:10 , Processed in 0.037800 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表