Added a minimum column pixel width to ensure that at least 6 characters can be displayed on name table viewer text fields.
This commit is contained in:
parent
e60abba722
commit
eae4dd8312
|
@ -144,12 +144,19 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||||
QLabel *lbl;
|
QLabel *lbl;
|
||||||
QFont font;
|
QFont font;
|
||||||
//char stmp[64];
|
//char stmp[64];
|
||||||
int useNativeMenuBar;
|
int useNativeMenuBar, pxCharWidth;
|
||||||
|
|
||||||
font.setFamily("Courier New");
|
font.setFamily("Courier New");
|
||||||
font.setStyle( QFont::StyleNormal );
|
font.setStyle( QFont::StyleNormal );
|
||||||
font.setStyleHint( QFont::Monospace );
|
font.setStyleHint( QFont::Monospace );
|
||||||
|
|
||||||
|
QFontMetrics metrics(font);
|
||||||
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
|
pxCharWidth = metrics.horizontalAdvance(QLatin1Char('2'));
|
||||||
|
#else
|
||||||
|
pxCharWidth = metrics.width(QLatin1Char('2'));
|
||||||
|
#endif
|
||||||
|
|
||||||
nameTableViewWindow = this;
|
nameTableViewWindow = this;
|
||||||
|
|
||||||
menuBar = new QMenuBar(this);
|
menuBar = new QMenuBar(this);
|
||||||
|
@ -424,6 +431,8 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||||
lbl->setFont( font );
|
lbl->setFont( font );
|
||||||
grid->addWidget( lbl, 7, 0, Qt::AlignLeft );
|
grid->addWidget( lbl, 7, 0, Qt::AlignLeft );
|
||||||
|
|
||||||
|
grid->setColumnMinimumWidth( 1, pxCharWidth * 6 );
|
||||||
|
|
||||||
ppuAddrLbl = new QLineEdit();
|
ppuAddrLbl = new QLineEdit();
|
||||||
ppuAddrLbl->setReadOnly(true);
|
ppuAddrLbl->setReadOnly(true);
|
||||||
grid->addWidget( ppuAddrLbl, 0, 1, Qt::AlignLeft );
|
grid->addWidget( ppuAddrLbl, 0, 1, Qt::AlignLeft );
|
||||||
|
|
Loading…
Reference in New Issue