Changes for Qt 6 on MacOS

This commit is contained in:
Ray Chason
2021-12-27 13:45:54 -05:00
parent 8b30f3e1d1
commit 7d8563d33a
25 changed files with 536 additions and 33 deletions

View File

@@ -7,10 +7,16 @@
extern "C" {
#include "hack.h"
}
#undef C
#define CTRL(c) (0x1f & (c))
#include "qt_pre.h"
#include <QtGui/QtGui>
#if QT_VERSION >= 0x060000
#include <QtGui/QShortcut>
#else
#include <QtWidgets/QShortcut>
#endif
#if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets>
@@ -856,8 +862,8 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
#endif
int x=0,y=0;
int w=QApplication::desktop()->width()-10; // XXX arbitrary extra space for frame
int h=QApplication::desktop()->height()-50;
int w=screen()->size().width()-10; // XXX arbitrary extra space for frame
int h=screen()->size().height()-50;
int maxwn;
int maxhn;
@@ -902,7 +908,7 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
// all other control characters go through NetHackQtBind::notify()
void NetHackQtMainWindow::CtrlV()
{
static const char cV[] = { C('V'), '\0' };
static const char cV[] = { CTRL('V'), '\0' };
doKeys(cV);
}
#endif