PrismLauncher/launcher/ui/widgets/Common.h
flow 4a13dbe3bb
feat: create delegate for project item views
This allows us to define custom painting for list view items. In
particular, this is applied to the mod downloader, in order to allow
displaying both the mod name and mod description, and settings their
effects (like bold or underline) independent of each other.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00

10 lines
416 B
C++

#pragma once
#include <QTextLayout>
/** Cuts out the text in textLayout into smaller pieces, according to the lineWidth.
* Returns a list of pairs, each containing the width of that line and that line's string, respectively.
* The total height of those lines is set in the last argument, 'height'.
*/
QList<std::pair<qreal, QString>> viewItemTextLayout(QTextLayout& textLayout, int lineWidth, qreal& height);