MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DebuggerStackDisplay

Method DebuggerStackDisplay

src/drivers/Qt/ConsoleDebugger.cpp:6998–7035  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

6996}
6997//----------------------------------------------------------------------------
6998DebuggerStackDisplay::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//----------------------------------------------------------------------------
7037DebuggerStackDisplay::~DebuggerStackDisplay(void)
7038{

Callers

nothing calls this directly

Calls 3

getOptionMethod · 0.80
fromStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected