void RDGpio::inputTimerData() { unsigned input_mask; unsigned output_mask; unsigned mask; if((input_mask=inputMask())!=gpio_input_mask) { for(int i=0;i<inputs();i++) { mask=1<<i; if((gpio_input_mask&mask)!=(input_mask&mask)) { if((input_mask&mask)==0) { emit inputChanged(i,false); } else { emit inputChanged(i,true); } } } gpio_input_mask=input_mask; } if((output_mask=outputMask())!=gpio_output_mask) { for(int i=0;i<outputs();i++) { mask=1<<i; if((gpio_output_mask&mask)!=(output_mask&mask)) { if((output_mask&mask)==0) { emit outputChanged(i,false); } else { emit outputChanged(i,true); } } } gpio_output_mask=output_mask; } }
bool RDGpio::inputState(int line) { if(!gpio_open) { return false; } if((inputMask()&(1<<line))==0) { return false; } return true; }
void K3b::MsfEdit::setMaximum( const Msf& max ) { d->maximum = max; if( d->value > d->maximum ) d->value = d->maximum; if( d->minimum > d->maximum ) d->minimum = d->maximum; // Compute number of allowed positions for given maximum d->minutesWidth = static_cast<int>( std::log10( static_cast<float>( d->maximum.minutes() ) ) ) + 1; QString inputMask( ":99:99" ); for( int i = 0; i < d->minutesWidth; ++i ) inputMask.prepend( '9' ); lineEdit()->setInputMask( inputMask ); }
int QLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 21) qt_static_metacall(this, _c, _id, _a); _id -= 21; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = inputMask(); break; case 1: *reinterpret_cast< QString*>(_v) = text(); break; case 2: *reinterpret_cast< int*>(_v) = maxLength(); break; case 3: *reinterpret_cast< bool*>(_v) = hasFrame(); break; case 4: *reinterpret_cast< EchoMode*>(_v) = echoMode(); break; case 5: *reinterpret_cast< QString*>(_v) = displayText(); break; case 6: *reinterpret_cast< int*>(_v) = cursorPosition(); break; case 7: *reinterpret_cast< Qt::Alignment*>(_v) = alignment(); break; case 8: *reinterpret_cast< bool*>(_v) = isModified(); break; case 9: *reinterpret_cast< bool*>(_v) = hasSelectedText(); break; case 10: *reinterpret_cast< QString*>(_v) = selectedText(); break; case 11: *reinterpret_cast< bool*>(_v) = dragEnabled(); break; case 12: *reinterpret_cast< bool*>(_v) = isReadOnly(); break; case 13: *reinterpret_cast< bool*>(_v) = isUndoAvailable(); break; case 14: *reinterpret_cast< bool*>(_v) = isRedoAvailable(); break; case 15: *reinterpret_cast< bool*>(_v) = hasAcceptableInput(); break; case 16: *reinterpret_cast< QString*>(_v) = placeholderText(); break; case 17: *reinterpret_cast< Qt::CursorMoveStyle*>(_v) = cursorMoveStyle(); break; } _id -= 18; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setInputMask(*reinterpret_cast< QString*>(_v)); break; case 1: setText(*reinterpret_cast< QString*>(_v)); break; case 2: setMaxLength(*reinterpret_cast< int*>(_v)); break; case 3: setFrame(*reinterpret_cast< bool*>(_v)); break; case 4: setEchoMode(*reinterpret_cast< EchoMode*>(_v)); break; case 6: setCursorPosition(*reinterpret_cast< int*>(_v)); break; case 7: setAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break; case 8: setModified(*reinterpret_cast< bool*>(_v)); break; case 11: setDragEnabled(*reinterpret_cast< bool*>(_v)); break; case 12: setReadOnly(*reinterpret_cast< bool*>(_v)); break; case 16: setPlaceholderText(*reinterpret_cast< QString*>(_v)); break; case 17: setCursorMoveStyle(*reinterpret_cast< Qt::CursorMoveStyle*>(_v)); break; } _id -= 18; } else if (_c == QMetaObject::ResetProperty) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 18; } #endif // QT_NO_PROPERTIES return _id; }