----------------------------------------------------------------------------
| 6996 | } |
| 6997 | //---------------------------------------------------------------------------- |
| 6998 | DebuggerStackDisplay::DebuggerStackDisplay(QWidget *parent) |
| 6999 | : QPlainTextEdit(parent) |
| 7000 | { |
| 7001 | QFont font; |
| 7002 | std::string fontString; |
| 7003 | |
| 7004 | stackBytesPerLine = 4; |
| 7005 | showAddrs = true; |
| 7006 | |
| 7007 | recalcCharsPerLine(); |
| 7008 | |
| 7009 | g_config->getOption("SDL.DebuggerStackFont", &fontString); |
| 7010 | |
| 7011 | if ( fontString.size() > 0 ) |
| 7012 | { |
| 7013 | font.fromString( QString::fromStdString( fontString ) ); |
| 7014 | } |
| 7015 | else |
| 7016 | { |
| 7017 | font.setFamily("Courier New"); |
| 7018 | font.setStyle( QFont::StyleNormal ); |
| 7019 | font.setStyleHint( QFont::Monospace ); |
| 7020 | } |
| 7021 | setFont( font ); |
| 7022 | |
| 7023 | QFontMetrics fm(font); |
| 7024 | |
| 7025 | #if QT_VERSION > QT_VERSION_CHECK(5, 11, 0) |
| 7026 | pxCharWidth = fm.horizontalAdvance(QLatin1Char('2')); |
| 7027 | #else |
| 7028 | pxCharWidth = fm.width(QLatin1Char('2')); |
| 7029 | #endif |
| 7030 | pxLineSpacing = fm.lineSpacing(); |
| 7031 | |
| 7032 | setMinimumWidth( pxCharWidth * charsPerLine ); |
| 7033 | setMinimumHeight( pxLineSpacing * 5 ); |
| 7034 | setMaximumHeight( pxLineSpacing * 20 ); |
| 7035 | } |
| 7036 | //---------------------------------------------------------------------------- |
| 7037 | DebuggerStackDisplay::~DebuggerStackDisplay(void) |
| 7038 | { |
nothing calls this directly
no test coverage detected