mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Ref T220, font metric utility functions
Allows to obtain sizes based on number of characters
This commit is contained in:
@@ -16,10 +16,13 @@
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QSize>
|
||||
#include <QPoint>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QWidgetList>
|
||||
#include <QFont>
|
||||
#include <QFontMetrics>
|
||||
#include <QModelIndexList>
|
||||
|
||||
class QCheckBox;
|
||||
@@ -131,6 +134,21 @@ namespace BlackGui
|
||||
//! Fade out a widget
|
||||
static QGraphicsOpacityEffect *fadeOutWidget(int durationMs, QWidget *widget, double startValue = 1.0, double endValue = 0.0);
|
||||
|
||||
//! Main window font metrics or default metrics
|
||||
static QFontMetrics currentFontMetrics();
|
||||
|
||||
//! Main window font or default font
|
||||
static QFont currentFont();
|
||||
|
||||
//! 80 characters width/height
|
||||
static QSize fontMetrics80Chars();
|
||||
|
||||
//! 43 characters width/height "the quick brown ..."
|
||||
static QSize fontMetricsLazyDog43Chars();
|
||||
|
||||
//! Estimate size based on current font
|
||||
static QSize fontMetricsEstimateSize(int xCharacters, int yCharacters);
|
||||
|
||||
private:
|
||||
//! Constructor, use static methods only
|
||||
CGuiUtility() {}
|
||||
|
||||
Reference in New Issue
Block a user