Seite 1 von 1

Absturz beim Konstruktor von Pixmap

Verfasst: 1. Juni 2008 23:01
von john_Ohlsen
Hallo,

bei mir stürzt beim initialisieren von QPixmap das ganze Programm ab.

Hier ist mein Beispielcode:

Code: Alles auswählen

#include <iostream>
#include <string>
#include <QtGui/QPixmap>
#include <QtGui/QImage>

using namespace std;

int main(void)
{
	QString sImages[5] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp"};

	for (int i = 0; i < 5; i++)
	{
		cout << "Reading image no." << i << ":" << qPrintable(sImages[i]) << endl;

		QImage image(sImages[i], "BMP");

		try
		{
			QPixmap pm(48, 48);

			pm.fromImage(image);
		}
		catch(...)
		{
		}


		//pm.load(sImages[i], "BMP");
    }

	cin.get();

  return 0;
}
An der Stelle "QPixmap pm(48, ..." beendet sich Visual Studio 2003.NET.

Meine Qt-Version ist 4.4.0.


Schönen Gruß,

John

Verfasst: 1. Juni 2008 23:09
von Christian81
Ohne QApplication wird es wohl nichts...

Verfasst: 1. Juni 2008 23:40
von john_Ohlsen
Stimmt. Ich habe es gerade auch getest.

Gruß,