在qt for symbian中查看图像
我有一个我实现的应用程序,希望在一个小部件中显示一个图像,但我得到一个错误SIGSEGV,我从一个目录中查看它,但实际上是在从缓冲区中取出后 问题不在于我把代码留在这里:在qt for symbian中查看图像,qt,Qt,我有一个我实现的应用程序,希望在一个小部件中显示一个图像,但我得到一个错误SIGSEGV,我从一个目录中查看它,但实际上是在从缓冲区中取出后 问题不在于我把代码留在这里: void Image:: on_pushButton_clicked () { this-> conn-> connect (this-> ui-> lineEdit_2-> text (), this-> ui-> lineEd
void Image:: on_pushButton_clicked ()
{
this-> conn-> connect (this-> ui-> lineEdit_2-> text (),
this-> ui-> lineEdit-> text (). Toint ()); QLayout* layout;
QString fileName = QFileDialog:: GetOpenFileName (this,
tr ("Open File"), QDir:: currentPath (),
"files (*. jpg *. png)");
QImage image (fileName);
QLabel * label = new QLabel (this);
label-> setPixmap (QPixmap:: FromImage (image));
label-> setScaledContents (true);
layout-> addWidget (label);
label-> show ();
}
如果你想帮我下载我的应用程序链接,我可以离开
多谢各位
非常感谢,我设法看到了这张图片,我想从这样一个缓冲区加载:QBuffer*buffer=newqbufferconex;
QImage*图像=新的QImage;
图像->加载从数据缓冲区->缓冲区
我试着这样做,以使我的形象,但我得到错误
QBuffer*buffer=新的QBuffer连接;
QImage图像=新QImage;
图像->加载从数据缓冲区->缓冲区;
错误如下:
C:\EJMPLOS\U qt\teratermobile生成模拟器..\teratermobile\imagen.cpp:81:错误:请求从'QImage*'转换为非标量类型'QImage'
C:\eJMPLOS\U qt\teratermobile生成模拟器..\teratermobile\imagen.cpp:82:错误:“->”的基操作数具有非指针类型“QImage”在将布局变量与以下内容一起使用之前,您没有初始化布局变量:
layout = new QVBoxLayout(widget); // widget is where you want to put the QLabel
或者可以重用已创建的布局
如果要将QLabel显示为顶级窗口,请完全删除布局的两行