diff options
author | Alexey Vasiliev <avasiliev@beamr.com> | 2019-05-16 08:09:55 +0300 |
---|---|---|
committer | Vitaly Lipatov <lav@etersoft.ru> | 2022-07-17 02:29:25 +0300 |
commit | 5d8c39f9b106410e722c072c8aca3d1436216c39 (patch) | |
tree | df2a50dc5bbfee61ead30df5f577baa59795b1ea | |
parent | e30f3b68a2d097b3f45249527144c6d211b6687b (diff) |
Migrating to Qt5.5
-rw-r--r-- | fb2edit.pro | 3 | ||||
-rw-r--r-- | source/fb2app.cpp | 8 | ||||
-rw-r--r-- | source/fb2app.hpp | 2 | ||||
-rw-r--r-- | source/fb2code.cpp | 3 | ||||
-rw-r--r-- | source/fb2main.cpp | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/fb2edit.pro b/fb2edit.pro index 9516135..d7c7f23 100644 --- a/fb2edit.pro +++ b/fb2edit.pro @@ -52,8 +52,9 @@ TARGET = fb2edit TRANSLATIONS = source/ts/ru.ts
+QT += widgets
QT += xml
-QT += webkit
+QT += webkitwidgets
QT += network
QT += xmlpatterns
diff --git a/source/fb2app.cpp b/source/fb2app.cpp index df8c65b..fd5256a 100644 --- a/source/fb2app.cpp +++ b/source/fb2app.cpp @@ -21,12 +21,12 @@ QString FbApplication::lastCommit() #endif // PACKAGE_VERSION } -void FbApplication::handleMessage(QtMsgType type, const char *msg) +void FbApplication::handleMessage(QtMsgType type, const QString& msg) { - emit logMessage(type, QString::fromUtf8(msg)); + emit logMessage(type, msg); } -static void fb2MessageHandler(QtMsgType type, const char *msg) +static void fb2MessageHandler(QtMsgType type, const QMessageLogContext&, const QString& msg) { ((FbApplication*)qApp)->handleMessage(type, msg); } @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) } if (count == 1) (new FbMainWindow)->show(); - qInstallMsgHandler(fb2MessageHandler); + qInstallMessageHandler(fb2MessageHandler); return app.exec(); } diff --git a/source/fb2app.hpp b/source/fb2app.hpp index 8715377..1a3d51a 100644 --- a/source/fb2app.hpp +++ b/source/fb2app.hpp @@ -11,7 +11,7 @@ public: FbApplication(int &argc, char **argv, int = QT_VERSION)
: QApplication(argc, argv, QT_VERSION) {}
- void handleMessage(QtMsgType type, const char *msg);
+ void handleMessage(QtMsgType type, const QString& msg);
static QString lastCommit();
diff --git a/source/fb2code.cpp b/source/fb2code.cpp index 8d564df..37afde1 100644 --- a/source/fb2code.cpp +++ b/source/fb2code.cpp @@ -1,5 +1,6 @@ #include "fb2code.hpp" +#include <QApplication> #include <QXmlSchema> #include <QAbstractMessageHandler> #include <QXmlSchemaValidator> @@ -238,7 +239,7 @@ void FbHighlighter::highlightBlock(const QString& text) const int len = text.length(); for (; i < len; ++i) { - switch (text.at(i).toAscii()) + switch (text.at(i).toLatin1()) { case '<': ++brackets; diff --git a/source/fb2main.cpp b/source/fb2main.cpp index 20f46a0..fdcc84f 100644 --- a/source/fb2main.cpp +++ b/source/fb2main.cpp @@ -4,6 +4,9 @@ #include <QtDebug> #include <QTreeView> #include <QWebFrame> +#include <QMessageBox> +#include <QMenuBar> +#include <QStatusBar> #include "fb2app.hpp" #include "fb2logs.hpp" |