Thanks for the reply. I had previously tried cutting it down into several pieces when I thought the limitation was imposed on the size of the single texture, but when I split it into several pieces it still gave the same behavior. I believe this is due to a limitation on the overall viewport size, not the size of individual textures. But my main question is actually concerning the QPainter implementation. The QPainter code seems to work on large image files if you place it inside a QLabel using the paintEvent call, but not in a QGLWidget. I was wondering why this would work in one case and not the other, since it would be preferable for me to stick with the QGLWidget and just have an if case which uses a QPainter inside paintGL() if possible.

here's the QPainter bit. This works if it's inside paintEvent in a QLabel subclass, and does not work if it's inside paintGL() in a QGLWidget subclass. (By works i mean displays large format images, both will display images with dimensions less than 8192 pixels in height and width.)
Qt Code:
  1. QPainter p(this);
  2. p.scale(testWidth, testHeight);
  3. QImage* image = new QImage(testWidth, testHeight,
  4. QImage::Format_Indexed8);
  5. image->setNumColors(256);
  6. for(int i = 0; i < 256; i++)
  7. image->setColor(i, QRGB(i,i,i));
  8. //get 8bpp version of test pattern
  9. unsigned char* test8bpp = new unsigned char[testHeight*testWidth];
  10. for(int i = 0; i < (testHeight*testWidth); i++){
  11. test8bpp[i] = testPattern[i] >> 8;
  12. }
  13. for(int i = 0; i < testHeight; i++){
  14. unsigned char* row = image->scanLine(i);
  15. memcpy(row, test8bpp+(i*testWidth), testWidth);
  16. }
  17. p.drawImage(0,0,*image);
  18. delete [] test8bpp;
To copy to clipboard, switch view to plain text mode