warning fixes
unpaid_cost(): 'shkp' might be used without being initialized. That sort of warning is sometimes wrong but was correct in this instance. qt_Splash(): the Qt 6.2 warning suggests switching the argument for setMask() from QBitmap() to fromPixmap() but that doesn't work with 5.11. However, switching from setMask() to setPixmap() does work, and results in a crisp splash image instead of the fuzzy one I recently complained about. I've no idea what the right QT_VERSION check ought to be but another QLabel propery is documented as "added in 4.2" and the pixmap one has no such mention so I picked Qt < 4 for the code that's been in use and Qt >= 4 for the new code.
This commit is contained in:
@@ -2420,7 +2420,7 @@ unpaid_cost(
|
||||
boolean include_contents)
|
||||
{
|
||||
struct bill_x *bp = (struct bill_x *) 0;
|
||||
struct monst *shkp;
|
||||
struct monst *shkp = 0;
|
||||
char *shop;
|
||||
long amt = 0L;
|
||||
|
||||
|
||||
@@ -125,7 +125,14 @@ NetHackQtBind::qt_Splash()
|
||||
vb->addWidget(capt);
|
||||
capt->setAlignment(Qt::AlignCenter);
|
||||
lsplash->setFixedSize(pm.size());
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
// if used on 5.11, this produces a fuzzy image
|
||||
lsplash->setMask(QBitmap(pm));
|
||||
#else
|
||||
// required for 6.2; on 5.11, this produces a crisp image
|
||||
lsplash->setPixmap(pm);
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x060000
|
||||
QSize screensize = QApplication::desktop()->size();
|
||||
|
||||
Reference in New Issue
Block a user