mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 00:43:54 +08:00
getTextRect: pass text by const reference (#25555)
This commit is contained in:
@@ -162,7 +162,7 @@ QPixmap loadPixmap(const QString &fileName, const QSize &size, Qt::AspectRatioMo
|
||||
}
|
||||
}
|
||||
|
||||
QRect getTextRect(QPainter &p, int flags, QString text) {
|
||||
QRect getTextRect(QPainter &p, int flags, const QString &text) {
|
||||
QFontMetrics fm(p.font());
|
||||
QRect init_rect = fm.boundingRect(text);
|
||||
return fm.boundingRect(init_rect, flags, text);
|
||||
|
||||
@@ -24,6 +24,6 @@ void initApp(int argc, char *argv[]);
|
||||
QWidget* topWidget (QWidget* widget);
|
||||
QPixmap loadPixmap(const QString &fileName, const QSize &size = {}, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio);
|
||||
|
||||
QRect getTextRect(QPainter &p, int flags, QString text);
|
||||
QRect getTextRect(QPainter &p, int flags, const QString &text);
|
||||
void drawRoundedRect(QPainter &painter, const QRectF &rect, qreal xRadiusTop, qreal yRadiusTop, qreal xRadiusBottom, qreal yRadiusBottom);
|
||||
QColor interpColor(float xv, std::vector<float> xp, std::vector<QColor> fp);
|
||||
|
||||
Reference in New Issue
Block a user