git-svn-id: svn://db.shs.com.ru/libs@464 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-12-02 17:50:22 +00:00
parent 3a89822846
commit 04d88cbacc
5 changed files with 77 additions and 34 deletions

View File

@@ -130,7 +130,7 @@ QString uniqueName(QString n, const QStringList & names) {
}
int fontHeight(QWidget * w) {
int fontHeight(const QWidget * w) {
#ifdef Q_OS_ANDROID
static int ret = QApplication::fontMetrics().size(0, "0").height();
return ret;
@@ -160,12 +160,12 @@ int fontHeight(QWidget * w) {
}
int lineThickness(QWidget * w) {
int lineThickness(const QWidget * w) {
return qMax<int>(qRound(fontHeight(w) / 15.), 1);
}
QSize preferredIconSize(float x, QWidget * w) {
QSize preferredIconSize(float x, const QWidget * w) {
int s = qMax<int>(8, qRound(fontHeight(w) * x));
#ifdef Q_OS_MACOS
s /= 1.25;
@@ -174,6 +174,6 @@ QSize preferredIconSize(float x, QWidget * w) {
}
double appScale(QWidget * w) {
double appScale(const QWidget * w) {
return qMax<double>(fontHeight(w) / 15., 1.);
}

View File

@@ -118,10 +118,10 @@ inline QRectF enlargedRect(const QRectF & r, qreal dx, qreal dy, qreal v) {
QVariant::Type typeFromLetter(const QString & l);
QString uniqueName(QString n, const QStringList & names);
int fontHeight(QWidget * w = 0);
int lineThickness(QWidget * w = 0);
QSize preferredIconSize(float x = 1.f, QWidget * w = 0);
double appScale(QWidget * w = 0);
int fontHeight(const QWidget * w = 0);
int lineThickness(const QWidget * w = 0);
QSize preferredIconSize(float x = 1.f, const QWidget * w = 0);
double appScale(const QWidget * w = 0);
#endif // QAD_TYPES_H