--- a/src/Checklist/ChecklistGuideBrowser.cpp
+++ b/src/Checklist/ChecklistGuideBrowser.cpp
@@ -11,6 +11,7 @@
 #include "EngaugeAssert.h"
 #include "Logger.h"
 #include <QDebug>
+#include <QRegularExpression>
 
 const int MIN_WIDTH_BROWSER = 340; // Make just big enough that each "More..." appears on same line
 
@@ -83,8 +84,8 @@ void ChecklistGuideBrowser::divHide (QSt
                        .arg (TAG_DIV_DELIMITER_START_SLASH)
                        .arg (anchor)
                        .arg (TAG_DIV_DELIMITER_END);
-  QRegExp regExp  (expression);
-  html.replace (regExp, "");
+  QRegularExpression regExp  (expression);
+  html.replace (regExp, QString(""));
 }
 
 void ChecklistGuideBrowser::divShow (QString &html,
@@ -104,10 +105,10 @@ void ChecklistGuideBrowser::divShow (QSt
                             .arg (TAG_DIV_DELIMITER_START_SLASH)
                             .arg (anchor)
                             .arg (TAG_DIV_DELIMITER_END);
-    QRegExp regExpStart (expressionStart);
-    QRegExp regExpEnd (expressionEnd);
-    html.replace (regExpStart, "");
-    html.replace (regExpEnd, "");
+    QRegularExpression regExpStart (expressionStart);
+    QRegularExpression regExpEnd (expressionEnd);
+    html.replace (regExpStart, QString(""));
+    html.replace (regExpEnd, QString(""));
   }
 }
 
--- a/src/Cmd/CmdAbstract.cpp
+++ b/src/Cmd/CmdAbstract.cpp
@@ -106,7 +106,7 @@ void CmdAbstract::saveOrCheckPostCommand
   DocumentHashGenerator documentHashGenerator;
   DocumentHash documentHash = documentHashGenerator.generate (document);
 
-  if (m_documentHashPost.count() == 0) {
+  if (m_documentHashPost.size() == 0) {
 
     // This is the first time through here so save the initial value
     m_documentHashPost = documentHash;
@@ -129,7 +129,7 @@ void CmdAbstract::saveOrCheckPreCommandD
   DocumentHashGenerator documentHashGenerator;
   DocumentHash documentHash = documentHashGenerator.generate (document);
 
-  if (m_documentHashPre.count() == 0) {
+  if (m_documentHashPre.size() == 0) {
 
     // This is the first time through here so save the initial value
     m_documentHashPre = documentHash;
--- a/src/CoordSystem/CoordSystemInterface.h
+++ b/src/CoordSystem/CoordSystemInterface.h
@@ -22,12 +22,13 @@
 #include "DocumentModelSegments.h"
 #include "functor.h"
 #include "Point.h"
+#include <QStringList>
 
 class Curve;
 class CurvesGraphs;
 class QPointF;
 class QString;
-class QStringList;
+//class QStringList;
 class Transformation;
 
 /// Interface common to CoordSystemContext and CoordSystem classes
--- a/src/Create/CreateActions.cpp
+++ b/src/Create/CreateActions.cpp
@@ -15,6 +15,7 @@
 #include "Logger.h"
 #include "MainWindow.h"
 #include <QAction>
+#include <QActionGroup>
 #include <QIcon>
 #include <QPixmap>
 #include <QSignalMapper>
--- a/src/Curve/Curve.cpp
+++ b/src/Curve/Curve.cpp
@@ -592,7 +592,7 @@ void Curve::updatePointOrdinals (const T
 
   }
 
-  qSort (m_points.begin(),
+  std::sort (m_points.begin(),
          m_points.end(),
          PointComparator());
 }
--- a/src/DigitizeState/DigitizeStateAbstractBase.h
+++ b/src/DigitizeState/DigitizeStateAbstractBase.h
@@ -10,6 +10,7 @@
 #include "PointStyle.h"
 #include <QCursor>
 #include <QPointF>
+#include <QStringList>
 
 class CmdMediator;
 class DigitizeStateContext;
@@ -17,7 +18,7 @@ class DocumentModelDigitizeCurve;
 class DocumentModelSegments;
 class QSize;
 class QString;
-class QStringList;
+//class QStringList;
 class Transformation;
 
 /// Set of possible states of Digitize toolbar.
--- a/src/Dlg/DlgImportCroppingPdf.cpp
+++ b/src/Dlg/DlgImportCroppingPdf.cpp
@@ -9,7 +9,7 @@
 #include "Logger.h"
 #include "MainWindow.h"
 #include "PdfCropping.h"
-#include "poppler-qt5.h"
+#include "poppler-qt6.h"
 #include <QApplication>
 #include <QGraphicsPixmapItem>
 #include <QGraphicsScene>
@@ -189,7 +189,7 @@ QImage DlgImportCroppingPdf::loadImage (
   QImage image;
 
   int page0Based = page1Based - 1;
-  Page *page = m_document.page (page0Based);
+  Page *page = m_document.page (page0Based).get();
   if (page != nullptr) {
 
     image = page->renderToImage (m_resolution,
--- a/src/Dlg/DlgSettingsExportFormat.cpp
+++ b/src/Dlg/DlgSettingsExportFormat.cpp
@@ -25,6 +25,7 @@
 #include <QListWidget>
 #include <QPushButton>
 #include <QRadioButton>
+#include <QRegularExpression>
 #include <QScrollBar>
 #include <QSettings>
 #include <QTabWidget>
@@ -480,7 +481,7 @@ void DlgSettingsExportFormat::createXLab
 QString DlgSettingsExportFormat::exportedTextToExportedHtml (const QString &text,
                                                              const QString &color) const
 {
-  QRegExp re ("<br>$");
+  QRegularExpression re ("<br>$");
 
   QString textCopy (text);
   QString replaced = textCopy
--- a/src/Dlg/DlgSettingsMainWindow.cpp
+++ b/src/Dlg/DlgSettingsMainWindow.cpp
@@ -328,7 +328,7 @@ void DlgSettingsMainWindow::loadMainWind
   index = m_cmbLocale->findText (locLabel);
   if (index < 0) {
     // Somehow an invalid locale is selected. Fix it by setting to default
-    locLabel = QLocaleToString (QLocale::system().name());
+    locLabel = QLocaleToString (QLocale::system());
     index = m_cmbLocale->findText (locLabel);
   }
   m_cmbLocale->setCurrentIndex(index);
--- a/src/Export/ExportToClipboard.h
+++ b/src/Export/ExportToClipboard.h
@@ -7,10 +7,12 @@
 #ifndef EXPORT_TO_CLIPBOARD_H
 #define EXPORT_TO_CLIPBOARD_H
 
+#include <QStringList>
+
 class Curve;
 class CurvesGraphs;
 class Document;
-class QStringList;
+//class QStringList;
 class QTextStream;
 class Transformation;
 
--- a/src/Format/FormatDateTime.cpp
+++ b/src/Format/FormatDateTime.cpp
@@ -10,9 +10,10 @@
 #include <QDateTime>
 #include <qmath.h>
 #include <QTimeZone>
+#include <QRegularExpression>
 
 // Need a reference time zone so exported outputs do not exhibit unpredictable local/UTC hours differences
-const Qt::TimeSpec REFERENCE_TIME_ZONE (Qt::UTC);
+const QTimeZone REFERENCE_TIME_ZONE (Qt::UTC);
 
 FormatDateTime::FormatDateTime()
 {
@@ -34,7 +35,7 @@ bool FormatDateTime::ambiguityBetweenDat
       coordUnitsTime != COORD_UNITS_TIME_SKIP) {
 
     // See if there is just a single number
-    QStringList fields = string.trimmed().split(QRegExp ("[/- :]"));
+    QStringList fields = string.trimmed().split(QRegularExpression ("[/- :]"));
 
     if (fields.count() == 1) {
 
@@ -95,7 +96,7 @@ void FormatDateTime::dateTimeLookup (con
                                                             string)) {
 
             success = true;
-            value = dt.toTimeSpec (REFERENCE_TIME_ZONE).toTime_t ();
+            value = dt.toTimeZone (REFERENCE_TIME_ZONE).toSecsSinceEpoch();
             iterating = false; // Stop iterating
 
             LOG4CPP_INFO_S ((*mainCat)) << "FormatDateTime::dateTimeLookup"
@@ -107,10 +108,10 @@ void FormatDateTime::dateTimeLookup (con
           }
         } else {
 
-          QRegExp reg (formatDateTime);
-          if (reg.exactMatch(string)) {
+          QRegularExpression reg (formatDateTime);
+          if (reg.match(string).hasMatch()) {
 
-            success = true; // Note that value does not get set in QRegExp case
+            success = true; // Note that value does not get set in QRegularExpression case
             iterating = false; // Stop iterating
 
             LOG4CPP_INFO_S ((*mainCat)) << "FormatDateTime::dateTimeLookup"
@@ -139,9 +140,9 @@ QString FormatDateTime::formatOutput (Co
 
   // Range of unsigned versus signed is not a problem here. A signed value maxes out at 2.4 billion
   // which is year 2038
-  QDateTime dt = QDateTime::fromTime_t (unsigned (qFloor (value)));
+  QDateTime dt = QDateTime::fromSecsSinceEpoch (unsigned (qFloor (value)));
 
-  return dt.toTimeSpec(REFERENCE_TIME_ZONE).toString (format);
+  return dt.toTimeZone(REFERENCE_TIME_ZONE).toString (format);
 }
 
 void FormatDateTime::loadFormatsFormat()
--- a/src/Format/FormatDegreesMinutesSecondsBase.cpp
+++ b/src/Format/FormatDegreesMinutesSecondsBase.cpp
@@ -9,7 +9,8 @@
 #include "Logger.h"
 #include <QDoubleValidator>
 #include <qmath.h>
-#include <QRegExp>
+#include <QRegularExpression>
+#include <QRegularExpressionMatch>
 #include <QStringList>
 #include <QValidator>
 
@@ -98,8 +99,8 @@ QValidator::State FormatDegreesMinutesSe
   }
 
   // Split on spaces
-  QStringList fields = string.split (QRegExp ("\\s+"),
-                                     QString::SkipEmptyParts);
+  QStringList fields = string.split (QRegularExpression ("\\s+"),
+                                     Qt::SkipEmptyParts);
 
   QString field0, field1, field2; // Degrees, minutes and seconds components
   if (fields.count() == 0) {
@@ -185,40 +186,40 @@ void FormatDegreesMinutesSecondsBase::st
   const int FIELD_WIDTH = 0, BASE_8 = 8, BASE_16 = 16;
 
   // Clean up degrees symbols (167 or 248 in base 10 which are 247 and 370 in base 8) and single quotes
-  QString strExpDegrees = QString (".*\\0%1$")
+  QString strExpDegrees = QString ("^.*\\0%1$")
                           .arg (COORD_SYMBOL_DEGREES, FIELD_WIDTH, BASE_8);
 
-  QRegExp regExpDegrees (strExpDegrees);
+  QRegularExpression regExpDegrees (strExpDegrees);
 
-  if (regExpDegrees.exactMatch (field0)) {
-    field0 = field0.left (field0.count() - 1);
+  if (regExpDegrees.match(field0).hasMatch()) {
+    field0 = field0.left (field0.size() - 1);
   }
 
   // Clean up minutes
-  QString strExpMinutes = QString (".*[\\0%1\\x%2]$")
+  QString strExpMinutes = QString ("^.*[\\0%1\\x%2]$")
       .arg (COORD_SYMBOL_MINUTES_APOSTROPHE, FIELD_WIDTH, BASE_8)
       .arg (COORD_SYMBOL_MINUTES_PRIME, FIELD_WIDTH, BASE_16);
 
-  QRegExp regExpMinutes (strExpMinutes);
+  QRegularExpression regExpMinutes (strExpMinutes);
 
-  if (regExpMinutes.exactMatch (field1)) {
-    field1 = field1.left (field1.count() - 1);
+  if (regExpMinutes.match(field1).hasMatch()) {
+    field1 = field1.left (field1.size() - 1);
   }
 
   // Clean up seconds
-  QString strExpSeconds1Char = QString (".*[\\x%1\\x%2]$")
+  QString strExpSeconds1Char = QString ("^.*[\\x%1\\x%2]$")
       .arg (COORD_SYMBOL_SECONDS_DOUBLE_PRIME, FIELD_WIDTH, BASE_16)
       .arg (COORD_SYMBOL_SECONDS_QUOTATIONS, FIELD_WIDTH, BASE_16);
-  QString strExpSeconds2Chars = QString (".*\\0%1\\0%2$")
+  QString strExpSeconds2Chars = QString ("^.*\\0%1\\0%2$")
       .arg (COORD_SYMBOL_MINUTES_PRIME, FIELD_WIDTH, BASE_8)
       .arg (COORD_SYMBOL_MINUTES_PRIME, FIELD_WIDTH, BASE_8);
 
-  QRegExp regExpSeconds1Char (strExpSeconds1Char), regExpSeconds2Chars (strExpSeconds2Chars);
+  QRegularExpression regExpSeconds1Char (strExpSeconds1Char), regExpSeconds2Chars (strExpSeconds2Chars);
 
-  if (regExpSeconds1Char.exactMatch (field2)) {
-    field2 = field2.left (field2.count() - 1);
+  if (regExpSeconds1Char.match(field2).hasMatch()) {
+    field2 = field2.left (field2.size() - 1);
   }
-  if (regExpSeconds2Chars.exactMatch (field2)) {
-    field2 = field2.left (field2.count() - 2);
+  if (regExpSeconds2Chars.match(field2).hasMatch()) {
+    field2 = field2.left (field2.size() - 2);
   }
 }
--- a/src/Format/FormatDegreesMinutesSecondsNonPolarTheta.cpp
+++ b/src/Format/FormatDegreesMinutesSecondsNonPolarTheta.cpp
@@ -9,7 +9,7 @@
 #include "FormatDegreesMinutesSecondsNonPolarTheta.h"
 #include "Logger.h"
 #include <qmath.h>
-#include <QRegExp>
+#include <QRegularExpression>
 #include <QStringList>
 
 FormatDegreesMinutesSecondsNonPolarTheta::FormatDegreesMinutesSecondsNonPolarTheta()
--- a/src/Format/FormatDegreesMinutesSecondsPolarTheta.cpp
+++ b/src/Format/FormatDegreesMinutesSecondsPolarTheta.cpp
@@ -9,7 +9,7 @@
 #include "FormatDegreesMinutesSecondsPolarTheta.h"
 #include "Logger.h"
 #include <qmath.h>
-#include <QRegExp>
+#include <QRegularExpression>
 #include <QStringList>
 
 const int DECIMAL_TO_MINUTES = 60.0;
--- a/src/Graphics/GraphicsLinesForCurve.cpp
+++ b/src/Graphics/GraphicsLinesForCurve.cpp
@@ -139,8 +139,7 @@ QPainterPath GraphicsLinesForCurve::draw
         path.moveTo (point->pos ());
 
         // Show curveMultiValued instead in what would have been the original curve's path
-        OrdinalToGraphicsPoint::const_iterator itrBefore = itr - 1;
-        const GraphicsPoint *pointBefore = itrBefore.value();
+        const GraphicsPoint *pointBefore = std::prev(itr, 1).value();
         pathMultiValued.moveTo (pointBefore->pos ());
         pathMultiValued.cubicTo (p1,
                                  p2,
--- a/src/Grid/GridLineFactory.cpp
+++ b/src/Grid/GridLineFactory.cpp
@@ -264,7 +264,7 @@ void GridLineFactory::createTransformAli
                                                                                 posXRadiusY0AlignedScreen,
                                                                                 posX0YRadiusAlignedScreen);
 
-  // Use \n rather than endl to prevent compiler warning "nonnull argument t compared to null"
+  // Use \n rather than Qt::endl to prevent compiler warning "nonnull argument t compared to null"
   LOG4CPP_INFO_S ((*mainCat)) << "GridLineFactory::createTransformAlign"
                               << " transformation=" << QTransformToString (transformation.transformMatrix()).toLatin1().data() << "\n"
                               << " radiusLinearCartesian=" << radiusLinearCartesian
--- a/src/Grid/GridLog.h
+++ b/src/Grid/GridLog.h
@@ -8,6 +8,7 @@
 #define GRID_LOG_H
 
 #include "GridIndependentToDependent.h"
+#include <QPoint>
 #include <QString>
 #include <QTextStream>
 
--- a/src/Import/ImportCroppingUtilPdf.cpp
+++ b/src/Import/ImportCroppingUtilPdf.cpp
@@ -5,7 +5,7 @@
  ******************************************************************************************************/
 
 #include "ImportCroppingUtilPdf.h"
-#include "poppler-qt5.h"
+#include "poppler-qt6.h"
 #include <QApplication>
 
 using namespace Poppler;
@@ -30,7 +30,7 @@ bool ImportCroppingUtilPdf::applyImportC
 
       // Try to read the file
       QApplication::setOverrideCursor (Qt::BusyCursor); // Since load could take a while
-      document = Document::load (fileName);
+      document = Document::load (fileName).get();
       QApplication::restoreOverrideCursor();
       if (document != nullptr) {
         if (!document->isLocked ()) {
--- a/src/Logger/LoggerUpload.h
+++ b/src/Logger/LoggerUpload.h
@@ -29,21 +29,21 @@ public:
 
   /// Smart equivalent to standard assert method and Q_ASSERT (in qglobal.h). Upon error, an upload is proposed.
   /// This is static for easy access from anywhere else in the application
-  static void loggerAssert(const char *condition,
+  static void loggerAssert NO_RETURN_VALUE(const char *condition,
                            const char* file,
-                           int line) NO_RETURN_VALUE;
+                           int line);
 
   /// Smart equivalent to Q_CHECK_PTR (in qglobal.h). Similar to loggerAssert but for checking newly-allocated pointers
-  static void loggerCheckPtr (const char *pointer,
+  static void loggerCheckPtr NO_RETURN_VALUE (const char *pointer,
                               const char* file,
-                              int line) NO_RETURN_VALUE;
+                              int line);
 
 private:
 
-  static void loggerOutput (const char* comment,
+  static void loggerOutput NO_RETURN_VALUE (const char* comment,
                             const char *file,
                             int line,
-                            const char* context) NO_RETURN_VALUE;
+                            const char* context);
 
   static MainWindow *m_mainWindow;
 };
--- a/src/Mime/MimePointsExport.cpp
+++ b/src/Mime/MimePointsExport.cpp
@@ -64,7 +64,7 @@ QString MimePointsExport::htmlGraph () c
 }
 
 QVariant MimePointsExport::retrieveData (const QString &format,
-                                         QVariant::Type /* preferredType */) const
+                                         QMetaType /* preferredType */) const
 {
   if (format == FORMAT_CSV) {
     return m_csvGraph;
--- a/src/Mime/MimePointsExport.h
+++ b/src/Mime/MimePointsExport.h
@@ -47,7 +47,7 @@ public:
 protected:
   /// Returns a variant with the data for the specified format.
   virtual QVariant retrieveData (const QString &format,
-                                 QVariant::Type preferredType) const;
+                                 QMetaType preferredType) const;
 
 private:
   QString m_csvGraph;
--- a/src/Pdf/Pdf.cpp
+++ b/src/Pdf/Pdf.cpp
@@ -7,7 +7,7 @@
 #include "DlgImportCroppingPdf.h"
 #include "ImportCroppingUtilPdf.h"
 #include "Pdf.h"
-#include "poppler-qt5.h"
+#include "poppler-qt6.h"
 #include <QApplication>
 #include <QImage>
 #include <QString>
@@ -94,12 +94,12 @@ PdfReturn Pdf::loadWithoutCropping (cons
   if (fileName.right (4).toLower () == ".pdf") {
 
     // Try to read the file
-    Document *document = Document::load (fileName);
+    Document *document = Document::load (fileName).get();
 
     if (document != nullptr) {
       if (!document->isLocked ()) {
 
-        Page *page = document->page (FIRST_PAGE_1_BASED - 1);
+        Page *page = document->page (FIRST_PAGE_1_BASED - 1).get();
         if (page != nullptr) {
 
           image = page->renderToImage (resolution,
--- a/src/Point/PointMatchAlgorithm.cpp
+++ b/src/Point/PointMatchAlgorithm.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include "Logger.h"
 #include "PointMatchAlgorithm.h"
+#include "PointMatchTriplet.h"
 #include <QFile>
 #include <QImage>
 #include <qmath.h>
@@ -24,6 +25,16 @@ const int PIXEL_OFF = -1; // Negative of
                           // multiplied. One off pixel and one on pixel give +1 * -1 = -1 which reduces the correlation
 const int PIXEL_ON = 1; // Arbitrary value as long as negative of PIXEL_OFF
 
+/// Comparator for sorting Point class
+struct PointMatchTripletComparator
+{
+  /// Comparison function used by qSort
+  bool operator()(const PointMatchTriplet &a, const PointMatchTriplet &b) const
+  {
+    return a < b;
+  }
+};
+
 PointMatchAlgorithm::PointMatchAlgorithm(bool isGnuplot) :
   m_isGnuplot (isGnuplot)
 {
@@ -196,19 +207,19 @@ void PointMatchAlgorithm::dumpToGnuplot
 
     QTextStream str (&file);
 
-    str << "# Suggested gnuplot commands:" << endl;
-    str << "#       set hidden3d" << endl;
-    str << "#       splot \"" << filename << "\" u 1:2:3 with pm3d" << endl;
-    str << endl;
+    str << "# Suggested gnuplot commands:" << Qt::endl;
+    str << "#       set hidden3d" << Qt::endl;
+    str << "#       splot \"" << filename << "\" u 1:2:3 with pm3d" << Qt::endl;
+    str << Qt::endl;
 
-    str << "# I J Convolution" << endl;
+    str << "# I J Convolution" << Qt::endl;
     for (int i = 0; i < width; i++) {
       for (int j = 0; j < height; j++) {
 
         double convIJ = convolution[FOLD2DINDEX(i, j, height)];
-        str << i << " " << j << " " << convIJ << endl;
+        str << i << " " << j << " " << convIJ << Qt::endl;
       }
-      str << endl; // pm3d likes blank lines between rows
+      str << Qt::endl; // pm3d likes blank lines between rows
     }
   }
 
@@ -283,7 +294,9 @@ QList<QPoint> PointMatchAlgorithm::findP
                       listCreated,
                       width,
                       height);
-  qSort (listCreated);
+  std::sort (listCreated.begin(),
+          listCreated.end(),
+          PointMatchTripletComparator());
 
   // Copy sorted match points to output
   QList<QPoint> pointsCreated;
--- a/src/Point/PointMatchTriplet.cpp
+++ b/src/Point/PointMatchTriplet.cpp
@@ -6,6 +6,7 @@
 
 #include "PointMatchTriplet.h"
 
+
 PointMatchTriplet::PointMatchTriplet(int x,
                                      int y,
                                      double correlation) :
--- a/src/Segment/Segment.cpp
+++ b/src/Segment/Segment.cpp
@@ -198,7 +198,7 @@ void Segment::dumpToGnuplot (QTextStream
     strDump << odd << "\n";
     strDump << "end\n";
     strDump << "pause -1 \"Hit Enter to continue\"\n";
-    strDump << flush;
+    strDump.flush();
   }
 }
 
--- a/src/Settings/Settings.cpp
+++ b/src/Settings/Settings.cpp
@@ -29,7 +29,7 @@ const QString SETTINGS_HELP_POS ("helpPo
 const QString SETTINGS_HELP_SIZE ("helpSize");
 const QString SETTINGS_HIGHLIGHT_OPACITY ("highlightOpacity");
 const QString SETTINGS_IMAGE_REPLACE_RENAMES_DOCUMENT ("imageReplaceRenamesDocument");
-const QString SETTINGS_LOCALE_COUNTRY ("country");
+const QString SETTINGS_LOCALE_TERRITORY ("territory");
 const QString SETTINGS_LOCALE_LANGUAGE ("language");
 const QString SETTINGS_MAIN_DIRECTORY_EXPORT_SAVE ("exportSave");
 const QString SETTINGS_MAIN_DIRECTORY_IMPORT_LOAD ("importLoad");
--- a/src/Settings/Settings.h
+++ b/src/Settings/Settings.h
@@ -61,7 +61,7 @@ extern const QString SETTINGS_IMAGE_REPL
 extern const QString SETTINGS_IMPORT_CROPPING;
 extern const QString SETTINGS_IMPORT_CROPPING_POS;
 extern const QString SETTINGS_IMPORT_PDF_RESOLUTION;
-extern const QString SETTINGS_LOCALE_COUNTRY;
+extern const QString SETTINGS_LOCALE_TERRITORY;
 extern const QString SETTINGS_LOCALE_LANGUAGE;
 extern const QString SETTINGS_MAIN_DIRECTORY_EXPORT_SAVE;
 extern const QString SETTINGS_MAIN_DIRECTORY_IMPORT_LOAD;
--- a/src/StatusBar/StatusBar.cpp
+++ b/src/StatusBar/StatusBar.cpp
@@ -78,7 +78,7 @@ void StatusBar::createGroupUnits ()
   m_groupUnits = new QFrame;
   m_groupUnits->setFrameStyle (QFrame::Box);
   QPalette palette;
-  palette.setColor (QPalette::Foreground, Qt::gray);
+  palette.setColor (QPalette::WindowText, Qt::gray);
   m_groupUnits->setPalette (palette);
 
   QHBoxLayout *groupLayout = new QHBoxLayout;
@@ -86,7 +86,7 @@ void StatusBar::createGroupUnits ()
   groupLayout->setContentsMargins (0, 0, 0, 0);
   groupLayout->addWidget (m_cmbUnits);
   groupLayout->addWidget (m_editCoords);
-  groupLayout->setMargin (2);
+  groupLayout->setContentsMargins (2, 2, 2, 2);
 
   m_statusBar.addPermanentWidget (m_groupUnits);
 }
--- a/src/Test/TestSegmentFill.cpp
+++ b/src/Test/TestSegmentFill.cpp
@@ -109,11 +109,11 @@ void TestSegmentFill::testFindSegments()
       
         // Output in gnuplot format for plotting. A space precedes each field. This can be plotted with
         //    plot "../test/test_segment_fill.gnuplot_actual" w lp
-        outStr << point.x() << " " << point.y() << endl;
+        outStr << point.x() << " " << point.y() << Qt::endl;
       }
 
       // Blank line between curves
-      outStr << endl;
+      outStr << Qt::endl;
     }
   }
 
--- a/src/Test/TestSpline.cpp
+++ b/src/Test/TestSpline.cpp
@@ -44,15 +44,15 @@ bool TestSpline::coefCheckX (const vecto
 
   // X coordinate fit
 #ifdef SHOWCOEFFICIENTS
-  cout << endl
+  cout << Qt::endl
        << "(t,x) inputs to be copied to " << WEBPAGE.toLatin1().data()
-       << endl;
+       << Qt::endl;
   for (i = 0; i < t.size(); i++) {
-    cout << t[i] << "   " << xy[i].x() << endl;
+    cout << t[i] << "   " << xy[i].x() << Qt::endl;
   }
-  cout << endl
+  cout << Qt::endl
        << "x=d*(t-ti)^3+c*(t-ti)^2+b*(t-ti)+a natural cubic spline results to be used in this code"
-       << endl;
+       << Qt::endl;
   for (i = 0; i < t.size() - 1; i++) {
     coefShow ("x =",
               "(t-ti)",
@@ -63,9 +63,9 @@ bool TestSpline::coefCheckX (const vecto
               s.m_elements[i].c().x(),
               s.m_elements[i].d().x());
   }
-  cout << endl
+  cout << Qt::endl
        << "x=d*t^3+c*t^2+b*t+a outputs to be compared to results from " << WEBPAGE.toLatin1().data()
-       << endl;
+       << Qt::endl;
 #endif
   for (i = 0; i < t.size() - 1; i++) {
     s.computeUntranslatedCoefficients (s.m_elements[i].a().x(),
@@ -112,15 +112,15 @@ bool TestSpline::coefCheckY (const vecto
 
   // Y coordinate fit
 #ifdef SHOWCOEFFICIENTS
-  cout << endl
+  cout << Qt::endl
        << "(t,y) inputs to be copied to " << WEBPAGE.toLatin1().data()
-       << endl;
+       << Qt::endl;
   for (i = 0; i < xy.size(); i++) {
-    cout << t[i] << "   " << xy[i].y() << endl;
+    cout << t[i] << "   " << xy[i].y() << Qt::endl;
   }
-  cout << endl
+  cout << Qt::endl
        << "y=d*(t-ti)^3+c*(t-ti)^2+b*(t-ti)+a natural cubic spline results to be used in this code"
-       << endl;
+       << Qt::endl;
   for (i = 0; i < xy.size() - 1; i++) {
     coefShow ("y =",
               "(t-ti)",
@@ -131,9 +131,9 @@ bool TestSpline::coefCheckY (const vecto
               s.m_elements[i].c().y(),
               s.m_elements[i].d().y());
   }
-  cout << endl
+  cout << Qt::endl
        << "y=d*t^3+c*t^2+b*t+a outputs to be compared to results from " << WEBPAGE.toLatin1().data()
-       << endl;
+       << Qt::endl;
 #endif
   for (i = 0; i < t.size() - 1; i++) {
     s.computeUntranslatedCoefficients (s.m_elements[i].a().y(),
@@ -180,7 +180,7 @@ void TestSpline::coefShow (const QString
        << d << "*" << independentVariable.toLatin1().data() << "^3 + "
        << c << "*" << independentVariable.toLatin1().data() << "^2 + "
        << b << "*" << independentVariable.toLatin1().data() << " + "
-       << a << " (" << tLow << "<t<" << tHigh << ")" << endl;
+       << a << " (" << tLow << "<t<" << tHigh << ")" << Qt::endl;
 
 }
 
@@ -304,8 +304,8 @@ void TestSpline::testSharpTransition ()
   }
 
 #ifdef GNUPLOT
-  cout << "set datafile missing \"?\"" << endl;
-  cout << "plot \"gnuplot.in\" using 1:2 with linespoints, \"gnuplot.in\" using 1:3 with lines" << endl;
+  cout << "set datafile missing \"?\"" << Qt::endl;
+  cout << "plot \"gnuplot.in\" using 1:2 with linespoints, \"gnuplot.in\" using 1:3 with lines" << Qt::endl;
 #endif
 
   // Output the merged before/after curves
@@ -347,7 +347,7 @@ void TestSpline::testSharpTransition ()
     }
 
 #ifdef GNUPLOT
-    cout << x << ", " << yB << ", " << yA << endl;
+    cout << x << ", " << yB << ", " << yA << Qt::endl;
 #endif
   }
 
--- a/src/Transformation/Transformation.cpp
+++ b/src/Transformation/Transformation.cpp
@@ -534,8 +534,9 @@ void Transformation::updateTransformFrom
                                 pointGraphLinearCart0.y(),
                                 pointGraphLinearCart1.y(),
                                 pointGraphLinearCart2.y(),
-                                1.0,
-                                1.0);
+                                (qreal)1.0,
+                                (qreal)1.0,
+                                (qreal)1.0);
 
   QPointF pointScreenRoundTrip0, pointScreenRoundTrip1, pointScreenRoundTrip2;
   transformRawGraphToScreen (pointGraphRaw0,
--- a/src/Translator/TranslatorContainer.cpp
+++ b/src/Translator/TranslatorContainer.cpp
@@ -16,10 +16,10 @@ TranslatorContainer::TranslatorContainer
   // Get the locale settings outside of the settings retrieval methods in MainWindow
   QLocale::Language language = static_cast<QLocale::Language> (settings.value (SETTINGS_LOCALE_LANGUAGE,
                                                                                QVariant (localeDefault.language())).toInt());
-  QLocale::Country country = static_cast<QLocale::Country> (settings.value (SETTINGS_LOCALE_COUNTRY,
-                                                                            QVariant (localeDefault.country())).toInt());
+  QLocale::Territory territory = static_cast<QLocale::Territory> (settings.value (SETTINGS_LOCALE_TERRITORY,
+                                                                            QVariant (localeDefault.territory())).toInt());
   QLocale locale (language,
-                  country);
+                  territory);
   
   settings.endGroup();
 
@@ -34,11 +34,11 @@ TranslatorContainer::TranslatorContainer
 
     // Basic translators, like buttons in QWizard
     m_translatorGeneric = new QTranslator;
-    m_translatorGeneric->load ("qt_" + localeName,
-                                QLibraryInfo::location (QLibraryInfo::TranslationsPath));
-    QApplication::installTranslator (m_translatorGeneric);
+    if (m_translatorGeneric->load ("qt_" + localeName,
+                                QLibraryInfo::path (QLibraryInfo::TranslationsPath)) )
+        QApplication::installTranslator (m_translatorGeneric);
 
-    // Engauge-specific translators. As documented in engauge.pro, the country-specific engauge_XX_YY locale is loaded
+    // Engauge-specific translators. As documented in engauge.pro, the territory-specific engauge_XX_YY locale is loaded
     // if available, otherwise engauge_XX is loaded if available
     //
     // In OSX, QDir::currentPath points to /Users/?/Library/Containers/Digitizer/Data and
@@ -50,15 +50,16 @@ TranslatorContainer::TranslatorContainer
                                            qmDirectory(),
                                            delimiters);
     if (!rtn) {
-      // Handle country-specific translations like fa_IR. Transifex capitalizes the last two characters
+      // Handle territory-specific translations like fa_IR. Transifex capitalizes the last two characters
       QString localeNameUpper = QString ("%1%2")
           .arg (localeName.left (localeName.length() - 2))
           .arg (localeName.right (2).toUpper ());
-      m_translatorEngauge->load ("engauge_" + localeNameUpper,
+      rtn = m_translatorEngauge->load ("engauge_" + localeNameUpper,
                                  qmDirectory(),
                                  delimiters);
     }
-    QApplication::installTranslator (m_translatorEngauge);
+    if (rtn)
+        QApplication::installTranslator (m_translatorEngauge);
   }
 }
 
--- a/src/main/MainWindow.cpp
+++ b/src/main/MainWindow.cpp
@@ -1652,10 +1652,10 @@ void MainWindow::settingsReadMainWindow
   QLocale localeDefault;
   QLocale::Language language = static_cast<QLocale::Language> (settings.value (SETTINGS_LOCALE_LANGUAGE,
                                                                                QVariant (localeDefault.language())).toInt());
-  QLocale::Country country = static_cast<QLocale::Country> (settings.value (SETTINGS_LOCALE_COUNTRY,
-                                                                            QVariant (localeDefault.country())).toInt());
+  QLocale::Territory territory = static_cast<QLocale::Territory> (settings.value (SETTINGS_LOCALE_TERRITORY,
+                                                                            QVariant (localeDefault.territory())).toInt());
   QLocale locale (language,
-                  country);
+                  territory);
   slotViewZoom (static_cast<ZoomFactor> (settings.value (SETTINGS_ZOOM_FACTOR,
                                                          QVariant (ZOOM_1_TO_1)).toInt()));
   m_modelMainWindow.setLocale (locale);
@@ -1748,7 +1748,7 @@ void MainWindow::settingsWrite ()
   settings.setValue (SETTINGS_IMPORT_CROPPING, m_modelMainWindow.importCropping());
   settings.setValue (SETTINGS_IMPORT_PDF_RESOLUTION, m_modelMainWindow.pdfResolution ());
   settings.setValue (SETTINGS_LOCALE_LANGUAGE, m_modelMainWindow.locale().language());
-  settings.setValue (SETTINGS_LOCALE_COUNTRY, m_modelMainWindow.locale().country());
+  settings.setValue (SETTINGS_LOCALE_TERRITORY, m_modelMainWindow.locale().territory());
   settings.setValue (SETTINGS_MAIN_DIRECTORY_EXPORT_SAVE,
                      directoryPersist.getDirectoryExportSave().absolutePath());
   settings.setValue (SETTINGS_MAIN_DIRECTORY_IMPORT_LOAD,
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -392,7 +392,7 @@ void showUsageAndQuit ()
       << "[" << DASH_RESET.toLatin1().data () << "] "
       << "[" << DASH_STYLE.toLatin1().data () << " &lt;style&gt;] "
       << "[" << DASH_STYLES.toLatin1().data () << "] "
-      << "[&lt;load_file1&gt;] [&lt;load_file2&gt;] ..." << endl
+      << "[&lt;load_file1&gt;] [&lt;load_file2&gt;] ..." << Qt::endl
       << "<table>"
       << "<tr>"
       << "<td>" << DASH_DEBUG.toLatin1().data() << "</td>"
--- a/src/util/QtToString.cpp
+++ b/src/util/QtToString.cpp
@@ -60,7 +60,7 @@ QString QLocaleToString (const QLocale &
 {
   return QString ("%1/%2")
       .arg (QLocale::languageToString (locale.language()))
-      .arg (QLocale::countryToString(locale.country()));
+      .arg (QLocale::territoryToString(locale.territory()));
 }
 
 QString QTransformToString (const QTransform &transform)
@@ -123,7 +123,6 @@ QString roleAsString (int role)
     rolesAsStringsLookupTable [Qt::AccessibleDescriptionRole] = "AccessibleDescriptionRole";
     rolesAsStringsLookupTable [Qt::AccessibleTextRole] = "AccessibleTextRole";
     rolesAsStringsLookupTable [Qt::BackgroundRole] = "BackgroundRole";
-    rolesAsStringsLookupTable [Qt::BackgroundColorRole] = "BackgroundColorRole";
     rolesAsStringsLookupTable [Qt::CheckStateRole] = "CheckStateRole";
     rolesAsStringsLookupTable [Qt::DecorationRole] = "DecorationRole";
     rolesAsStringsLookupTable [Qt::DisplayRole] = "DisplayRole";
@@ -134,7 +133,6 @@ QString roleAsString (int role)
     rolesAsStringsLookupTable [Qt::SizeHintRole] = "SizeHintRole";
     rolesAsStringsLookupTable [Qt::StatusTipRole] = "StatusTipRole";
     rolesAsStringsLookupTable [Qt::TextAlignmentRole] = "TextAlignmentRole";
-    rolesAsStringsLookupTable [Qt::TextColorRole] = "TextColorRole";
     rolesAsStringsLookupTable [Qt::ToolTipRole] = "ToolTipRole";
     rolesAsStringsLookupTable [Qt::UserRole] = "UserRole";
     rolesAsStringsLookupTable [Qt::WhatsThisRole] = "WhatsThisRole";
