SHDigitDate::SHDigitDate(QWidget *parent)
	:QLCDNumber(parent)
{
	setDigitCount(10);

	m_timer = new QTimer(this);
	QObject::connect(m_timer, SIGNAL(timeout()), this, SLOT(displayDate()));
	m_timer->start(1000);
}
Beispiel #2
0
Des::Des(uint numDigits , QWidget *parent) :
    QLCDNumber(numDigits , parent)
{
    setSegmentStyle(QLCDNumber::Flat);
    setDigitCount(1);

    timer = new QTimer (this);
    timer->setInterval (10);
    timer->start();
    QObject::connect (timer , SIGNAL (timeout() ) , this , SLOT (refresh()));
}
Beispiel #3
0
int QLCDNumber::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 9)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 9;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = smallDecimalPoint(); break;
        case 1: *reinterpret_cast< int*>(_v) = numDigits(); break;
        case 2: *reinterpret_cast< int*>(_v) = digitCount(); break;
        case 3: *reinterpret_cast< Mode*>(_v) = mode(); break;
        case 4: *reinterpret_cast< SegmentStyle*>(_v) = segmentStyle(); break;
        case 5: *reinterpret_cast< double*>(_v) = value(); break;
        case 6: *reinterpret_cast< int*>(_v) = intValue(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setSmallDecimalPoint(*reinterpret_cast< bool*>(_v)); break;
        case 1: setNumDigits(*reinterpret_cast< int*>(_v)); break;
        case 2: setDigitCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setMode(*reinterpret_cast< Mode*>(_v)); break;
        case 4: setSegmentStyle(*reinterpret_cast< SegmentStyle*>(_v)); break;
        case 5: display(*reinterpret_cast< double*>(_v)); break;
        case 6: display(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #4
0
void NumericGauge::setValue( double pValue )
{
	QString str;
	if ( mode() == QLCDNumber::Hex )
		str = QString::number( qRound(pValue), 16);
	else if ( mode() == QLCDNumber::Dec )
		str = QString::number(pValue, 'f', decimals());
	else if ( mode() == QLCDNumber::Oct )
		str = QString::number( qRound(pValue), 8);
	else if ( mode() == QLCDNumber::Bin )
		str = QString::number( qRound(pValue), 2);
	
	setDigitCount( str.length() );
	display( str );
}
void QLCDNumber::setNumDigits(int numDigits)
{
    setDigitCount(numDigits);
}