I'm using Qt 5.8.0 MinGW 32 bit from Qt Creator 4.2.1 on an HP desktop with a Intel Xeon CPU in Windows & Professional 64 bit service pack1 OS.
I keep getting a segmentation fault when running this code (in debug) at the point where I attempt to load an image using QPixmap.

I believe my pointers are initialized correctly nor can I notice any uninitialized pointers or out of bound arrays (unless I'm looking right at it and can't see it). In the following code, some of the documented out lines are various ways I've attempted to load the image.

Header file...
Qt Code:
  1. #ifndef OVERVIEW_H
  2. #define OVERVIEW_H
  3.  
  4. #include <QDialog>
  5. #include <QWidget>
  6. #include <QGeoRectangle>
  7. #include <QGraphicsScene>
  8. #include <QGraphicsObject>
  9.  
  10. #include "aircraft.h"
  11.  
  12. namespace Ui {
  13. class OverView;
  14. }
  15.  
  16. class OverView : public QDialog
  17. {
  18. Q_OBJECT
  19.  
  20. public:
  21. explicit OverView(QWidget* pParent = 0);
  22. ~OverView();
  23.  
  24. private slots:
  25. void showRange(int range); // Setup background
  26. void on_closeBtn_clicked();
  27.  
  28. private:
  29. Ui::OverView* ui;
  30.  
  31. void setUpWindow();
  32.  
  33. QString sMessage;
  34. QString sRangeFileNm; // Holds selected range file name
  35.  
  36. // QPixmap static rangePic; // The selected range image
  37. QGraphicsScene* pRangeScene; // Graphic scene pointer
  38.  
  39. //____________________________________________________________
  40. // Range background images from the resource file data.qrc
  41. QString sBothFileNm = ":/Data/Images/BothRanges2000.gif";
  42. QString sNorthFileNm = ":/Data/Images/NorthRange2000_2000.gif";
  43. QString sSouthFileNm = ":/Data/Images/SouthRange2000_2000.gif";
  44. };
  45.  
  46. #endif // OVERVIEW_H
To copy to clipboard, switch view to plain text mode 

cpp file...
Qt Code:
  1. #include "overview.h"
  2. #include "ui_overview.h"
  3. #include "ui_rddswindow.h"
  4.  
  5. OverView::OverView(QWidget* pParent) :
  6. QDialog(pParent),
  7. ui(new Ui::OverView)
  8. {
  9. ui->setupUi(this);
  10.  
  11. setUpWindow();
  12. showRange(0); // Set the default background
  13. }
  14.  
  15.  
  16. /*---- setUpWindow -------------------------------------------------------------------
  17. Sets up the elements of the range view window. The combination box
  18. allows user to select the range to use as background and connects the
  19. combination box signal to the showRange slot.
  20. */
  21. void OverView::setUpWindow()
  22. {
  23. setWindowTitle("Range View");
  24. this->setObjectName("RangeView");
  25.  
  26. QStringList selectedRange;
  27. selectedRange << "Both Ranges" << "North Range"<< "Echo Range";
  28.  
  29. ui->rangeCmbBox->addItems(selectedRange);
  30. QObject::connect(ui->rangeCmbBox, SIGNAL(currentIndexChanged(int)),
  31. this, SLOT(showRange(int)));
  32.  
  33. ui->rangeView->setDragMode(QGraphicsView::ScrollHandDrag);
  34. }
  35.  
  36. /*---- showRange --------------------------------------------------------------------------
  37. Sets the background image and scaling based on an index value provided
  38. by the rangeCmbBox in the range view.
  39. 0 - Both north and south ranges
  40. 1 - North range
  41. 2 - South range
  42. */
  43. void OverView::showRange(int range)
  44. {
  45. QBrush rangeBackground;
  46. sRangeFileNm.clear();
  47.  
  48. switch(range){
  49. case 0: // Default image is both ranges
  50. sRangeFileNm.append(sBothFileNm);
  51. break;
  52. case 1:
  53. sRangeFileNm.append(sNorthFileNm); // North range image
  54. break;
  55. default:
  56. sRangeFileNm.append(sSouthFileNm); // South range image
  57. break;
  58. }
  59. // QPixmap const rangePic(sRangeFileNm);
  60. QPixmap const rangePic = QPixmap(sRangeFileNm);
  61.  
  62. rangeBackground.setTexture(rangePic);
  63. ui->rangeView->setBackgroundBrush(rangeBackground);
  64. QRectF rangeRect = QRectF(QPointF(0,0), rangePic.size());
  65. ui->rangeView->setSceneRect(rangeRect);
  66. ui->rangeView->show();
  67. /*
  68. if(rangePic.load(sRangeFileNm)){ // Load the range picture
  69. rangeBackground.setTexture(rangePic);
  70. ui->rangeView->setBackgroundBrush(rangeBackground);
  71. QRectF rangeRect = QRectF(QPointF(0,0), rangePic.size());
  72. ui->rangeView->setSceneRect(rangeRect);
  73. ui->rangeView->show();
  74. sMessage.append("Successfully loaded range image");
  75. }else
  76. sMessage.append("Failed to load range image");
  77. */
  78. qDebug() << sMessage;
  79. }
To copy to clipboard, switch view to plain text mode 

I'd appreciate anyone who can spot why I'm getting a SIGSEV error on this and thank you in advance.