diff --git a/src/apps/qgcvideo/QGCVideoWidget.cc b/src/apps/qgcvideo/QGCVideoWidget.cc index 8fc9b85..ba0be9c 100644 --- a/src/apps/qgcvideo/QGCVideoWidget.cc +++ b/src/apps/qgcvideo/QGCVideoWidget.cc @@ -151,7 +151,7 @@ QGCVideoWidget::QGCVideoWidget(QWidget* parent) // Fill with black background QImage fill = QImage(640, 480, QImage::Format_Indexed8); - fill.setNumColors(3); + fill.setColorCount(3); fill.setColor(0, qRgb(0, 0, 0)); fill.setColor(1, qRgb(0, 0, 0)); fill.setColor(2, qRgb(0, 0, 0)); @@ -1136,7 +1136,7 @@ void QGCVideoWidget::commitRawDataToGL() QImage* newImage = new QImage(rawImage, receivedWidth, receivedHeight, format); if (format == QImage::Format_Indexed8) { // Create matching color table - newImage->setNumColors(256); + newImage->setColorCount(256); for (int i = 0; i < 256; i++) { newImage->setColor(i, qRgb(i, i, i)); //qDebug() << __FILE__ << __LINE__ << std::hex << i; diff --git a/src/ui/CameraView.cc b/src/ui/CameraView.cc index 13bc86b..f23e96f 100644 --- a/src/ui/CameraView.cc +++ b/src/ui/CameraView.cc @@ -49,7 +49,7 @@ CameraView::CameraView(int width, int height, int depth, int channels, QWidget* // Fill with black background QImage fill = QImage(width, height, QImage::Format_Indexed8); - fill.setNumColors(1); + fill.setColorCount(1); fill.setColor(0, qRgb(70, 200, 70)); fill.fill(CameraView::initialColor); glImage = QGLWidget::convertToGLFormat(fill); @@ -104,7 +104,7 @@ void CameraView::setImageSize(int width, int height, int depth, int channels) if (depth <= 8 && channels == 1) { image = new QImage(receivedWidth, receivedHeight, QImage::Format_Indexed8); // Create matching color table - image->setNumColors(256); + image->setColorCount(256); for (int i = 0; i < 256; i++) { image->setColor(i, qRgb(i, i, i)); //qDebug() << __FILE__ << __LINE__ << std::hex << i; @@ -162,7 +162,7 @@ void CameraView::commitRawDataToGL() QImage* newImage = new QImage(rawImage, receivedWidth, receivedHeight, format); if (format == QImage::Format_Indexed8) { // Create matching color table - newImage->setNumColors(256); + newImage->setColorCount(256); for (int i = 0; i < 256; i++) { newImage->setColor(i, qRgb(i, i, i)); //qDebug() << __FILE__ << __LINE__ << std::hex << i; diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 90b1ca0..2c13dc5 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -1212,7 +1212,7 @@ void HUD::setImageSize(int width, int height, int depth, int channels) if (depth <= 8 && channels == 1) { image = new QImage(receivedWidth, receivedHeight, QImage::Format_Indexed8); // Create matching color table - image->setNumColors(256); + image->setColorCount(256); for (int i = 0; i < 256; i++) { image->setColor(i, qRgb(i, i, i)); //qDebug() << __FILE__ << __LINE__ << std::hex << i; @@ -1277,7 +1277,7 @@ void HUD::commitRawDataToGL() QImage* newImage = new QImage(rawImage, receivedWidth, receivedHeight, format); if (format == QImage::Format_Indexed8) { // Create matching color table - newImage->setNumColors(256); + newImage->setColorCount(256); for (int i = 0; i < 256; i++) { newImage->setColor(i, qRgb(i, i, i)); //qDebug() << __FILE__ << __LINE__ << std::hex << i;