Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Qt5 from Qt4 #327

Closed
3 tasks done
yukawa opened this issue Nov 8, 2015 · 3 comments
Closed
3 tasks done

Switch to Qt5 from Qt4 #327

yukawa opened this issue Nov 8, 2015 · 3 comments

Comments

@yukawa
Copy link
Collaborator

yukawa commented Nov 8, 2015

Currently mozc_tool uses Qt4, which is no longer actively developed. It is still usable, but things like HiDPI supports and newer compiler supports are only available in Qt5. We should switch to Qt5.

Remaining tasks are:

  • Switch to Qt5 in Windows builds.
  • Switch to Qt5 in OS X builds.
  • Switch to Qt5 in Linux desktop builds.
@yukawa yukawa self-assigned this Nov 8, 2015
@yukawa yukawa changed the title Switch to Qt 5 from Qt 4 Switch to Qt5 from Qt4 Jul 31, 2016
yukawa pushed a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

In the current implementation without this CL, each GUI
tool (e.g. Handwriting, AboutDialog) contains symlinks to
frameworks (e.g. QtGui, GoogleBreakpad).  This is not a good manner and
unnecessary complicated to understand the architecture.  The new
implementation let GUI tools to refer shared frameworks directly without
symlink tricks.

BUG=#327
TEST=
REF_BUG=
REF_CL=113030895
REF_TIME=2016-01-26T18:11:39+09:00
REF_TIME_RAW=1453799499 +0900
yukawa pushed a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

This CL Adds GetFrameworkPath, CopyQt and ChangeReferences.

BUG=#327
TEST=
REF_BUG=
REF_CL=113140366
REF_TIME=2016-01-27T18:57:47+09:00
REF_TIME_RAW=1453888667 +0900
yukawa pushed a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

Use GuiTool regardless the branding name rather than
GoogleJapaneseInputTool and MozcTool.

 - This affects Mac only.
 - This is user invisible in normal usecase.
 - It simplifes the build chain.

BUG=#327
TEST=
REF_BUG=
REF_CL=113224226
REF_TIME=2016-01-28T12:15:25+09:00
REF_TIME_RAW=1453950925 +0900
yukawa added a commit that referenced this issue Aug 7, 2016
The primary goal of this CL is to reduce the number of build
configurations related to Qt to help Qt5 migration.

build_mozc.py has already used the environment variable QTDIR as the
default value of --qtdir option.  Hence we don't need to do the same
thing with qt_vars.gypi (and actually we shouldn't because depending on
environment vaiable in GYP makes incremental build non-deterministic).

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113461045
REF_TIME=2016-01-30T23:12:27-08:00
REF_TIME_RAW=1454224347 -0800
yukawa added a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

This additional abstraction layer to be able to replace pkg-config
command widh PKG_CONFIG environment variable was introduced only for
Chromium OS build, which was already replaced with NaCl-based build that
does not require such a mechanism.

With this CL we do not check PKG_CONFIG environment variable anymore.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113462419
REF_TIME=2016-01-31T00:11:19-08:00
REF_TIME_RAW=1454227879 -0800
yukawa added a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

This GYP variable is always true on all the platforms that Mozc team is
actively supporting.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113466432
REF_TIME=2016-01-31T02:45:59-08:00
REF_TIME_RAW=1454237159 -0800
yukawa added a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

'qt_target_defaults.gypi' is used only for injecting library settings.
Technically we can specify the same settings in 'qt_libraries.gypi'.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113468293
REF_TIME=2016-01-31T04:01:43-08:00
REF_TIME_RAW=1454241703 -0800
yukawa pushed a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

Porting this code to Qt 5 is probably not worth doing.  Hence we decided
to stop applying custom Glass effect to some GUI tools on Windows.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113518724,113603965
REF_TIME=2016-02-01T22:26:15+09:00
REF_TIME_RAW=1454333175 +0900
yukawa added a commit that referenced this issue Aug 7, 2016
This is a preparation to make Qt5 migration process easier.

This CL drops OutputDebugString API support from mozc::gui::DebugUtil.

Presumably basic Mozc's logging functionality (+ debugger support in
Visual Studio) is good enough for us.  Let's drop OutputDebugString API
support from mozc::gui::DebugUtil in favor of simplicity.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113601295
REF_TIME=2016-02-01T22:02:49-08:00
REF_TIME_RAW=1454392969 -0800
yukawa added a commit that referenced this issue Aug 7, 2016
<QtGui/QWindowsStyle> is no longer a public header in Qt5.  Dropping the
dependency on that header makes Qt5 migration easier.

This CL changes only how to get Shield Icon in Windows environment.  No
behavior change is intended.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113603728
REF_TIME=2016-02-01T22:52:18-08:00
REF_TIME_RAW=1454395938 -0800
yukawa pushed a commit that referenced this issue Aug 7, 2016
The code for Qt5 is not ready for build or deploy on all target
platform.  The current build procedure does not define MOZC_USE_QT5 and
this CL does not affect the current build with Qt4.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113608649
REF_TIME=2016-02-02T17:38:07+09:00
REF_TIME_RAW=1454402287 +0900
yukawa pushed a commit that referenced this issue Aug 7, 2016
To make Qt 5 migration process easier, we decided to stop using those
platform specific Qt stylesheets but use the the system default theme.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113926925
REF_TIME=2016-02-05T17:52:39+09:00
REF_TIME_RAW=1454662359 +0900
yukawa pushed a commit that referenced this issue Aug 7, 2016
To make Qt 5 migration process easier, we decided to drop the
configuration to statically link to Qt libraries on Linux.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113928643
REF_TIME=2016-02-05T18:21:55+09:00
REF_TIME_RAW=1454664115 +0900
yukawa added a commit that referenced this issue Aug 7, 2016
We are going to define 'qt_dir' GYP variable only when it makes
sense. Hence win32/installer/installer.gyp should not assume that
'qt_dir' is always defined.  Otherwise --noqt build would result in
build error.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=114044417
REF_TIME=2016-02-06T22:01:45-08:00
REF_TIME_RAW=1454824905 -0800
yukawa pushed a commit that referenced this issue Aug 7, 2016
Now you can build Mozc with Qt5 behind a build option on OS X.  To do
that, add an option as follows.
  python build_mozc.py gyp --qtver=5

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=114060144
REF_TIME=2016-02-08T02:32:42+09:00
REF_TIME_RAW=1454866362 +0900
yukawa pushed a commit that referenced this issue Aug 7, 2016
BUG=#327
TEST=
REF_BUG=
REF_CL=114343665
REF_TIME=2016-02-11T03:45:54+09:00
REF_TIME_RAW=1455129954 +0900
yukawa added a commit that referenced this issue Oct 1, 2016
This is a preparation to switch to Qt5 on Windows.

Currently what option is specified to the configure option --qtver is
only available in 'build_mozc.py gyp' phase, and there is no way to know
it in 'build_mozc.py build', which makes it impossible to change the
behavior of 'build_mozc.py build' depending on --qtver settings.

With this CL, target Qt version specified to 'build_mozc.py gyp' is also
stored in mozc_version.txt so that we can use it later in 'build_mozc.py
build' phase, like other configuration options such as version code.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=131560502
REF_TIME=2016-08-28T23:35:45-07:00
REF_TIME_RAW=1472452545 -0700
yukawa added a commit that referenced this issue Oct 1, 2016
On Windows Qt's runtime DLLs need to be copied into the directory where
mozc_tool.exe exists.  Since Qt4 and Qt5 have different DLL names, we
need to change the DLL names depending on the target Qt version.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=131561387
REF_TIME=2016-08-28T23:55:37-07:00
REF_TIME_RAW=1472453737 -0700
yukawa added a commit that referenced this issue Oct 1, 2016
This CL updates src/third_party/zinnia as follows:
  from: taku910/zinnia@814a49b
    to: taku910/zinnia@581faa8

It turns out that we could not build Zinnia as a static library on
Windows, which ends up with LNK2001 linker errors in Mozc.

This CL addresses this issue by updating Zinnia and specifies
ZINNIA_STATIC_LIBRARY.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=132283143
REF_TIME=2016-09-05T22:28:17-07:00
REF_TIME_RAW=1473139697 -0700
yukawa added a commit that referenced this issue Oct 1, 2016
Linux desktop build on Travis CI also starts using Qt5 with this CL.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=133351880
REF_TIME=2016-09-15T23:26:25-07:00
REF_TIME_RAW=1474007185 -0700
yukawa added a commit that referenced this issue Oct 2, 2016
This is a follow-up CL to f76c304,
with which we started using Qt5 by default for Linux desktop build.

BUG=#327
TEST=
REF_BUG=
REF_CL=
REF_TIME=
REF_TIME_RAW=
yukawa added a commit that referenced this issue Oct 2, 2016
This CL enables us to make sure that for each commit mozc_tool.exe can
still be built with Qt5 on Windows.

Note that Qt 5.6 is a Long Term Supported (LTS) release that will be
receiving security fixes and bug fixes for the three years since 2016
March.

BUG=#327
TEST=
REF_BUG=
REF_CL=
REF_TIME=
REF_TIME_RAW=
yukawa added a commit that referenced this issue Nov 17, 2016
With this CL, Qt5 runtime DLLs should be installed as follows, as
described in "Qt for Windows - Deployment" [1].

 * Release build
  - [TargetDir]\Qt5Core.dll
  - [TargetDir]\Qt5Gui.dll
  - [TargetDir]\Qt5Widgets.dll
  - [TargetDir]\platforms\qwindows.dll

 * Debug build
  - [TargetDir]\Qt5Cored.dll
  - [TargetDir]\Qt5Guid.dll
  - [TargetDir]\Qt5Widgetsd.dll
  - [TargetDir]\platforms\qwindowsd.dll

 [1]: http://doc.qt.io/qt-5/windows-deployment.html

BUG=#327
TEST=manually done
REF_BUG=26887740
REF_CL=135074336,137662866
REF_TIME=2016-10-04T00:25:03-07:00
REF_TIME_RAW=1475565903 -0700
yukawa pushed a commit that referenced this issue Nov 17, 2016
Dependencies on following files from GYP targets that triggers Qt's rcc
command are missed:
 - *.qm
 - other resource files that are embedded by rcc command (e.g. *.png)

As a result, previously updating those files did not invalidate
dependent targets when building Mozc incrementally.  With this CL,
build artifacts should reflect changes in those files even in
incremental build scenarios.

This CL also simplifies the logic to load Qt translations.  On Mac 64bit
environment the current code does not work because
CFLocaleCopyPreferredLanguages returns a list of NSString instead of
CFString for some reasons.

BUG=#327
TEST=
REF_BUG=
REF_CL=135321206,137660218,135750979
REF_TIME=2016-10-06T14:14:31+09:00
REF_TIME_RAW=1475730871 +0900
yukawa pushed a commit that referenced this issue Nov 20, 2016
Qt 5.4.1 does not use the 'override' keyword, but Mozc uses it. It
causes a lot of warnings.

BUG=#327
TEST=
REF_BUG=
REF_CL=136792367,136796122
REF_TIME=2016-10-21T12:12:55+09:00
REF_TIME_RAW=1477019575 +0900
yukawa added a commit that referenced this issue Nov 20, 2016
This is a follow up CL to ba51201.

Like Qt5Core.dll/Qt5Gui.dll/Qt5Widgets.dll, qwindows.dll also needs to
copied to the target directory.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=136927840
REF_TIME=2016-10-22T11:33:45-07:00
REF_TIME_RAW=1477161225 -0700
yukawa added a commit that referenced this issue Nov 20, 2016
With this CL, Windows build start using Qt5 unless --qtver=4 is
explicitly specified.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=136967529
REF_TIME=2016-10-23T10:48:40-07:00
REF_TIME_RAW=1477244920 -0700
yukawa added a commit that referenced this issue Nov 20, 2016
When --noqt is specified, {Debug,Release}/GoogleIMEJaTool.exe should be
used instead of {Debug,Release}Dynamic/GoogleIMEJaTool.exe to build
the installer for Windows.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=137113011
REF_TIME=2016-10-24T20:26:36-07:00
REF_TIME_RAW=1477365996 -0700
yukawa added a commit that referenced this issue Nov 21, 2016
With this CL, continuous build on Travis CI makes sure that GUI tools
can be built with Qt5 on mac.

BUG=#327
TEST=compile
REF_BUG=
REF_CL=
REF_TIME=2016-11-06T22:39:01-08:00
REF_TIME_RAW=1478500741 -0800
@yukawa
Copy link
Collaborator Author

yukawa commented Nov 21, 2016

We have make all the planned changes. Qt 5 is ready to be tested on Windows, macOS, and Linux. Any other issue that is reproducible only with Qt 5 should be handled as a separate bug.

@yukawa yukawa closed this as completed Nov 21, 2016
yukawa pushed a commit that referenced this issue Dec 13, 2016
With this CL, --qtver configure option will be removed and Mozc no
longer supports to be built with Qt 4.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=141386550
REF_TIME=2016-12-08T11:43:38+09:00
REF_TIME_RAW=1481165018 +0900
@DanielJoyce
Copy link

Hidpi still broken

@ftake
Copy link
Contributor

ftake commented Apr 3, 2019

Mozc should take an appropriate way to design GUI (Qt Creator etc.)

@yukawa yukawa mentioned this issue Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants