DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dwidgetutil.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DUTILITY_H
6#define DUTILITY_H
7
8#include <dtkwidget_global.h>
9
10#include <QImage>
11#include <QColor>
12#include <QIcon>
13#include <QTextOption>
14
15DWIDGET_BEGIN_NAMESPACE
16
17QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color = Qt::black);
18
19QStringList wordWrapText(const QString &text, int width,
20 QTextOption::WrapMode wrapMode,
21 int *lineCount = 0);
22
23QStringList elideText(const QString &text, const QSize &size,
24 const QFontMetrics &fontMetrics,
25 QTextOption::WrapMode wordWrap,
26 Qt::TextElideMode mode,
27 int flags = 0);
28
29QIcon getCircleIcon(const QPixmap &pixmap, int diameter = 36);
30QIcon getCircleIcon(const QIcon &icon, int diameter = 36);
31
32void grayScale(const QImage &image, QImage &dest, const QRect &rect = QRect());
33void moveToCenter(QWidget *w);
34
35DWIDGET_END_NAMESPACE
36
37#endif // DUTILITY_H