Files
RetroArch/samples/ui/qt_float_resync/Makefile
LibretroAdmin 7283c479ef Qt: resync float widgets against the value last pushed
A float spinbox or slider rounds a setting to its display precision,
so a stored value finer than that (slowmotion_ratio = 1.01 at one
decimal) is never what the widget reports back.  The paint-time
resync now compares the setting with the value it last pushed to the
widget, through ui_qt_float_resync(), so such a setting is pushed
once and repaints no longer redo widget work; the setting itself is
left as stored.

samples/ui/qt_float_resync drives the helper through model widgets
that round the way QDoubleSpinBox and QSlider do.

Closes #19849
2026-10-19 01:40:33 +02:00

31 lines
736 B
Makefile

# ui/drivers/ui_qt_float_sync.h against model float widgets that round
# the way the Qt spinbox and slider do: a setting finer than the
# widget's precision is pushed once, not on every repaint.
TARGET := qt_float_resync_test
SOURCES := qt_float_resync_test.c
CFLAGS += -Wall -Wextra -std=c89 -pedantic -g1 -O1
OBJS := $(SOURCES:.c=.o)
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
%.o: %.c ../../../ui/drivers/ui_qt_float_sync.h
$(CC) -c -o $@ $< $(CFLAGS)
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
check: $(TARGET)
./$(TARGET)
clean:
rm -f $(TARGET) $(TARGET).exe $(OBJS)
.PHONY: all check clean