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

Feat: basic Qt6 + QML support #1098

Closed
wants to merge 2 commits into from
Closed

Conversation

fibur
Copy link

@fibur fibur commented Jan 6, 2025

Changes for Qt6 + QML adaptation.

Note: tested only on Ubuntu 22.04, with Qt 6.5.3

Qt 6 porting
I did not have time to test that with other platforms. I also didn't check all possible functionalities, as I was mainly focused on adapting for personal project, in which I only needed plain screen casting + input.

I can confirm scrcpy works, dialog is also displayed and is fully responsive. I am not sure if audio works.
image

simplescreenrecorder-2025-01-06_20.51.43.mp4

Qml porting
As stated previously, I focused mainly on displaying direct scrcpy output in QML. That being said, I did not adapt every possible function and method, as simply I didn't need them. However below changes are good starting point for future developers, to fully implement QtScrcpy in QML.

Ported OpenGL widget to single QQuickItem allowing to display scrcpy output.

Dialog config parameters are moved to new ScrcpyManager QtQuick singleton. Adapted all parameters to Q_PROPERTY so they can be modified before starting stream - some of them may not be needed anymore.

For now manager accepts only one ScrcpyItem connection at once, but this shouldn't be hard to extend in the future.

Below video of minimal QML application using adapted QtScrcpy (source is attached in this PR too):

simplescreenrecorder-2025-01-06_20.59.21.mp4

Note: currently fork of QtScrcpyCore is used, because some adjustments to support Qt6 were needed here.

I also suggest merging this PR to separate branch, since it's still WIP, and requires more testing and probably adjustments.

.gitmodules Outdated
@@ -1,3 +1,3 @@
[submodule "QtScrcpy/QtScrcpyCore"]
path = QtScrcpy/QtScrcpyCore
url = [email protected]:barry-ran/QtScrcpyCore.git
url = [email protected]:fibur/QtScrcpyCore.git
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change when barry-ran/QtScrcpyCore#12 is merged

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!!
QtScrpyCore has been merged

@barry-ran barry-ran changed the base branch from dev to qt6 January 8, 2025 03:45
@barry-ran
Copy link
Owner

Could you please split the three commits into three PRs

@fibur
Copy link
Author

fibur commented Jan 8, 2025

Done:

#1100

#1101

closing this PR.

@fibur fibur closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants