Пример #1
0
//------------------------------------------------------------------------------
// Setup common to all constructors
//
void QEGenericEdit::setup()
{

    // Set up data
    // This control used a single data source
    setNumVariables( 1 );

    // Set variable index used to select write access cursor style.
    setControlPV( 0 );

    // Set up default properties
    writeOnLoseFocus = false;
    writeOnEnter = true;
    writeOnFinish = true;
    confirmWrite = false;
    isFirstUpdate = false;

    setAllowDrop( false );

    // Set the initial state
    isConnected = false;
    messageDialogPresent = false;
    writeFailMessageDialogPresent = false;

    // Use standard context menu
    setupContextMenu();

    // Use line edit signals
    QObject::connect( this, SIGNAL( returnPressed     () ),
                      this, SLOT  ( userReturnPressed () ) );
    QObject::connect( this, SIGNAL( editingFinished     () ),
                      this, SLOT  ( userEditingFinished () ) );

    // Set up a connection to recieve variable name property changes
    // The variable name property manager class only delivers an updated
    // variable name after the user has stopped typing.
    //
    QObject::connect( &variableNamePropertyManager,
                      SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ),
                      this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int) ) );

}
Пример #2
0
/*!
    Setup common to all constructors
*/
void QCaLineEdit::setup() {
    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Set up default properties
    writeOnLoseFocus = false;
    writeOnEnter = true;
    localEnabled = true;
    confirmWrite = false;

    // Set the initial state
    setText( "" );
    lastSeverity = QCaAlarmInfo::getInvalidSeverity();
    isConnected = false;
    QWidget::setEnabled( false );  // Reflects initial disconnected state

    // Use line edit signals
    QObject::connect( this, SIGNAL( returnPressed() ), this, SLOT( userReturnPressed() ) );
    QObject::connect( this, SIGNAL( editingFinished() ), this, SLOT( userEditingFinished() ) );
}