Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardSizeWidget Class Reference

A widget for adjusting card sizes using a slider. More...

#include <card_size_widget.h>

Inheritance diagram for CardSizeWidget:
[legend]
Collaboration diagram for CardSizeWidget:
[legend]

Signals

void cardSizeSettingUpdated (int newValue)

Public Member Functions

 CardSizeWidget (QWidget *parent, FlowWidget *flowWidget=nullptr, int defaultValue=100)
QSlider * getSlider () const
 Gets the slider widget used for adjusting the card size.

Private Slots

void updateCardSizeSetting (int newValue)
 Updates the card size setting in the application's cache.

Private Attributes

QWidget * parent
FlowWidgetflowWidget
QHBoxLayout * cardSizeLayout
QLabel * cardSizeLabel
QSlider * cardSizeSlider
QTimer debounceTimer
int pendingValue

Detailed Description

A widget for adjusting card sizes using a slider.

This widget allows users to dynamically change the card size in a linked FlowWidget and updates the application's settings accordingly.

Constructor & Destructor Documentation

◆ CardSizeWidget()

CardSizeWidget::CardSizeWidget ( QWidget * parent,
FlowWidget * flowWidget = nullptr,
int defaultValue = 100 )
explicit

< Slider range for card size adjustment.

< Initial slider value.

Here is the call graph for this function:

Member Function Documentation

◆ cardSizeSettingUpdated

void CardSizeWidget::cardSizeSettingUpdated ( int newValue)
signal

Emitted when the slider value changes, but on a debounce timer. Any parents that care about saving the value to settings should use this signal to indicate when to save the new value to settings.

Here is the caller graph for this function:

◆ getSlider()

QSlider * CardSizeWidget::getSlider ( ) const
nodiscard

Gets the slider widget used for adjusting the card size.

Returns
A pointer to the QSlider object.
Here is the caller graph for this function:

◆ updateCardSizeSetting

void CardSizeWidget::updateCardSizeSetting ( int newValue)
privateslot

Updates the card size setting in the application's cache.

Parameters
newValueThe new card size value set by the slider.
Here is the caller graph for this function:

Member Data Documentation

◆ cardSizeLabel

QLabel* CardSizeWidget::cardSizeLabel
private

◆ cardSizeLayout

QHBoxLayout* CardSizeWidget::cardSizeLayout
private

◆ cardSizeSlider

QSlider* CardSizeWidget::cardSizeSlider
private

◆ debounceTimer

QTimer CardSizeWidget::debounceTimer
private

◆ flowWidget

FlowWidget* CardSizeWidget::flowWidget
private

◆ parent

QWidget* CardSizeWidget::parent
private

◆ pendingValue

int CardSizeWidget::pendingValue
private

The documentation for this class was generated from the following files: