Beispiel #1
0
MsgBufferModel::MsgBufferModel(QObject *parent)
	:QAbstractTableModel(parent)
{
	/* Object Variables. */
	lastValue = 0;



	/* GUI Refresh. */
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(timerHit()));
	timer->start(1000);

	/* Monitor Threads. */
	QThread *threadx = new QThread;
	Monitor *monitor = new Monitor;

	connect(monitor, SIGNAL(messageInBuffer(canMessage*)), this, SLOT(newMsg(canMessage*)));
	connect(this, SIGNAL(start()), monitor, SLOT(start()));
	connect(this, SIGNAL(stop()), monitor, SLOT(stop()));
	monitor->moveToThread(threadx);
	threadx->start();

	emit start();
}
Beispiel #2
0
MyModel::MyModel(QObject *parent) :QAbstractTableModel(parent)
{
    timer = new QTimer(this);
    timer->setInterval(1000);
    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()));   
    timer->start();
    nRows = ROWS;
    m_gridData.resize(nRows);
}
Beispiel #3
0
//! [quoting mymodel_a]
MyModel::MyModel(QObject *parent)
    :QAbstractTableModel(parent)
{
//    selectedCell = 0;
    timer = new QTimer(this);
    timer->setInterval(1000);
    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()));
    timer->start();
}