C

Obsolete Members for Screen

The following members of class Screen are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

(obsolete) Screen(const PlatformInterface::Size &size, const char *identifier = "", bool resizeable = false)

Member Function Documentation

Screen::Screen(const PlatformInterface::Size &size, const char *identifier = "", bool resizeable = false)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Constructs a Screen object with the given display size, identifier and sets if the display is resizeable.

Default values for resizeable is false and for identifier is an empty string.

Note: The constructor is creating a shallow copy of the identifier pointer. String literal with static storage duration is expected for identifier argument.

Example of the correct usage:

const PlatformInterface::Size size(800, 480);
const char* name = "example_display"; // string literal with static storage duration
PlatformInterface::Screen screen(size, name);

Example of possible problem with local storage duration variable:

const PlatformInterface::Size size(800, 480);
const std::string badName = "example_display"; // std::string with scoped lifetime
PlatformInterface::Screen screen(size, badName.c_str()); // this will create a dangling pointer once std::string gets destroyed

Available under certain Qt licenses.
Find out more.