forked from osmocom/wireshark
Qt: fix Qt 5.15 deprecation warning
QFont::ForceIntegerMetrics is deprecated.
This commit is contained in:
parent
65c6d829db
commit
29e59a0e20
|
@ -181,10 +181,9 @@ void ByteViewText::markAppendix(int start, int length)
|
|||
void ByteViewText::setMonospaceFont(const QFont &mono_font)
|
||||
{
|
||||
QFont int_font(mono_font);
|
||||
int_font.setStyleStrategy(QFont::ForceIntegerMetrics);
|
||||
|
||||
const QFontMetricsF fm(int_font);
|
||||
font_width_ = fm.width('M');
|
||||
const QFontMetrics fm(int_font);
|
||||
font_width_ = fm.boundingRect('M').width();
|
||||
|
||||
setFont(int_font);
|
||||
viewport()->setFont(int_font);
|
||||
|
|
|
@ -119,7 +119,7 @@ private:
|
|||
bool show_hex_; // Should we show the hex display?
|
||||
bool show_ascii_; // Should we show the ASCII display?
|
||||
int row_width_; // Number of bytes per line
|
||||
qreal font_width_; // Single character width and text margin. NOTE: Use fontMetrics::width for multiple characters.
|
||||
int font_width_; // Single character width and text margin. NOTE: Use fontMetrics::width for multiple characters.
|
||||
int line_height_; // Font line spacing
|
||||
QList<QRect> hover_outlines_; // Hovered byte outlines.
|
||||
|
||||
|
|
Loading…
Reference in New Issue