diff --git a/libgui/graphics/Canvas.cc b/libgui/graphics/Canvas.cc
--- a/libgui/graphics/Canvas.cc
+++ b/libgui/graphics/Canvas.cc
@@ -210,7 +210,7 @@ void Canvas::canvasMousePressEvent (QMou
               QRectF r (bb(0), bb(1), bb(2), bb(3));
 
               r.adjust (-5, -5, 5, 5);
-              if (r.contains (event->posF ()))
+              if (r.contains (event->localPos ()))
                 {
                   currentObj = childObj;
                   break;
@@ -237,7 +237,7 @@ void Canvas::canvasMousePressEvent (QMou
                   Matrix bb = it->get_properties ().get_boundingbox (true);
                   QRectF r (bb(0), bb(1), bb(2), bb(3));
 
-                  if (r.contains (event->posF ()))
+                  if (r.contains (event->localPos ()))
                     axesObj = *it;
                 }
 
diff --git a/libgui/graphics/Object.cc b/libgui/graphics/Object.cc
--- a/libgui/graphics/Object.cc
+++ b/libgui/graphics/Object.cc
@@ -154,7 +154,7 @@ Object* Object::fromQObject (QObject* ob
   QVariant v = obj->property ("QtHandles::Object");
 
   if (v.isValid ())
-    return reinterpret_cast<Object*> (qVariantValue<void*> (v));
+    return reinterpret_cast<Object*> (v.value<void*> ());
 
   return 0;
 }
diff --git a/libgui/qterminal/libqterminal/unix/Emulation.cpp b/libgui/qterminal/libqterminal/unix/Emulation.cpp
--- a/libgui/qterminal/libqterminal/unix/Emulation.cpp
+++ b/libgui/qterminal/libqterminal/unix/Emulation.cpp
@@ -224,7 +224,7 @@ void Emulation::sendKeyEvent( QKeyEvent*
     // Note that the text is proper unicode.
     // We should do a conversion here, but since this
     // routine will never be used, we simply emit plain ascii.
-    //emit sendBlock(ev->text().toAscii(),ev->text().length());
+    //emit sendBlock(ev->text().toLatin1(),ev->text().length());
     emit sendData(ev->text().toUtf8(),ev->text().length());
   }
 }
diff --git a/libgui/qterminal/libqterminal/unix/TerminalView.cpp b/libgui/qterminal/libqterminal/unix/TerminalView.cpp
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp
@@ -41,6 +41,7 @@
 #include <QPixmap>
 #include <QScrollBar>
 #include <QStyle>
+#include <QToolTip>
 #include <QtCore>
 #include <QtGui>
 
diff --git a/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp b/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp
--- a/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp
+++ b/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp
@@ -994,7 +994,7 @@ void Vt102Emulation::sendKeyEvent( QKeyE
                                          "is missing.");
 
         reset();
-        receiveData( translatorError.toAscii().constData() , translatorError.count() );
+        receiveData( translatorError.toLatin1().constData() , translatorError.count() );
     }
 }
 
diff --git a/libgui/qterminal/libqterminal/unix/konsole_wcwidth.h b/libgui/qterminal/libqterminal/unix/konsole_wcwidth.h
--- a/libgui/qterminal/libqterminal/unix/konsole_wcwidth.h
+++ b/libgui/qterminal/libqterminal/unix/konsole_wcwidth.h
@@ -11,7 +11,6 @@
 #define	_KONSOLE_WCWIDTH_H_
 
 // Qt
-#include <QtCore/QBool>
 #include <QtCore/QString>
 
 int konsole_wcwidth(quint16 ucs);
diff --git a/libgui/qterminal/libqterminal/unix/kpty.cpp b/libgui/qterminal/libqterminal/unix/kpty.cpp
--- a/libgui/qterminal/libqterminal/unix/kpty.cpp
+++ b/libgui/qterminal/libqterminal/unix/kpty.cpp
@@ -293,8 +293,8 @@ bool KPty::open()
   {
     for (const char* s4 = "0123456789abcdef"; *s4; s4++)
     {
-      ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toAscii();
-      d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toAscii();
+      ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toLatin1();
+      d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toLatin1();
 
       d->masterFd = ::open(ptyName.data(), O_RDWR);
       if (d->masterFd >= 0)
diff --git a/libgui/src/find-files-dialog.cc b/libgui/src/find-files-dialog.cc
--- a/libgui/src/find-files-dialog.cc
+++ b/libgui/src/find-files-dialog.cc
@@ -125,7 +125,7 @@ find_files_dialog::find_files_dialog (QW
   _file_list->horizontalHeader ()->restoreState (
     settings->value ("findfiles/column_state").toByteArray ());
   _file_list->horizontalHeader ()->setSortIndicatorShown (true);
-  _file_list->horizontalHeader ()->setClickable (true);
+  _file_list->horizontalHeader ()->setSectionsClickable (true);
   _file_list->horizontalHeader ()->setStretchLastSection (true);
   _file_list->sortByColumn (
                 settings->value ("findfiles/sort_files_by_column",0).toInt (),
diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -1351,7 +1351,7 @@ file_editor_tab::load_file (const QStrin
 QsciScintilla::EolMode
 file_editor_tab::detect_eol_mode ()
 {
-  char *text = _edit_area->text ().toAscii ().data ();
+  char *text = _edit_area->text ().toLatin1 ().data ();
   int text_size = _edit_area->text ().length ();
 
   char eol_lf = 0x0a;
diff --git a/libgui/src/octave-gui.cc b/libgui/src/octave-gui.cc
--- a/libgui/src/octave-gui.cc
+++ b/libgui/src/octave-gui.cc
@@ -28,6 +28,7 @@ along with Octave; see the file COPYING.
 #include <QTextCodec>
 #include <QThread>
 #include <QTranslator>
+#include <QtGlobal>
 
 #include <iostream>
 
@@ -89,7 +90,7 @@ private:
 // Disable all Qt messages by default.
 
 static void
-message_handler (QtMsgType, const char *)
+message_handler (QtMsgType, const QMessageLogContext&, const QString&)
 {
 }
 
@@ -105,7 +106,7 @@ octave_start_gui (int argc, char *argv[]
 
   // Installing our handler suppresses the messages.
   if (show_gui_msgs.empty ())
-    qInstallMsgHandler (message_handler);
+    qInstallMessageHandler (message_handler);
 
   if (start_gui)
     {
@@ -113,7 +114,7 @@ octave_start_gui (int argc, char *argv[]
       QTranslator gui_tr, qt_tr, qsci_tr;
 
       // Set the codec for all strings (before wizard)
-      QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("UTF-8"));
+      //QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("UTF-8"));
 
       // show wizard if this is the first run
       if (resource_manager::is_first_run ())
diff --git a/libgui/src/resource-manager.cc b/libgui/src/resource-manager.cc
--- a/libgui/src/resource-manager.cc
+++ b/libgui/src/resource-manager.cc
@@ -64,7 +64,7 @@ resource_manager::resource_manager (void
   QDesktopServices desktopServices;
 
   QString home_path
-    = desktopServices.storageLocation (QDesktopServices::HomeLocation);
+    = QStandardPaths::writableLocation (QStandardPaths::HomeLocation);
 
   settings_directory = home_path + "/.config/octave";
 
diff --git a/libgui/src/shortcut-manager.cc b/libgui/src/shortcut-manager.cc
--- a/libgui/src/shortcut-manager.cc
+++ b/libgui/src/shortcut-manager.cc
@@ -36,6 +36,7 @@ along with Octave; see the file COPYING.
 #include <QHeaderView>
 #include <QAction>
 #include <QFileDialog>
+#include <QKeySequence>
 
 #include "error.h"
 #include "resource-manager.h"
@@ -86,7 +87,7 @@ shortcut_manager::instance_ok (void)
 void
 shortcut_manager::do_init_data ()
 {
-  QKeySequence ctrl;
+  Qt::KeyboardModifier ctrl;
   int prefix;
 #if defined (Q_OS_MAC)
   // Use CMD key as an equivalent of Ctrl key on other platforms
@@ -100,8 +101,8 @@ shortcut_manager::do_init_data ()
   prefix = Qt::NoModifier;
 #endif
 
-  QKeySequence ctrl_shift = ctrl + Qt::ShiftModifier;
-  QKeySequence ctrl_alt = ctrl + Qt::AltModifier;
+  Qt::KeyboardModifier ctrl_shift = Qt::KeyboardModifier (ctrl + Qt::ShiftModifier);
+  Qt::KeyboardModifier ctrl_alt = Qt::KeyboardModifier (ctrl + Qt::AltModifier);
 
   // actions of the main window
 
@@ -340,7 +341,7 @@ shortcut_manager::do_fill_treewidget (QT
   _dialog = 0;
   _level_hash.clear ();
 
-  tree_view->header ()->setResizeMode (QHeaderView::ResizeToContents);
+  tree_view->header ()->setSectionResizeMode (QHeaderView::ResizeToContents);
 
   QTreeWidgetItem *main = new QTreeWidgetItem (tree_view);
   main->setText (0, tr ("Main"));
@@ -406,10 +407,10 @@ shortcut_manager::do_fill_treewidget (QT
 
       // write the shortcuts
       tree_item->setText (0, sc.description);
-      tree_item->setText (1, sc.default_sc [0]);
-      tree_item->setText (2, sc.actual_sc [0]);
-      tree_item->setText (3, sc.default_sc [1]);
-      tree_item->setText (4, sc.actual_sc [1]);
+      tree_item->setText (1, sc.default_sc [0].toString ());
+      tree_item->setText (2, sc.actual_sc [0].toString ());
+      tree_item->setText (3, sc.default_sc [1].toString ());
+      tree_item->setText (4, sc.actual_sc [1].toString ());
 
       _item_index_hash[tree_item] = i + 1; // index+1 to avoid 0
       _index_item_hash[i] = tree_item;
@@ -549,8 +550,8 @@ shortcut_manager::shortcut_dialog (int i
 
     }
 
-  _edit_actual->setText (_sc.at (index).actual_sc[_selected_set]);
-  _label_default->setText (_sc.at (index).default_sc[_selected_set]);
+  _edit_actual->setText (_sc.at (index).actual_sc[_selected_set].toString ());
+  _label_default->setText (_sc.at (index).default_sc[_selected_set].toString ());
   _handled_index = index;
 
   _edit_actual->setFocus ();
@@ -591,7 +592,7 @@ shortcut_manager::shortcut_dialog_finish
           shortcut_t double_shortcut = _sc.at (double_index);
           double_shortcut.actual_sc[_selected_set] = QKeySequence ();
           _sc.replace (double_index, double_shortcut);
-          _index_item_hash[double_index]->setText ((_selected_set + 1)*2, QKeySequence ());
+          _index_item_hash[double_index]->setText ((_selected_set + 1)*2, QKeySequence ().toString ());
         }
       else
         return;
@@ -604,7 +605,7 @@ shortcut_manager::shortcut_dialog_finish
   _sc.replace (_handled_index, shortcut);
 
   _index_item_hash[_handled_index]->setText ((_selected_set + 1)*2,
-                                             shortcut.actual_sc[_selected_set]);
+                                             shortcut.actual_sc[_selected_set].toString ());
 
   if (! shortcut.actual_sc[_selected_set].isEmpty ())
     _shortcut_hash[widget + sep + shortcut.actual_sc[_selected_set].toString ()] =
@@ -632,7 +633,7 @@ shortcut_manager::import_shortcuts (int 
 
       // update the tree view
       QTreeWidgetItem* tree_item = _index_item_hash[i]; // get related tree item
-      tree_item->setText (2*set, sc.actual_sc [set-1]); // display new shortcut
+      tree_item->setText (2*set, sc.actual_sc [set-1].toString ()); // display new shortcut
     }
 }
 
@@ -723,6 +724,6 @@ enter_shortcut::keyPressEvent (QKeyEvent
       if(modifiers & Qt::MetaModifier)
         key += Qt::META;
 
-      setText (QKeySequence(key));
+      setText (QKeySequence(key).toString ());
     }
 }
diff --git a/libgui/src/workspace-model.cc b/libgui/src/workspace-model.cc
--- a/libgui/src/workspace-model.cc
+++ b/libgui/src/workspace-model.cc
@@ -132,7 +132,7 @@ workspace_model::data (const QModelIndex
         {
           QString class_chars = resource_manager::storage_class_chars ();
           int actual_class
-            = class_chars.indexOf (_scopes[idx.row ()].toAscii ());
+            = class_chars.indexOf (_scopes[idx.row ()].toLatin1 ());
           if (actual_class >= 0)
             return QVariant (_storage_class_colors.at (actual_class));
           else
@@ -172,7 +172,7 @@ workspace_model::data (const QModelIndex
                 QString class_chars = resource_manager::storage_class_chars ();
 
                 int actual_class
-                  = class_chars.indexOf (_scopes[idx.row ()].toAscii ());
+                  = class_chars.indexOf (_scopes[idx.row ()].toLatin1 ());
 
                 if (actual_class >= 0)
                   {
