QImage problem in Windows-2000
Hi,
I have a program in Qt 4.3.0 and in that program I need to load some picture. For that I write a function like this
Code:
MyClass::LoadImages(){
int COLUMN;
filters << "snapshot-*" ;
directory.setNameFilters(filters);
files
= directory.
entryList(filters,
QDir::Files |
QDir::NoSymLinks);
c=0; COLUMN = 2;
QLabel *pixmapLabels
[100] [2];
NumStates_New = 0;
NumStates_New = files.size()/2;
if ( files.size()%2 >0 ) {
NumStates_New++;
}
for (int i = 0; i < NumStates_New; ++i) {
for (int j = 0; j < COLUMN; ++j) {
pixmapLabels[i][j] = createPixmapLabel();
pixmapLabels[i][j]->resize(5,5);
// pixmapLabels[i][j]->show();
SnapLayout->addWidget(pixmapLabels[i][j], i + 1, j + 1 );
// SnapLayout->update();
}
}
r=0, c=0;
for (int i = 0; i < files.size(); ++i) {
fileName = directory.absolutePath();
fileName.append("/");
fileName.append(files.at(i).toLocal8Bit().constData());
image->load(fileName);
if (!image->isNull()){
}
else{
}
this->icon = icon;
this
->size
= QSize(110,
102);
pixmapLabels[r][c]->setPixmap(pixmap);
pixmapLabels[r][c]->setToolTip(fileName);
pixmapLabels[r][c]->show();
c++; if (c>=COLUMN) { c=0; r++; }
}
}
QLabel *MyClass
::createPixmapLabel() {
label->setEnabled(true);
label->setAlignment(Qt::AlignCenter);
label->setText("Picture");
label->setAutoFillBackground(true);
label->setMinimumSize(110,102);
return label;
}
I compiled this code in Windows Xp and it is working. But When I copy the .exe file to Windows-2000, then it display the error message "Picture error", ie, the image is NULL.
I tried this same code in Linux ( fedora core 2 ) and it is working.
How can I solve this problem in windows-2000.
Please help me
Re: QImage problem in Windows-2000
Re: QImage problem in Windows-2000
Hi,
I am using VS-2005 for compile my program. Can I include that plug-in ( .lib files ) in my .exe program for avoid the folder copy ( imageformats ) ?
Re: QImage problem in Windows-2000
Re: QImage problem in Windows-2000
Hi,
I tryed this, But when I compile the program, Qt display an error like this
Quote:
main.obj : error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticqjpegPluginInstance::StaticqjpegPluginInstan ce(void)" (??0StaticqjpegPluginInstance@@QAE@XZ)
release\Test.exe : fatal error LNK1120: 1 unresolved externals
Please help me to solve this problem.
Re: QImage problem in Windows-2000
Did you notice what it says right in the beginning when you follow the link:
Quote:
When compiled as a static library, Qt provides the following static plugins
?