qavrg 0.0.28
Public Slots | Signals | Public Member Functions | Private Attributes
QavrgTestProxy Class Reference

#include <qavrgtestwindow.h>

List of all members.

Public Slots

void valueChanged (int value, qint64 id)
void spinBoxChanged (int value)

Signals

void changeSpinBox (int value)
void changeInteger (int value, qint64 id)

Public Member Functions

 QavrgTestProxy (int useProxy, int useTransaction, QavrgTestInteger *integer, QSpinBox *spinBox, QObject *parent=0)

Private Attributes

QMutex m_Mutex
int m_UseProxy
int m_UseTransaction
int m_Value
QavrgTestIntegerm_Integer
QSpinBox * m_SpinBox
qint64 m_TransactionId

Detailed Description

Definition at line 14 of file qavrgtestwindow.h.


Constructor & Destructor Documentation

QavrgTestProxy::QavrgTestProxy ( int  useProxy,
int  useTransaction,
QavrgTestInteger integer,
QSpinBox *  spinBox,
QObject *  parent = 0 
)

Definition at line 6 of file qavrgtestwindow.cpp.

  : QObject(parent),
    m_UseProxy(useProxy),
    m_UseTransaction(useTransaction),
    m_Value(integer->get_Integer()),
    m_Integer(integer),
    m_SpinBox(spinBox),
    m_TransactionId(0)
{
}

Member Function Documentation

void QavrgTestProxy::changeInteger ( int  value,
qint64  id 
) [signal]

Referenced by spinBoxChanged().

void QavrgTestProxy::changeSpinBox ( int  value) [signal]

Referenced by valueChanged().

void QavrgTestProxy::spinBoxChanged ( int  value) [slot]

Definition at line 40 of file qavrgtestwindow.cpp.

References changeInteger(), m_TransactionId, and m_Value.

{
  printf("QavrgTestProxy::spinBoxChanged(%d)\n", value);

  if (value != m_Value) {
    m_Value = value;

    printf("emit changeInteger(%d, %ld)\n", m_Value, (long int) m_TransactionId);

    emit changeInteger(m_Value, m_TransactionId++);
  }
}
void QavrgTestProxy::valueChanged ( int  value,
qint64  id 
) [slot]

Definition at line 17 of file qavrgtestwindow.cpp.

References changeSpinBox(), m_TransactionId, m_UseTransaction, and m_Value.

{
  printf("QavrgTestProxy::valueChanged(%d,%ld)\n", value, (long int) id);

  if (value != m_Value) {
    m_Value = value;

    if (m_UseTransaction) {
      if (id > m_TransactionId) {
        m_TransactionId = id;

        printf("emit changeSpinBox(%d)\n", m_Value);

        emit changeSpinBox(value);
      } else {
        printf("emission skipped because %ld <= %ld\n", (long int) id, (long int) m_TransactionId);
      }
    } else {
      emit changeSpinBox(value);
    }
  }
}

Member Data Documentation

Definition at line 34 of file qavrgtestwindow.h.

QMutex QavrgTestProxy::m_Mutex [mutable, private]

Definition at line 30 of file qavrgtestwindow.h.

QSpinBox* QavrgTestProxy::m_SpinBox [private]

Definition at line 35 of file qavrgtestwindow.h.

Definition at line 36 of file qavrgtestwindow.h.

Referenced by spinBoxChanged(), and valueChanged().

Definition at line 31 of file qavrgtestwindow.h.

Definition at line 32 of file qavrgtestwindow.h.

Referenced by valueChanged().

int QavrgTestProxy::m_Value [private]

Definition at line 33 of file qavrgtestwindow.h.

Referenced by spinBoxChanged(), and valueChanged().


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