LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.95k stars 994 forks source link

Switching to Qt5 #2611

Closed tresf closed 6 years ago

tresf commented 8 years ago

Many of our users are already compiling against Qt5, but most of them tend to be on Linux. This topic is related to switching all builds to Qt5 permanently and what's needed prior to that switch.

Screenshot, because everyone loves screenshots... image

liushuyu commented 8 years ago

Windows: Language dropdown is blank (see #1498 (comment))

Not only on Windows, but also on the other platforms namely Linux and Mac can't select languages

tresf commented 8 years ago

In fact, I saw the binary translation files were generated, but not installed to the installation directory. But if you re-run make install, the files will appear in the correct directory. Strange.

@liushuyu thanks. While looking for the language block you commented on, I noticed it was moved in https://github.com/LMMS/lmms/commit/ee3a99853b84d089fa99d4985d9d0b145d22bfb8. Tagging @Lukas-W.

The language logic has moved quite a bit over the last year including moving from CMakeLists.txt to src/CMakeLists.txt although I feel this may have a better home in data/locale/CMakeList.txt.

It's pretty obvious that order of operations has changed after this move, breaking language generation on first run for all platforms.

lukas-w commented 8 years ago

I feel this may have a better home in data/locale/CMakeList.txt.

Absolutely. Moved in 85011cdcf72fbba721bb0c10f140bfabf7a35725. That should fix the generation.

tresf commented 8 years ago

Absolutely. Moved in 85011cd. That should fix the generation.

As it does. :+1: Checking it off here as I'll track the Windows/Travis stuff in #2577 since it's not Qt5 related.

tresf commented 8 years ago

Hmmm... I'm having no luck with the splash screen bug... Qt version is 5.5.1_2

[ ] Mac: Spash window appears above SettingsDialog, MessageDialog

This bug doest NOT seem to occur on Windows.

I tried the following to no avail (clicking it won't raise it).

Solution(s) I tried:

Haven't tried... yuck:

No mention of it in known issues:

Test results: :no_entry: didn't work... (GuiApplication.cpp)

    // Show splash screen
    QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
+   // Prevent splash from covering settings dialog
+   splashScreen.setWindowFlags( splashScreen.windowFlags() | Qt::WindowStaysOnBottomHint );
    splashScreen.show();

:no_entry: didn't work... (GuiApplication.cpp)

    // Show splash screen
    QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
    splashScreen.show();
+   splashScreen.lower();

:no_entry: didn't work... (SetupDialog.cpp)

    vlayout->addWidget( settings );
    vlayout->addSpacing( 10 );
    vlayout->addWidget( buttons );
    vlayout->addSpacing( 10 );
    vlayout->addStretch();

+   setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);

    show();

+   raise();
softrabbit commented 8 years ago

Windows: Visual artifacts in MDI window decorations

I'm pretty sure I've seen those "ragged" MDI close buttons before, possibly in an LMMS/Qt5 build on Linux. Could they be a part of a style after all? And IMO they look too consistent for artifatcs.

tresf commented 8 years ago

Could ["ragged" MDI close buttons] be a part of a style after all?

Indeed they are -- tested by moving the themes directory. @Umcaruje any interest in tracking this one down?

Umcaruje commented 8 years ago

@Umcaruje any interest in tracking this one down?

My life is pretty crowded rn, I can take a look, but not sure when I'll have the time for it (I have some other issues I'm looking at).

Isn't #2516 going to fix this though? We are loading custom pixmaps for the buttons there.

tresf commented 8 years ago

Isn't #2516 going to fix this though? We are loading custom pixmaps for the buttons there.

Well, it would certainly be a moot point if #2516 were to be implemented, but I'm not placing any bets on a hypothetical, and this would give us a better understanding of things, anyhow.

Umcaruje commented 8 years ago

Well, it would certainly be a moot point if #2516 were to be implemented, but I'm not placing any bets on a hypothetical, and this would give us a better understanding of things, anyhow.

What if I started working on #2516 until its mergeable? ;) (though idk how that would be organised)

tresf commented 8 years ago

What if I started working on #2516 until its mergeable? ;) (though idk how that would be organised)

Well, actually, that may be our only option... Here's Windows with the theme disabled... (still happens)

image

I'll take a second look at the code, but this may be a not-our-bug-type scenario after-all...

tresf commented 8 years ago

Adding new item to list...

[ ] Windows: Channel activity indicator on by default

tresf commented 8 years ago

Update:

Closed:

Critical/Open:

Cosmetic:

@Umcaruje can you tell me if this is the intended look of the dropdowns? I ask because they seem a bit crammed -- specifically the lack of padding between the icon and the menu. I'm tagging you per #2567. If they look fine, we'll remove it from the checklist.

Mac Windows
image image
Umcaruje commented 8 years ago

Well, on linux, I actually have no icons in the dropdown menu, so I don't know how they looked.

I increased the padding accordingly in #2567, but I'm not sure how the icons behave. They should be moved 3 px to the left I guess, though Qt should render them centered, and not aligned to left.

If it can't be fixed in code, we can revert the margins back.

Umcaruje commented 8 years ago

Fixed it via https://github.com/LMMS/lmms/commit/d098a39c76321293af73f398ab89965e827b4d12

screenshot from 2016-03-04 22 13 58

mikobuntu commented 8 years ago

@Umcaruje Refering to your comment about no drop-down icons, this is a known issue... iirc I was talking to tobydox several years ago about this and if my memory server me right it was an issue with the actual DR. I wonder if there is a method to override this behaviour? Thanks

Umcaruje commented 8 years ago

@mikobuntu well, the problem is gone for me when I compiled using qt5, so I guess when we switch to it, it won't matter.

But no, I couldn't fix the issue, it seems to be a qt4 bug.

Umcaruje commented 8 years ago

@tresf I rebased #2516 and the White line on edge of all QWidgets is also gonna be superseded by it: screenshot from 2016-03-04 23 24 22

tresf commented 8 years ago

Fixed [menu icons] it via d098a39

:+1:

White line on edge of all QWidgets [...] superseded by #2516

:+1: :+1:

Do you guys get the LED indicator bug too on Linux? I don't have a ready Qt5 Linux environment to test on.

softrabbit commented 8 years ago

Do you guys get the LED indicator bug too on Linux? I don't have a ready Qt5 Linux environment to test on.

Yes, it's present. LMMS 1.1.90-g2e2abdf (Linux x86_64, Qt 5.4.2, GCC 5.2.1 20151010)

tresf commented 8 years ago

@softrabbit thanks for confirming.

Is there a chance this is just a bad initiation? Don't know the CSS side of things that well, but seems like this may be intended to be Inactive rather than Active. Pinging @Umcaruje https://github.com/LMMS/lmms/blob/master/src/tracks/InstrumentTrack.cpp#L916:L920

tresf commented 8 years ago

Meh... nevermind that statement... that's more in regards to the QWidget being active or inactive from a user-interaction perspective. I'm pretty sure Active is what we want, so this must be something else.

tresf commented 8 years ago

Ok, on second look, this is most likely due to the way Qt5 is handling the timer...

https://github.com/LMMS/lmms/blob/master/src/gui/widgets/FadeButton.cpp#L86:L100

When the FadeButton is initially created, this statement is most likely coming back as true. m_stateTimer is QTime. According to the Qt5 docs, we should be using m_stateTimer.isNull() as a check before doing a time comparison. Qt4.8 states this function exists there as well, so this shouldn't break backwards compat. :+1:

lukas-w commented 8 years ago

we should be using m_stateTimer.isNull() as a check before doing a time comparison

Indeed, that fixes it. Fixed via 8768769450e245ef409fbe68cb6583c6253d90fc.

tresf commented 8 years ago

Fixed via 8768769.

:+1:

This next item is our last noted issue...

[ ] All: QMdiWindow windowing controls are incorrectly colored (preview)

I've spent a considerable amount of time researching this to no avail. If anyone knows how to style these little buggers, please chime in. :+1: If not, we may mark as won-fix and live with it.

liushuyu commented 8 years ago

This next item is our last noted issue...

Ah, I consider this as the most difficult issue among these... I suppose that this may caused by the different rendering/parsing behavior between Qt 4 and Qt 5.

tresf commented 8 years ago

@musikBear: Here's your binary: https://github.com/tresf/lmms/releases/download/v1.2.0-RC1.2/lmms-1.1.90-win32-qt5.exe

Can we get some test results? Some of the aforementioned bugs won't be patched in this release, but we need more test results before making the decision to switch.

musikBear commented 8 years ago

@tresf Thanks! :cake: I will install asa i get home, and test tonight. Sanity-tests, and are there anything else specific? Just let me know

tresf commented 8 years ago

are there anything else specific

Yes, Qt5, specifically. We need to know if we can switch to it as a permanent replacement for Qt4, so any major bugs that aren't in RC1's Qt4 version are precisely what we're looking for.

musikBear commented 8 years ago

@tresf Install was a little different. The install lib was asked for twice, and an error appears every time lmms opens from desktop-icon/ associated-link: qt5pr_drive_not_ready A click on continue opens lmms normally. This error does not appear, if a new or existing project is selected inside lmms. Graphics This is how the main windows look: qt5_all_mains

Obs that the 'sound-bar' default is active, even though there is no sound. The green bar takes normal behavior emediately after 1. sound has played

Here are some instruments qt5_someinstruments

Obs the 'X' its like its a little wrong.

The sub-tabs: qt5_subpages

One strange behavior is when mixer-window is moved: qt5_movingmixer The graphic 'hangs' / is stretched or some will disappear under the frame-border qt5_movingmixer2 Unless you self, or other also see this odd mixer-blur, disregard as just my screen not updating. In empty projects, there is no blur!

Imo the windows-headers are in current default-theme difficult to read. darkRebekka would look much better, im sure :)

Besides graphics, is there something else that qt5 would influence in specific?

tresf commented 8 years ago

@musikBear

Thanks for the detailed feedback. Please continue to do so.

In regards to indicator lights and "x" button, both are documented in the original bug report as either fixed or superseded by a future fix.

The mixer artifacts are new... I'll try to reproduce. Much obliged.

tresf commented 8 years ago

Also, Apple testing has been very minimal at this point, but we've received a small amount of feedback from @sunnystormy per https://github.com/LMMS/lmms/issues/2504#issuecomment-188522060.

tresf commented 8 years ago

@musikBear

I'm unable to reproduce the Mixer graphical glitches on Windows XP.

Test results: https://www.youtube.com/watch?v=aMVmIvtfFKY

tresf commented 8 years ago

[ ] All: QMdiWindow windowing controls are incorrectly colored (preview)

I installed QtCreator for Windows to see how these are decorated natively, and there's quite a difference...

WindowsVista

QApplication::setStyle(QStyleFactory::create("WindowsVista"));

image

Fusion

QApplication::setStyle(QStyleFactory::create("Fusion"));

image

Windows (classic)

QApplication::setStyle(QStyleFactory::create("Windows"));

image

Available styles (not available on all platforms):

image

Perhaps some compat code like this before the QApplication constructor...

#ifdef LMMS_BUILD_WIN32
    QApplication::setStyle("WindowsVista") || QApplication::setStyle("WindowsXP") || QApplication::setStyle("Windows");
#elif LMMS_BUILD_APPLE
    QApplication::setStyle("Macintosh");
#else
    QApplication::setStyle("GTK") || QApplication::setStyle("Fusion");
#endif
tresf commented 8 years ago

[ ] All: QMdiWindow windowing controls are incorrectly colored (preview)

I guess the important lesson learned here is, be careful what you ask for, you just might get it.... (5f83afc).

Safe to say, we're going to leave this QMdiWindow windowing controls as-is (Plastique + Fusion). Please speak up if you object. ;)

Ubuntu 12.04 image

Windows XP image

Windows 10 image

Mac OS 10.11 image

IvanMaldonado commented 8 years ago

What will happen to the themeable title bars?

tresf commented 8 years ago

What will happen to the themeable title bars?

Safe to say, we're going to leave this QMdiWindow windowing controls as-is (Plastique + Fusion). Please speak up if you object. ;)

We're going to roll our own still. :+1: Native look won't work as illustrated. :)

musikBear commented 8 years ago

I have made some more win32xp tests on the qt5PR. Test for memory leak:

Idle out of focus time : size in TM 18:50 : 163.768 18:55 : 163.792 19:00 : 163.820 19:05 : 164.080 19:10 : 164.092 19:10 : 164.080 19:15 : 164.088 19:30 : 164.100 19:40 : 164.100 19:45 : 164.100 19:50 : 164.100

Playing in focus 19:50 : 14.090 19:55 : 14.332 20:00 : 14.141 20:05 : 14.244 20:10 : 14.244 20:15 : 14.248 20:20 : 14.248

I dont understand why 'out of focus' is significantly larger in ram usage, but thats transparent in respect to the memory-leak test. Imo These result shows that qt5 master has no memory-leaks. Good job, all!

Load and replay Test I have gone through the whole library 'cool-songs'. Every one loads extremely fast (few secd) and reliable. Every one replay perfectly. Imo relevance to

2656

But also to #1273

Test of ASIO4ALL I tried a 3. party dll with ASIO4ALL. I could load and play, but not close, successful. Closing resulted in expected BSOD, and i did not retry.

Umcaruje commented 8 years ago

Here's a Qt5 specific crash: #2667

Also, the about window needs some love: screenshot from 2016-03-11 15 23 19

tresf commented 8 years ago

@Umcaruje, added to list, much obliged.

musikBear commented 8 years ago

some odd graphics can appear There is no single action that reproducely will cause this, except mowing a lot of floating windows, and wait for it to happen. qt5graphicerr01

This one here qt5graphicerr02 appeared after several track-containers had been moved up and down. Track-names has been almost halved vertically, and shuffled
Obs! this could be my screen, an old tube-screen, actually from a dumpster :dollar: If noone else reports it too, it most likeli is my screen.

imo : not sure this tearing its a big issue here in lmms. Any movement of the object will force a redraw, and everything is back to normal.

StakeoutPunch commented 8 years ago

@musikBear How much ram does your PC have, and what graphics (since it is a XP machine, probably older intel Q series, like Q945)?

I ask because it might be that these artifacts are from the age/specs of your machine. Older computers with very low integrated graphics (relative to today's standards) with low graphical memory or system ram tend to have random render tearing like you've shown.

musikBear commented 8 years ago

@StakeoutPunch True, its from 2007 Specs: Processor Information: Vendor: GenuineIntel Speed: 2671 Mhz 2 logical processors 2 physical processors HyperThreading: Unsupported FCMOV: Supported SSE2: Supported

Network Information: Network Speed: DSL > 256k

Windows Version: Windows XP (32 bit) Network Information: Network Speed: DSL > 256k

Windows Version: Windows XP (32 bit) NTFS: Supported

Video Card: Driver: NVIDIA GeForce 8600 GTS DirectX Driver Name: nv4_disp.dll Driver Version: 6.14.11.5819 DirectX Driver Version: 6.14.11.5819 Driver Date: 12 Apr 2007 Desktop Color Depth: 32 bits per pixel Monitor Refresh Rate: 85 Hz DirectX Card: NVIDIA GeForce 8600 GTS VendorID: 0x10de DeviceID: 0x400 Number of Monitors: 1 Number of Logical Video Cards: 1 No SLI or Crossfire Detected Primary Display Resolution: 1024 x 768 Desktop Resolution: 1024 x 768 Primary Display Size: 12.60" x 9.45" (15.75" diag) 32.0cm x 24.0cm (40.0cm diag)

Primary Bus: PCI Express 16x Primary VRAM: 256 MB Supported MSAA Modes: 2x 4x 8x

Sound card: Audio device: Realtek HD Audio output Memory: RAM: 2047 Mb

Miscellaneous: UI Language: English Microphone: Yes, I have a microphone. Media Type: DVD

Mind you, i have successfully run 3 instances of lmms simultaneous on that hw! I think it is one of lmms' strength, that it is able to run on even older hw, and stable on top of that. Dont pay attention to this. Screen-tearing is (imo) an absolutely unimportant issue. And it does only occur in real stress situations, not in normal use. Imo only the criticals are to be adressed, but thats only mho. B.r.

Umcaruje commented 8 years ago

Ok, so we can close this one out now, as all the issues were adressed. Great job everybody :+1:

liushuyu commented 8 years ago

:+1:

tresf commented 8 years ago

Although the checklist would suggest that, I feel we should make our build environment do this by default to consider this task closed.

Umcaruje commented 8 years ago

I feel we should make our build environment do this by default to consider this task closed.

Hmm, you're right. Forgot about that one.

tresf commented 8 years ago

Added new item to the checklist:

Goes without saying but this bug is a deal breaker on Windows if not resolved. It will spike a 100% usage on a CPU core if running Qt5. Discussion specific to the bug should remain in #2767.

tresf commented 8 years ago

Added new items to the checklist:

Yet another deal breaker for Qt5. Help/workarounds, etc are appreciated. :+1:

tresf commented 8 years ago

Since Windows VSTs seem to be in usable shape and Mac does not yet support VSTs, I feel we are ready to switch to Qt5 for Mac and Windows for our next release.

I'm marking off the VST bug and adding a new task, "Remove Mac/Windows Qt4 builds from Travis-CI".