1
0
mirror of https://github.com/samstyle/Xpeccy.git synced 2025-04-19 00:04:05 +03:00

build 20250406

+ deBUGa: a small improvements to a ports widget
+ fix CMakeLists for Qt<=5.7
This commit is contained in:
samstyle 2025-04-06 12:02:20 +03:00
parent e0a714cc8e
commit a57037eeb7
6 changed files with 18 additions and 17 deletions

View File

@ -214,11 +214,13 @@ if(${QTVERSION} EQUAL 4)
elseif(${QTVERSION} EQUAL 5)
find_package(Qt5 COMPONENTS Core Gui Widgets Gamepad REQUIRED)
set(LIBRARIES ${LIBRARIES} Qt5::Widgets Qt5::Gamepad)
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
set(LIBRARIES ${LIBRARIES} Qt5::Widgets)
if(NOT (${Qt5Widgets_VERSION} VERSION_LESS 5.7.0))
find_package(Qt5 COMPONENTS Gamepad REQUIRED)
set(LIBRARIES ${LIBRARIES} Qt5::Gamepad)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libqt5gamepad5 (>=5.7)")
set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libQt5Gamepad5 >= 5.7")
endif()
qt5_add_resources(RESOURCES ${QRCFILES})
qt5_wrap_ui(UIHEADERS ${UIFILES})

View File

@ -1 +1 @@
20250404
20250406

View File

@ -1 +1 @@
#define VERSION 0.6.20250404
#define VERSION 0.6.20250406

View File

@ -1,6 +1,8 @@
#include <QDebug>
#if USE_QT_GAMEPAD
#include <QGamepadManager>
#endif
#include <SDL_events.h>
#include <SDL_joystick.h>

View File

@ -26,7 +26,7 @@
#endif
// QGamepad -> Qt5.7+
#define USE_QT_GAMEPAD 1 && (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
#define USE_QT_GAMEPAD 0 && (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
#if USE_QT_GAMEPAD
#include <QGamepad>

View File

@ -339,13 +339,6 @@ DebugWin::DebugWin(QWidget* par):QMainWindow(par) {
connect(lab, &xLabel::clicked, this, &DebugWin::regClick);
connect(xhs, &xHexSpin::textChanged, this, &DebugWin::setCPU);
}
// create ports group
ui_misc.formPort->setVerticalSpacing(0);
for (i = 0; i < 32; i++) {
ui_misc.formPort->insertRow(i, new QLabel, new QLabel);
ui_misc.formPort->itemAt(i, QFormLayout::LabelRole)->widget()->setVisible(false);
ui_misc.formPort->itemAt(i, QFormLayout::FieldRole)->widget()->setVisible(false);
}
// create flags group (for cpu->f, 16 bit max)
flagrp = new QButtonGroup;
flagrp->setExclusive(false);
@ -1261,10 +1254,15 @@ void DebugWin::fillPorts() {
Computer* comp = conf.prof.cur->zx;
xPortValue* tab = hwGetPorts(comp);
int i = 0;
int cnt = ui_misc.formPort->rowCount();
if (tab) {
if (tab[0].port > 0) {
QLabel* wid;
while ((tab[i].port > 0) && (i < 32)) {
while (tab[i].port > 0) {
if (i >= cnt) {
ui_misc.formPort->addRow(new QLabel, new QLabel);
cnt++;
}
wid = (QLabel*)(ui_misc.formPort->itemAt(i, QFormLayout::LabelRole)->widget());
wid->setVisible(true);
wid->setText(gethexword(tab[i].port));
@ -1280,10 +1278,9 @@ void DebugWin::fillPorts() {
} else {
ui_misc.labPorts->setVisible(false);
}
while (i < 32) {
ui_misc.formPort->itemAt(i, QFormLayout::LabelRole)->widget()->setVisible(false);
ui_misc.formPort->itemAt(i, QFormLayout::FieldRole)->widget()->setVisible(false);
i++;
while (i < cnt) {
ui_misc.formPort->removeRow(i);
cnt--;
}
}