Skip to content
This repository was archived by the owner on Jul 17, 2023. It is now read-only.

Conversation

ekke
Copy link
Contributor

@ekke ekke commented Oct 31, 2018

Have tested with some devices and simulator and now the preferred style remains if orientation changes.
simply setting the style again doesn't help
setting the opposite theme and starting a QTimer to set to preferred style again works.

if (keyWindow)
setPreferredStatusBarStyle(keyWindow, style);

QTimer* timer = new QTimer();
Copy link
Owner

Choose a reason for hiding this comment

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

The timer object is not deleted => memory leak. Allocating it on the stack would be an option, but QTimer has also a
handy static singleShot() method to make this more straight-forward:

QTimer::singleShot(200, []() {
    ...
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx explaining. using singleShot it's much easier now.
learning new things every day ;-)

@jpnurmi jpnurmi merged commit 0de9c66 into jpnurmi:master Oct 31, 2018
@jpnurmi
Copy link
Owner

jpnurmi commented Oct 31, 2018

Awesome, thanks! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants