Fix compilation of 'gb.qt4'

[GB.QT4]
* BUG: Fix compilation of 'gb.qt4'.
This commit is contained in:
Benoît Minisini 2023-10-03 00:30:44 +02:00
parent cf6038498b
commit 6786d97275
4 changed files with 14 additions and 5 deletions

View file

@ -95,7 +95,7 @@ Resizes a widget.
#define MOVE_RESIZE_WIDGET(_object, _widget, _x, _y, _w, _h)
Move & resize a widget simultaneously.
#define RESIZE_CONTAINER(_object, _w, _h)
#define RESIZE_CONTAINER(_object, _cont, _w, _h)
Resizes the container object by resizing the widget itself.
#define INIT_CHECK_CHILDREN_LIST(_widget)
@ -250,7 +250,7 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont)
hf = GET_WIDGET_H(cont) - hc;
#endif
//fprintf(stderr, "cont: %s: %d %d %d %d (%d %d)\n", ((gControl *)_object)->name(), xc, yc, wc, hc, wf, hf);
//fprintf(stderr, "GET_WIDGET_CONTENTS: %s: %d %d %d %d\n", GET_OBJECT_NAME(_object), xc, yc, wc, hc);
//if (hc > GET_WIDGET_H(cont))
// qDebug("hc = %d H = %d ?", hc, GET_WIDGET_H(cont));

View file

@ -124,7 +124,7 @@ CPICTURE *CPICTURE_grab(QWidget *wid, int screen, int x, int y, int w, int h)
#ifdef QT5
//*pict->pixmap = QGuiApplication::primaryScreen()->grabWindow(QX11Info::appRootWindow(), x, y, w, h);
PLATFORM.Desktop.Screenshot(pict->pixmap, x, y, w, h);
PLATFORM.Desktop.Screenshot(pict->pixmap, x, y, w, h, screen);
#else
*pict->pixmap = QPixmap::grabWindow(QX11Info::appRootWindow(), x, y, w, h);
#endif

View file

@ -513,6 +513,13 @@ BEGIN_PROPERTY(Screen_ResolutionY)
END_PROPERTY
BEGIN_METHOD(Screen_Screenshot, GB_INTEGER x; GB_INTEGER y; GB_INTEGER w; GB_INTEGER h)
GB.ReturnObject(CPICTURE_grab(0, SCREEN->index, VARGOPT(x, 0), VARGOPT(y, 0), VARGOPT(w, 0), VARGOPT(h, 0)));
END_METHOD
//-------------------------------------------------------------------------
GB_DESC ScreenDesc[] =
@ -534,6 +541,8 @@ GB_DESC ScreenDesc[] =
GB_PROPERTY_READ("ResolutionX", "f", Screen_ResolutionX),
GB_PROPERTY_READ("ResolutionY", "f", Screen_ResolutionY),
GB_METHOD("Screenshot", "Picture", Screen_Screenshot, "[(X)i(Y)i(Width)i(Height)i]"),
GB_END_DECLARE
};

View file

@ -3174,14 +3174,14 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
MOUSE_delta_y %= 120;
}
#else
if (ev->orientation == Qt!!Horizontal)
if (ev->orientation == Qt::Horizontal)
MOUSE_delta_x += ev->delta();
else
MOUSE_delta_y += ev->delta();
MOUSE_info.orientation = ev->orientation();
MOUSE_info.delta = ev->delta();
cancel = GB.Raise(control, EVENT_MouseWheel, 0);
if (ev->orientation == Qt!!Horizontal)
if (ev->orientation == Qt::Horizontal)
MOUSE_delta_x %= 120;
else
MOUSE_delta_y %= 120;