Skip to content

Commit 245a870

Browse files
committed
More attempted to fix Qt6 win build.
1 parent 9d08ff4 commit 245a870

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/drivers/Qt/ColorMenu.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void ColorMenuItem::setImageColor( QColor c )
7373

7474
lastColor = c;
7575

76-
b = parentWidget()->palette().color(QPalette::WindowText);
76+
b = qobject_cast<QWidget*>(parent())->palette().color(QPalette::WindowText);
7777

7878
i=0;
7979

@@ -140,7 +140,7 @@ void ColorMenuItem::openColorPicker(void)
140140
qs = title;
141141
qs.replace( "&", "", Qt::CaseInsensitive); // get rid of & accelerator characters
142142

143-
picker = new ColorMenuPickerDialog_t( colorPtr, qs.toLocal8Bit().constData(), parentWidget() );
143+
picker = new ColorMenuPickerDialog_t( colorPtr, qs.toLocal8Bit().constData(), qobject_cast<QWidget*>(parent()) );
144144

145145
picker->show();
146146

src/drivers/Qt/QtScriptManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ bool FileScriptObject::putChar(char c)
441441
{
442442
auto* engine = FCEU::JSEngine::getCurrent();
443443
engine->throwError(QJSValue::GenericError, "file is not open ");
444-
return -1;
444+
return false;
445445
}
446446
bool success = file->putChar(c);
447447

src/types.h

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ typedef uint8 (*readfunc)(uint32 A);
191191
#define __FCEU_PRINTF_ATTRIBUTE( fmt, va )
192192
#endif
193193

194+
#if defined(__cplusplus)
194195
// Scoped pointer ensures that memory pointed to by this object gets cleaned up
195196
// and deallocated when this object goes out of scope. Helps prevent memory leaks
196197
// on temporary memory allocations in functions with early outs.
@@ -261,6 +262,7 @@ class fceuScopedPtr
261262
enum fceuAllocType _allocType;
262263

263264
};
265+
#endif // __cplusplus
264266

265267
#include "utils/endian.h"
266268

0 commit comments

Comments
 (0)