Build fixes for Qt6 on Mac OSX.

This commit is contained in:
mjbudd77 2021-04-11 17:39:37 -04:00
parent 27bb85f282
commit 806486e13d
10 changed files with 38 additions and 21 deletions

View File

@ -37,6 +37,7 @@
#include <QMenuBar>
#include <QMenu>
#include <QAction>
#include <QActionGroup>
#include <QGuiApplication>
#include "../../types.h"
@ -2986,7 +2987,7 @@ QAsmView::QAsmView(QWidget *parent)
//c = pal.color(QPalette::Base);
//printf("Base: R:%i G:%i B:%i \n", c.red(), c.green(), c.blue() );
//c = pal.color(QPalette::Background);
//c = pal.color(QPalette::Window);
//printf("BackGround: R:%i G:%i B:%i \n", c.red(), c.green(), c.blue() );
// Figure out if we are using a light or dark theme by checking the
@ -3003,13 +3004,13 @@ QAsmView::QAsmView(QWidget *parent)
if ( useDarkTheme )
{
pal.setColor(QPalette::Base , fg );
pal.setColor(QPalette::Background, fg );
pal.setColor(QPalette::Window , fg );
pal.setColor(QPalette::WindowText, bg );
}
else
{
pal.setColor(QPalette::Base , bg );
pal.setColor(QPalette::Background, bg );
pal.setColor(QPalette::Window , bg );
pal.setColor(QPalette::WindowText, fg );
}
@ -3877,7 +3878,7 @@ void QAsmView::paintEvent(QPaintEvent *event)
}
selAddr = parent->getBookmarkSelectedAddress();
painter.fillRect( 0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background) );
painter.fillRect( 0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window) );
y = pxLineSpacing;

View File

@ -38,6 +38,7 @@
#include <QDesktopServices>
#include <QStyleFactory>
#include <QApplication>
#include <QActionGroup>
#include <QShortcut>
#include <QUrl>
@ -133,7 +134,11 @@ consoleWin_t::consoleWin_t(QWidget *parent)
setWindowIcon(QIcon(":fceux1.png"));
gameTimer = new QTimer( this );
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
mutex = new QRecursiveMutex();
#else
mutex = new QMutex( QMutex::Recursive );
#endif
emulatorThread = new emulatorThread_t();
connect(emulatorThread, &QThread::finished, emulatorThread, &QObject::deleteLater);

View File

@ -18,8 +18,11 @@
#include <QKeyEvent>
#include <QTimer>
#include <QThread>
#include <QMutex>
#include <QCursor>
#include <QMutex>
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#include <QRecursiveMutex>
#endif
#include "Qt/ConsoleViewerGL.h"
#include "Qt/ConsoleViewerSDL.h"
@ -96,7 +99,11 @@ class consoleWin_t : public QMainWindow
void setCyclePeriodms( int ms );
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
QRecursiveMutex *mutex;
#else
QMutex *mutex;
#endif
void requestClose(void);

View File

@ -34,6 +34,7 @@
#include <QInputDialog>
#include <QMessageBox>
#include <QPushButton>
#include <QActionGroup>
#include "../../types.h"
#include "../../fceu.h"
@ -1847,7 +1848,7 @@ QHexEdit::QHexEdit(QWidget *parent)
pal = this->palette();
pal.setColor(QPalette::Base , bg );
pal.setColor(QPalette::Background, bg );
pal.setColor(QPalette::Window , bg );
pal.setColor(QPalette::WindowText, fg );
//editor->setAutoFillBackground(true);
@ -1980,7 +1981,7 @@ void QHexEdit::setForeGroundColor( QColor fg )
pal = this->palette();
//pal.setColor(QPalette::Base , Qt::black);
//pal.setColor(QPalette::Background, Qt::black);
//pal.setColor(QPalette::Window , Qt::black);
pal.setColor(QPalette::WindowText, fg );
this->setPalette(pal);
@ -1992,7 +1993,7 @@ void QHexEdit::setBackGroundColor( QColor bg )
pal = this->palette();
//pal.setColor(QPalette::Base , Qt::black);
pal.setColor(QPalette::Background, bg );
pal.setColor(QPalette::Window , bg );
//pal.setColor(QPalette::WindowText, fg );
this->setPalette(pal);
@ -3325,17 +3326,17 @@ int QHexEdit::getRomAddrColor( int addr, QColor &fg, QColor &bg )
QColor color, oppColor;
fg = this->palette().color(QPalette::WindowText);
bg = this->palette().color(QPalette::Background);
bg = this->palette().color(QPalette::Window );
if ( reverseVideo )
{
color = this->palette().color(QPalette::Background);
color = this->palette().color(QPalette::Window );
oppColor = this->palette().color(QPalette::WindowText);
}
else
{
color = this->palette().color(QPalette::WindowText);
oppColor = this->palette().color(QPalette::Background);
oppColor = this->palette().color(QPalette::Window );
}
if ( viewMode != MODE_NES_ROM )
@ -3543,7 +3544,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
lineOffset = maxLineOffset;
}
painter.fillRect( 0, 0, w, h, this->palette().color(QPalette::Background) );
painter.fillRect( 0, 0, w, h, this->palette().color(QPalette::Window) );
if ( cursorBlinkCount >= 5 )
{

View File

@ -24,6 +24,7 @@
#include <QDir>
#include <QMenu>
#include <QAction>
#include <QActionGroup>
#include <QMenuBar>
#include <QPainter>
#include <QInputDialog>

View File

@ -31,6 +31,7 @@
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QActionGroup>
#include <QHeaderView>
#include <QCloseEvent>
#include <QGroupBox>
@ -1583,13 +1584,13 @@ QRamSearchView::QRamSearchView(QWidget *parent)
if (useDarkTheme)
{
pal.setColor(QPalette::Base, fg);
pal.setColor(QPalette::Background, fg);
pal.setColor(QPalette::Window, fg);
pal.setColor(QPalette::WindowText, bg);
}
else
{
pal.setColor(QPalette::Base, bg);
pal.setColor(QPalette::Background, bg);
pal.setColor(QPalette::Window, bg);
pal.setColor(QPalette::WindowText, fg);
}
this->setPalette(pal);
@ -1869,7 +1870,7 @@ void QRamSearchView::paintEvent(QPaintEvent *event)
it++;
}
painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background));
painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window));
painter.setPen(this->palette().color(QPalette::WindowText));

View File

@ -1186,13 +1186,13 @@ QTraceLogView::QTraceLogView(QWidget *parent)
if (useDarkTheme)
{
pal.setColor(QPalette::Base, fg);
pal.setColor(QPalette::Background, fg);
pal.setColor(QPalette::Window, fg);
pal.setColor(QPalette::WindowText, bg);
}
else
{
pal.setColor(QPalette::Base, bg);
pal.setColor(QPalette::Background, bg);
pal.setColor(QPalette::Window, bg);
pal.setColor(QPalette::WindowText, fg);
}
@ -1977,7 +1977,7 @@ void QTraceLogView::paintEvent(QPaintEvent *event)
viewLines = nrow;
painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background));
painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window));
painter.setPen(this->palette().color(QPalette::WindowText));

View File

@ -33,6 +33,7 @@
#include <QMessageBox>
#include <QHeaderView>
#include <QTreeWidget>
#include <QActionGroup>
#include "../../types.h"
#include "../../fceu.h"

View File

@ -1088,7 +1088,7 @@ static void RefreshLine(int lastpixel) {
uint32 vofs;
int X1;
register uint8 *P = Pline;
uint8 *P = Pline;
int lasttile = lastpixel >> 3;
int numtiles;
static int norecurse = 0; // Yeah, recursion would be bad.

View File

@ -1,12 +1,12 @@
uint8 *C;
register uint8 cc;
uint8 cc;
uint32 vadr;
#ifdef PPU_VRC5FETCH
uint8 tmpd;
#endif
#ifndef PPUT_MMC5SP
register uint8 zz;
uint8 zz;
#else
uint8 xs, ys;
xs = X1;