Remove unnecessary private Qt API usage
This commit is contained in:
parent
be0067a8c7
commit
8c58ebc136
2 changed files with 1 additions and 10 deletions
|
|
@ -17,7 +17,6 @@
|
||||||
#include <QtGui/QFontInfo>
|
#include <QtGui/QFontInfo>
|
||||||
#include <QtGui/QFontDatabase>
|
#include <QtGui/QFontDatabase>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <private/qfontengine_p.h>
|
|
||||||
|
|
||||||
void style_InitFontsResource() {
|
void style_InitFontsResource() {
|
||||||
#ifdef Q_OS_MAC // Use resources from the .app bundle on macOS.
|
#ifdef Q_OS_MAC // Use resources from the .app bundle on macOS.
|
||||||
|
|
@ -293,12 +292,6 @@ int registerFontFamily(const QString &family) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CeilTextWidth(const QFont &font, const QString &text) {
|
|
||||||
return text.isEmpty()
|
|
||||||
? 0
|
|
||||||
: QStackTextEngine(text, font).width(0, text.size()).ceil().toInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
FontData::FontData(int size, uint32 flags, int family, Font *other)
|
FontData::FontData(int size, uint32 flags, int family, Font *other)
|
||||||
: f(ResolveFont(family ? fontFamilies[family] : QString(), flags, size))
|
: f(ResolveFont(family ? fontFamilies[family] : QString(), flags, size))
|
||||||
, _m(f)
|
, _m(f)
|
||||||
|
|
|
||||||
|
|
@ -68,12 +68,10 @@ enum FontFlags {
|
||||||
FontDifferentFlags = 0x40,
|
FontDifferentFlags = 0x40,
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] int CeilTextWidth(const QFont &font, const QString &text);
|
|
||||||
|
|
||||||
class FontData {
|
class FontData {
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] int width(const QString &text) const {
|
[[nodiscard]] int width(const QString &text) const {
|
||||||
return CeilTextWidth(f, text);
|
return int(std::ceil(_m.horizontalAdvance(text)));
|
||||||
}
|
}
|
||||||
[[nodiscard]] int width(const QString &text, int from, int to) const {
|
[[nodiscard]] int width(const QString &text, int from, int to) const {
|
||||||
return width(text.mid(from, to));
|
return width(text.mid(from, to));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue