Stellarium  26.1
Public Slots | Public Member Functions | Protected Member Functions
ScmAdvancedSpinBox Class Reference

Customized SpinBox that allows for 'better' input (not blocking input when its greater than limit), displays special characters for min / max / arbitrary values and set additional custom min / max. More...

#include <ScmAdvancedSpinBox.hpp>

Public Slots

void setMinimum (int min)
 
void setMaximum (int max)
 

Public Member Functions

 ScmAdvancedSpinBox (QWidget *parent=nullptr)
 
void fixup (QString &input) const override
 
QValidator::State validate (QString &text, int &pos) const override
 
void setDisplayCustomStringForValue (bool display)
 
void addCustomStringForValue (int value, QString text)
 Add a custom string that will be displayed where the SpinBox would normally display a specific (int) value. More...
 
void removeCustomStringForValue (int value)
 Remove a string from the given value. More...
 
void setCustomStringForMin (QString text)
 Convenience function to add a custom string to the current minimum. More...
 
void setCustomStringForMax (QString text)
 Convenience function to add a custom string to the current maximum. More...
 
void setUseCustomMinimum (bool useCustomMin)
 
void setUseCustomMaximum (bool useCustomMax)
 
void setCustomMinimum (int min)
 
void setCustomMaximum (int max)
 

Protected Member Functions

QString textFromValue (int value) const override
 

Detailed Description

Customized SpinBox that allows for 'better' input (not blocking input when its greater than limit), displays special characters for min / max / arbitrary values and set additional custom min / max.

Member Function Documentation

◆ addCustomStringForValue()

void ScmAdvancedSpinBox::addCustomStringForValue ( int  value,
QString  text 
)

Add a custom string that will be displayed where the SpinBox would normally display a specific (int) value.

Parameters
valueValue at which the string should be displayed.
textString that should be displayed.

◆ removeCustomStringForValue()

void ScmAdvancedSpinBox::removeCustomStringForValue ( int  value)

Remove a string from the given value.

Parameters
valueValue at which the custom string should be removed.

◆ setCustomStringForMax()

void ScmAdvancedSpinBox::setCustomStringForMax ( QString  text)

Convenience function to add a custom string to the current maximum.

Parameters
testString that should be displayed at the current max.

◆ setCustomStringForMin()

void ScmAdvancedSpinBox::setCustomStringForMin ( QString  text)

Convenience function to add a custom string to the current minimum.

Parameters
testString that should be displayed at the current min.