pub struct StyleStrategy(/* private fields */);
Expand description

The style strategy tells the font matching algorithm what type of fonts should be used to find an appropriate default family.

C++ enum: QFont::StyleStrategy.

C++ documentation:

The style strategy tells the font matching algorithm what type of fonts should be used to find an appropriate default family.

The following strategies are available:

Any of these may be OR-ed with one of these flags:

Implementations§

source§

impl StyleStrategy

source

pub fn to_int(&self) -> c_int

source§

impl StyleStrategy

source

pub const PreferDefault: StyleStrategy = _

the default style strategy. It does not prefer any type of font. (C++ enum variant: PreferDefault = 1)

source

pub const PreferBitmap: StyleStrategy = _

prefers bitmap fonts (as opposed to outline fonts). (C++ enum variant: PreferBitmap = 2)

source

pub const PreferDevice: StyleStrategy = _

prefers device fonts. (C++ enum variant: PreferDevice = 4)

source

pub const PreferOutline: StyleStrategy = _

prefers outline fonts (as opposed to bitmap fonts). (C++ enum variant: PreferOutline = 8)

source

pub const ForceOutline: StyleStrategy = _

forces the use of outline fonts. (C++ enum variant: ForceOutline = 16)

source

pub const PreferMatch: StyleStrategy = _

prefer an exact match. The font matcher will try to use the exact font size that has been specified. (C++ enum variant: PreferMatch = 32)

source

pub const PreferQuality: StyleStrategy = _

prefer the best quality font. The font matcher will use the nearest standard point size that the font supports. (C++ enum variant: PreferQuality = 64)

source

pub const PreferAntialias: StyleStrategy = _

antialias if possible. (C++ enum variant: PreferAntialias = 128)

source

pub const NoAntialias: StyleStrategy = _

don’t antialias the fonts. (C++ enum variant: NoAntialias = 256)

source

pub const OpenGLCompatible: StyleStrategy = _

forces the use of OpenGL compatible fonts. (C++ enum variant: OpenGLCompatible = 512)

source

pub const ForceIntegerMetrics: StyleStrategy = _

forces the use of integer values in font engines that support fractional font metrics. (C++ enum variant: ForceIntegerMetrics = 1024)

source

pub const NoSubpixelAntialias: StyleStrategy = _

avoid subpixel antialiasing on the fonts if possible. (C++ enum variant: NoSubpixelAntialias = 2048)

source

pub const NoFontMerging: StyleStrategy = _

If the font selected for a certain writing system does not contain a character requested to draw, then Qt automatically chooses a similar looking font that contains the character. The NoFontMerging flag disables this feature. Please note that enabling this flag will not prevent Qt from automatically picking a suitable font when the selected font does not support the writing system of the text. (C++ enum variant: NoFontMerging = 32768)

source

pub const PreferNoShaping: StyleStrategy = _

Sometimes, a font will apply complex rules to a set of characters in order to display them correctly. In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, but in e.g. Latin script, it is merely a cosmetic feature. The PreferNoShaping flag will disable all such features when they are not required, which will improve performance in most cases (since Qt 5.10). (C++ enum variant: PreferNoShaping = 4096)

Trait Implementations§

source§

impl Clone for StyleStrategy

source§

fn clone(&self) -> StyleStrategy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StyleStrategy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<StyleStrategy> for c_int

source§

fn from(value: StyleStrategy) -> Self

Converts to this type from the input type.
source§

impl From<i32> for StyleStrategy

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for StyleStrategy

source§

fn eq(&self, other: &StyleStrategy) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for StyleStrategy

source§

impl Eq for StyleStrategy

source§

impl StructuralEq for StyleStrategy

source§

impl StructuralPartialEq for StyleStrategy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.