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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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