diff --git a/_tools/qtsimulator/CMakeLists.txt b/_tools/qtsimulator/CMakeLists.txt index 7574c855831865802b5f1276f038bf25c06bf7dd..595a1098e84878e12778d17ead3f78cb313abddf 100644 --- a/_tools/qtsimulator/CMakeLists.txt +++ b/_tools/qtsimulator/CMakeLists.txt @@ -73,15 +73,14 @@ include_directories(../..) include_directories(../../..) add_definitions(-DMXGUI_LIBRARY) -find_package(Qt4 REQUIRED) -include(${QT_USE_FILE}) -qt4_wrap_cpp(FOO_HEADERS_MOC ${FOO_HEADERS}) +find_package(Qt5 COMPONENTS Widgets REQUIRED) +qt5_wrap_cpp(FOO_HEADERS_MOC ${FOO_HEADERS}) if(APPLE) add_executable(qtsimulator MACOSX_BUNDLE ${LIB_SRCS} ${FOO_SRCS} ${IMG_OUT} ${FOO_HEADERS_MOC}) else() add_executable(qtsimulator ${LIB_SRCS} ${FOO_SRCS} ${IMG_OUT} ${FOO_HEADERS_MOC}) endif() -target_link_libraries(qtsimulator ${QT_LIBRARIES}) +target_link_libraries(qtsimulator Qt5::Widgets) set(BOOST_LIBS thread filesystem system) find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED) target_link_libraries(qtsimulator ${Boost_LIBRARIES}) diff --git a/_tools/qtsimulator/qtsimulator.cpp b/_tools/qtsimulator/qtsimulator.cpp index 7d9519c733e9832a84f01afa3237f1e607efdcf2..255586fe2816c13710f539bbea3e1280c9eef874 100644 --- a/_tools/qtsimulator/qtsimulator.cpp +++ b/_tools/qtsimulator/qtsimulator.cpp @@ -1,5 +1,5 @@ -#include <QtGui/QApplication> +#include <QtWidgets/QApplication> #include <boost/filesystem.hpp> #include "window.h" diff --git a/_tools/qtsimulator/window.cpp b/_tools/qtsimulator/window.cpp index 8d7ded64524578e9ffdab8f0f3b4acb18749adeb..d9170705c7bc02245628253a561227818d1e9fcc 100644 --- a/_tools/qtsimulator/window.cpp +++ b/_tools/qtsimulator/window.cpp @@ -63,7 +63,7 @@ Window::Window(QWidget *parent): QWidget(parent), this->setWindowTitle(tr("Mxgui simulator")); this->show(); QTBackend& qb=QTBackend::instance(); - std::memcpy(image.bits(),qb.getFrameBuffer().getData(),image.byteCount()); + std::memcpy(image.bits(),qb.getFrameBuffer().getData(),image.sizeInBytes()); this->update(); qb.start(sender); } @@ -71,7 +71,7 @@ Window::Window(QWidget *parent): QWidget(parent), void Window::updateFrameBuffer() { FrameBuffer& buffer=QTBackend::instance().getFrameBuffer(); - std::memcpy(image.bits(),buffer.getData(),image.byteCount()); + std::memcpy(image.bits(),buffer.getData(),image.sizeInBytes()); this->update(); } @@ -140,7 +140,7 @@ void Window::keyPressEvent(QKeyEvent *event) } QString s=event->text(); if(s.size()==0) return; - char k=s[0].toAscii(); + char k=s[0].toLatin1(); addEvent(Event(EventType::KeyDown,k)); } @@ -154,6 +154,6 @@ void Window::keyReleaseEvent(QKeyEvent *event) } QString s=event->text(); if(s.size()==0) return; - char k=s[0].toAscii(); + char k=s[0].toLatin1(); addEvent(Event(EventType::KeyUp,k)); }