From 3d9be09db010ac6cfdac505ec869539ea3c9b042 Mon Sep 17 00:00:00 2001 From: Stephen Shkardoon Date: Fri, 15 Apr 2016 10:35:49 +1200 Subject: [PATCH 1/4] Upgrade to Qt5.6 Fix #109 #138 #165 #178. Fixes multiple issues on Windows 10. --- doc/how_to_build_macosx.md | 6 +++--- doc/how_to_build_macosx_ja.md | 4 ++-- doc/how_to_build_win.md | 12 +++++------- doc/how_to_build_win_ja.md | 11 +++++------ toonz/sources/CMakeLists.txt | 6 +++--- toonz/sources/toonz/comboviewerpane.cpp | 10 ---------- 6 files changed, 18 insertions(+), 31 deletions(-) diff --git a/doc/how_to_build_macosx.md b/doc/how_to_build_macosx.md index 68532df4..ecb0fa8e 100644 --- a/doc/how_to_build_macosx.md +++ b/doc/how_to_build_macosx.md @@ -9,8 +9,8 @@ - cmake - Version 3.2.2 confirmed to work. - Qt - - http://download.qt.io/official_releases/qt/5.5/5.5.1/ - - qt-opensource-mac-x64-clang-5.5.1.dmg + - http://download.qt.io/official_releases/qt/5.6/5.6.0/ + - qt-opensource-mac-x64-clang-5.6.0.dmg - boost - http://www.boost.org/users/history/version_1_55_0.html @@ -65,7 +65,7 @@ $ tar xjvf boost_1_55_0.tar.bz2 $ cd ../../toonz $ mkdir build $ cd build - CMAKE_PREFIX_PATH=~/Qt5.5.1/5.5/clang_64 cmake ../sources + CMAKE_PREFIX_PATH=~/Qt5.6.0/5.6/clang_64 cmake ../sources $ make ``` diff --git a/doc/how_to_build_macosx_ja.md b/doc/how_to_build_macosx_ja.md index 558294e5..2b1ebd1a 100644 --- a/doc/how_to_build_macosx_ja.md +++ b/doc/how_to_build_macosx_ja.md @@ -8,8 +8,8 @@ - cmake - バージョン 3.2.2 で動作確認済みです。 - Qt - - http://download.qt.io/official_releases/qt/5.5/5.5.1/ - - qt-opensource-mac-x64-clang-5.5.1.dmg + - http://download.qt.io/official_releases/qt/5.6/5.6.0/ + - qt-opensource-mac-x64-clang-5.6.0.dmg - boost - http://www.boost.org/users/history/version_1_55_0.html diff --git a/doc/how_to_build_win.md b/doc/how_to_build_win.md index 5b050fa4..372916b7 100644 --- a/doc/how_to_build_win.md +++ b/doc/how_to_build_win.md @@ -1,12 +1,11 @@ # Building on Windows -This software can be built using Visual Studio 2013 and Qt 5.5 +This software can be built using Visual Studio 2013 and Qt 5.6 ## Required Software ### Visual Studio Express 2013 for Windows Desktop - https://www.microsoft.com/en-us/download/details.aspx?id=44914 -- Since Qt 5.5 does not work with Visual Studio 2015, Visual Studio 2013 must be used. - Make sure that the target platform is "for Windows Desktop" not "for Windows". - Community and Provessional versions of Visual Studio 2013 for Windows Desktop also work. @@ -26,11 +25,10 @@ Because of the size of these libraries, they are not maintained in the git repos They will have to be installed seperately as follows. ### Qt -- http://download.qt.io/official_releases/qt/5.5/5.5.1/ +- http://download.qt.io/official_releases/qt/5.6/5.6.0/ - Qt is a cross-platform GUI framework. -- This project does not use the latest Qt framework (5.6). - Select the following file from the above link: - - qt-opensource-windows-x86-msvc2013_64-5.5.1.exe + - qt-opensource-windows-x86-msvc2013_64-5.6.0.exe ### boost - http://www.boost.org/users/history/version_1_55_0.html @@ -91,9 +89,9 @@ If a previous binary of OpenToonz was already installed, this step and the follo OpenToonz utilizes the QuickTime SDK's `mov` and associated file formats. Since the QuickTime SDK only comes in 32-bit versions, the 32-bit file `t32bitsrv.exe` from the QuickTime SDK is used in both the 64-bit and 32-bit versions of OpenToonz. As a result, the following instructions apply to both the 32 and 64-bit versions of OpenToonz. ### Qt -- http://download.qt.io/official_releases/qt/5.5/5.5.1/ +- http://download.qt.io/official_releases/qt/5.6/5.6.0/ - Find the following file from the above link and install in the appropriate folder. - - qt-opensource-windows-x86-msvc2013-5.5.1.exe + - qt-opensource-windows-x86-msvc2013-5.6.0.exe ### QuickTime SDK 1. Sign in using your Apple developer ID and download `QuickTime 7.3 SDK for Windows.zip` from the following url. diff --git a/doc/how_to_build_win_ja.md b/doc/how_to_build_win_ja.md index c74d48f7..cb63fb38 100644 --- a/doc/how_to_build_win_ja.md +++ b/doc/how_to_build_win_ja.md @@ -1,12 +1,11 @@ # ビルド手順(Windows) -Visual Studio 2013とQt 5.5でビルドできることを確認しています。 +Visual Studio 2013とQt 5.6でビルドできることを確認しています。 ## 必要なソフトウェアの導入 ### Visual Studio Express 2013 for Windows Desktop - https://www.microsoft.com/ja-jp/download/details.aspx?id=44914 -- Qt 5.5がVisual Studio 2015に対応していないため、2013を使う必要があります - Express版はターゲットプラットフォームごとにバージョンが分かれています。「for Windows」ではなく「for Windows Desktop」を使用します - Community版やProfessional版などでも構いません @@ -24,11 +23,11 @@ Visual Studio 2013とQt 5.5でビルドできることを確認しています サイズの大きいライブラリはこのリポジトリには含めていないので、別途インストールする必要があります。 ### Qt -- http://download.qt.io/official_releases/qt/5.5/5.5.1/ +- http://download.qt.io/official_releases/qt/5.6/5.6.0/ - クロスプラットフォームのGUIフレームワークです - 現在はQt 5.6には対応していません - 上記のURLから以下のファイルをダウンロードして適当なフォルダにインストールします - - qt-opensource-windows-x86-msvc2013_64-5.5.1.exe + - qt-opensource-windows-x86-msvc2013_64-5.6.0.exe ### boost - http://www.boost.org/users/history/version_1_55_0.html @@ -89,9 +88,9 @@ OpenToonz_1.0.exeを実行して動作すれば成功です。おめでとうご OpenToonzはQuickTime SDKを用いてmov形式などへ対応しています。QuickTime SDKは32ビット版しかないため、`t32bitsrv.exe`という32ビット版の実行可能ファイルにQuickTime SDKを組み込み、64ビット版のOpenToonzは`t32bitsrv.exe`を経由してQuickTime SDKの機能を使用しています。以下の手順では`t32bitsrv.exe`などと合わせて、32ビット版のOpenToonzも生成されます。 ### Qt -- http://download.qt.io/official_releases/qt/5.5/5.5.1/ +- http://download.qt.io/official_releases/qt/5.6/5.6.0/ - 上記のURLから以下のファイルをダウンロードして適当なフォルダにインストールします - - qt-opensource-windows-x86-msvc2013-5.5.1.exe + - qt-opensource-windows-x86-msvc2013-5.6.0.exe ### QuickTime SDK 1. Appleの開発者登録をして下記のURLから`QuickTime 7.3 SDK for Windows.zip`をダウンロードします diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 97b0e38b..2b3be53a 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -14,7 +14,7 @@ message("Thirdpary Library Search path:" ${THIRDPARTY_LIBS_HINTS}) if (WIN32) message("Windows System") - set(QT_PATH "C:/Qt/Qt5.5.1/5.5/msvc2013_64" CACHE PATH "Qt instlattion directory") + set(QT_PATH "C:/Qt/Qt5.6.0/5.6/msvc2013_64" CACHE PATH "Qt instlattion directory") if(NOT EXISTS ${QT_PATH}) message("Specify QT_PATH properly") return() @@ -28,7 +28,7 @@ elseif (APPLE) endif() message("PLATFORM:" ${PLATFORM}) if (PLATFORM EQUAL 64) - set(QT_PATH "~/Qt/5.5/clang_64/lib/") + set(QT_PATH "~/Qt/5.6/clang_64/lib/") set(QT_LIB_PATH ${QT_PATH}) set(CMAKE_PREFIX_PATH "${QT_PATH}cmake/") @@ -37,7 +37,7 @@ elseif (APPLE) add_definitions(-DMACOSX -Di386) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++11 -stdlib=libc++ -fno-implicit-templates") elseif(PLATFORM EQUAL 32) - set(QT_PATH "~/Qt/5.5/clang_32/lib/") + set(QT_PATH "~/Qt/5.6/clang_32/lib/") set(QT_LIB_PATH ${QT_PATH}) set(CMAKE_PREFIX_PATH ${QT_PATH}cmake/) message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH}) diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp index 4774ae9c..b2cce3c3 100644 --- a/toonz/sources/toonz/comboviewerpane.cpp +++ b/toonz/sources/toonz/comboviewerpane.cpp @@ -105,16 +105,6 @@ ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WFlags flags) ImageUtils::FullScreenWidget *fsWidget = new ImageUtils::FullScreenWidget(this); fsWidget->setWidget(m_sceneViewer = new SceneViewer(fsWidget)); -#ifdef Q_OS_WIN - // Workaround for QTBUG-48288 - // This code should be removed after updating Qt. - // Qt may crash in handling WM_SIZE of m_sceneViewer in splash.finish(&w) - // in main.cpp. To suppress sending WM_SIZE, set window position here. - // WM_SIZE will not be sent if window poistion is not changed. - ::SetWindowPos(reinterpret_cast(m_sceneViewer->winId()), - HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); -#endif - m_vRuler = new Ruler(this, m_sceneViewer, true); m_hRuler = new Ruler(this, m_sceneViewer, false); From aa590765e003ef28129052c52ec1bd811d8183ea Mon Sep 17 00:00:00 2001 From: Shinya Kitaoka Date: Fri, 22 Apr 2016 16:02:45 +0900 Subject: [PATCH 2/4] keep codes for QTBUG-48288 --- toonz/sources/CMakeLists.txt | 7 +++++-- toonz/sources/toonz/comboviewerpane.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 39b05127..29ba673c 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -14,7 +14,11 @@ message("Thirdpary Library Search path:" ${THIRDPARTY_LIBS_HINTS}) if (WIN32) message("Windows System") - set(QT_PATH "C:/Qt/Qt5.6.0/5.6/msvc2013_64" CACHE PATH "Qt instlattion directory") + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(QT_PATH "C:/Qt/Qt5.6.0_32/5.6/msvc2013" CACHE PATH "Qt instlattion directory") + else() + set(QT_PATH "C:/Qt/Qt5.6.0/5.6/msvc2013_64" CACHE PATH "Qt instlattion directory") + endif() if(NOT EXISTS ${QT_PATH}) message("Specify QT_PATH properly") return() @@ -33,7 +37,6 @@ elseif (APPLE) set(QT_LIB_PATH ${QT_PATH}) set(CMAKE_PREFIX_PATH "${QT_PATH}cmake/") - message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH}) add_definitions(-DMACOSX -Di386) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++11 -stdlib=libc++ -fno-implicit-templates") diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp index b2cce3c3..4553e992 100644 --- a/toonz/sources/toonz/comboviewerpane.cpp +++ b/toonz/sources/toonz/comboviewerpane.cpp @@ -105,6 +105,16 @@ ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WFlags flags) ImageUtils::FullScreenWidget *fsWidget = new ImageUtils::FullScreenWidget(this); fsWidget->setWidget(m_sceneViewer = new SceneViewer(fsWidget)); +#if defined(Q_OS_WIN) && (QT_VERSION >= 0x050500) && (QT_VERSION < 0x050600) + // Workaround for QTBUG-48288 + // This code should be removed after updating Qt. + // Qt may crash in handling WM_SIZE of m_sceneViewer in splash.finish(&w) + // in main.cpp. To suppress sending WM_SIZE, set window position here. + // WM_SIZE will not be sent if window poistion is not changed. + ::SetWindowPos(reinterpret_cast(m_sceneViewer->winId()), + HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); +#endif + m_vRuler = new Ruler(this, m_sceneViewer, true); m_hRuler = new Ruler(this, m_sceneViewer, false); From 2a1f2beb195e5fcd8c9f77abcb30027ae3780f0a Mon Sep 17 00:00:00 2001 From: Shinya Kitaoka Date: Fri, 22 Apr 2016 16:30:20 +0900 Subject: [PATCH 3/4] support a QT_PATH var for MacOS --- toonz/sources/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 29ba673c..8c09bb5b 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -33,17 +33,18 @@ elseif (APPLE) endif() message("PLATFORM:" ${PLATFORM}) if (PLATFORM EQUAL 64) - set(QT_PATH "~/Qt/5.6/clang_64/lib/") - set(QT_LIB_PATH ${QT_PATH}) - set(CMAKE_PREFIX_PATH "${QT_PATH}cmake/") + set(QT_PATH "~/Qt/5.6/clang_64/lib" CACHE PATH "Qt instlattion directory") + set(QT_LIB_PATH "${QT_PATH}/") + set(CMAKE_PREFIX_PATH "${QT_LIB_PATH}cmake/") message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH}) add_definitions(-DMACOSX -Di386) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++11 -stdlib=libc++ -fno-implicit-templates") elseif(PLATFORM EQUAL 32) - set(QT_PATH "~/Qt/5.6/clang_32/lib/") - set(QT_LIB_PATH ${QT_PATH}) - set(CMAKE_PREFIX_PATH ${QT_PATH}cmake/) + set(QT_PATH "~/Qt/5.6/clang_32/lib" CACHE PATH "Qt instlattion directory") + set(QT_LIB_PATH "${QT_PATH}/") + set(CMAKE_PREFIX_PATH "${QT_LIB_PATH}cmake/") + message("CMAKE_PREFIX_PATH:" ${CMAKE_PREFIX_PATH}) add_definitions(-DMACOSX -Di386) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=c++11 -stdlib=libc++ -fno-implicit-templates -D HAS_QUICKDRAW") From 7db469349fe243c548859609516216c9baebd158 Mon Sep 17 00:00:00 2001 From: Shinya Kitaoka Date: Fri, 22 Apr 2016 17:51:35 +0900 Subject: [PATCH 4/4] fix CMakeLists.txt --- toonz/sources/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 8c09bb5b..d7e32cd4 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -62,9 +62,17 @@ add_definitions(-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH}) -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH}) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${QT_LIB_PATH}" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${QT_LIB_PATH}") + endif() +endif() include_directories(include)