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

#include <qavrgtestwindow.h>

List of all members.

Public Slots

void increment ()
void doubleIncrement ()
void countFive ()
void countThousand ()

Signals

void set_Integer (int value)

Public Member Functions

 QavrgTestWindow (int useProxy, int useTransaction, QWidget *parent=NULL)

Public Attributes

QSpinBox * m_SpinBox
QPushButton * m_Increment
QPushButton * m_DoubleIncrement
QPushButton * m_CountFive
QPushButton * m_CountThousand

Private Attributes

int m_UseProxy
int m_UseTransaction
QavrgTestThreadm_Thread

Detailed Description

Definition at line 83 of file qavrgtestwindow.h.


Constructor & Destructor Documentation

QavrgTestWindow::QavrgTestWindow ( int  useProxy,
int  useTransaction,
QWidget *  parent = NULL 
)

Definition at line 133 of file qavrgtestwindow.cpp.

References countFive(), countThousand(), doubleIncrement(), increment(), m_CountFive, m_CountThousand, m_DoubleIncrement, m_Increment, m_SpinBox, m_Thread, m_UseProxy, and m_UseTransaction.

  : QWidget(parent),
    m_SpinBox(NULL),
    m_Increment(NULL),
    m_DoubleIncrement(NULL),
    m_CountFive(NULL),
    m_UseProxy(useProxy),
    m_UseTransaction(useTransaction),
    m_Thread(NULL)
{
  m_Thread = new QavrgTestThread(m_UseProxy, m_UseTransaction, this, this);

  QHBoxLayout *layout = new QHBoxLayout();

  m_SpinBox = new QSpinBox();
  m_Increment = new QPushButton("I++");
  m_DoubleIncrement = new QPushButton("I++;I++");
  m_CountFive = new QPushButton("12345");
  m_CountThousand = new QPushButton("Thousand");

  m_SpinBox -> setMinimum(-1000);
  m_SpinBox -> setMaximum(99999);

  layout -> addWidget(m_SpinBox);
  layout -> addWidget(m_Increment);
  layout -> addWidget(m_DoubleIncrement);
  layout -> addWidget(m_CountFive);
  layout -> addWidget(m_CountThousand);

  setLayout(layout);

  connect(m_Increment, SIGNAL(clicked()), this, SLOT(increment()));
  connect(m_DoubleIncrement, SIGNAL(clicked()), this, SLOT(doubleIncrement()));
  connect(m_CountFive, SIGNAL(clicked()), this, SLOT(countFive()));
  connect(m_CountThousand, SIGNAL(clicked()), this, SLOT(countThousand()));

  m_Thread -> start();

  show();
}

Member Function Documentation

void QavrgTestWindow::countFive ( ) [slot]

Definition at line 192 of file qavrgtestwindow.cpp.

References m_Thread, and set_Integer().

Referenced by QavrgTestWindow().

{
  printf("QavrgTestWindow::countFive");

  m_Thread -> m_Integer -> set_Integer(1);
  m_Thread -> m_Integer -> set_Integer(2);
  m_Thread -> m_Integer -> set_Integer(3);
  m_Thread -> m_Integer -> set_Integer(4);
  m_Thread -> m_Integer -> set_Integer(5);
}
void QavrgTestWindow::countThousand ( ) [slot]

Definition at line 203 of file qavrgtestwindow.cpp.

References m_Thread, and set_Integer().

Referenced by QavrgTestWindow().

{
  for (int i=1; i<=1000; i++) {
    m_Thread -> m_Integer -> set_Integer(i);
  }
}
void QavrgTestWindow::doubleIncrement ( ) [slot]

Definition at line 184 of file qavrgtestwindow.cpp.

References increment().

Referenced by QavrgTestWindow().

{
  printf("QavrgTestWindow::doubleIncrement\n");

  increment();
  increment();
}
void QavrgTestWindow::increment ( ) [slot]

Definition at line 174 of file qavrgtestwindow.cpp.

References m_Thread, and set_Integer().

Referenced by doubleIncrement(), and QavrgTestWindow().

{
  int val = m_Thread -> m_Integer -> get_Integer();

  printf("QavrgTestWindow::increment -> %d\n", val);

  m_Thread -> m_Integer -> set_Integer(val+1);
//  emit set_Integer(val+1);
}
void QavrgTestWindow::set_Integer ( int  value) [signal]

Referenced by countFive(), countThousand(), and increment().


Member Data Documentation

Definition at line 103 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 104 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 102 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 101 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 100 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 109 of file qavrgtestwindow.h.

Referenced by countFive(), countThousand(), increment(), and QavrgTestWindow().

Definition at line 107 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().

Definition at line 108 of file qavrgtestwindow.h.

Referenced by QavrgTestWindow().


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