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

dp() problems on Android #489

Open
PoisonousJohn opened this issue Nov 5, 2016 · 3 comments
Open

dp() problems on Android #489

PoisonousJohn opened this issue Nov 5, 2016 · 3 comments

Comments

@PoisonousJohn
Copy link

PoisonousJohn commented Nov 5, 2016

I tried to launch app on my Xiaomi Mi4c and it looks like this:

screenshot_2016-11-05-13-58-10

but when i launch it for desktop target, it looks like this:

2016-11-05 21 41 19

It seems that dp function works wrong for me. Is it a bug? If so, do you have any suggestions on how to fix this bug?

@PoisonousJohn PoisonousJohn changed the title DP problems on Android dp() problems on Android Nov 5, 2016
@PoisonousJohn
Copy link
Author

PoisonousJohn commented Nov 6, 2016

I tracked down bug. I changed this line

https://github.com/papyros/qml-material/blob/develop/src/core/units.cpp#L78

to

    return dp > 0 ? dp : m_multiplier;

If I got it right, dpi() / 160 -- is a calculation of multiplier, thus there is no need to multiply dp by multiplier.

This worked for me. Is this appropriate solution?

@yangxingpping
Copy link

I have the similar problem, when I run the demo with qmlscene, it's looks very uncomfortable(too small), the platform is iMac with Win10. But looks well on an other PC. As I Use QtCreator to create an Qt Quick 2 Application Style empty demo. It's also looks well on iMac with Win10. So i edit the Material\Units.qml,replace function dp(number)with function dp(number) {return number;}, But i don't know why

@timsueberkrueb
Copy link
Contributor

Qt >= 5.6 has built-in proper high dpi support. QML Material is also no longer being developed. I'd recommend checking out the new QtQuick Controls 2 with Material Style and Fluid.

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

No branches or pull requests

3 participants