sure .. jthomps
widget.h:
#ifndef WIDGET_H
#define WIDGET_H
#include<QtGui>
#include <QWidget>
namespace Ui {
class Widget;
}
{
Q_OBJECT
public:
qint32 checklocalseconds;
qint32 checkremoteseconds;
}
#ifndef WIDGET_H
#define WIDGET_H
#include<QtGui>
#include <QWidget>
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
qint32 checklocalseconds;
qint32 checkremoteseconds;
}
To copy to clipboard, switch view to plain text mode
widget.cpp:
#include "widget.h"
#include "ui_widget.h"
#include<QtGui>
ui(new Ui::Widget)
{
}
void Widget::readconfigfile()
{
dir.cd(configpath);
QString configfile
="DI_config.txt";
//this file contains 60000,10000 file1.setFileName(dir.absoluteFilePath(configfile));
checkremoteseconds=stream.readLine().toInt();//reading 60000
checklocalseconds=stream.readLine().toInt();//reading 10000
}
void Widget::timekeeper(checkseconds)//this check seconds contain checkremoteseconds or cj=hecklocalseconds based on seconds
{
connect(t,SIGNAL(timeout()),this,SLOT(display()));
t->start(y);
}
#include "widget.h"
#include "ui_widget.h"
#include<QtGui>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
}
void Widget::readconfigfile()
{
dir.cd(configpath);
QFile file1;
QString configfile="DI_config.txt";//this file contains 60000,10000
file1.setFileName(dir.absoluteFilePath(configfile));
file1.open(QIODevice::ReadOnly);
QTextStream stream(&file1);
checkremoteseconds=stream.readLine().toInt();//reading 60000
checklocalseconds=stream.readLine().toInt();//reading 10000
}
void Widget::timekeeper(checkseconds)//this check seconds contain checkremoteseconds or cj=hecklocalseconds based on seconds
{
t=new QTimer(this);
connect(t,SIGNAL(timeout()),this,SLOT(display()));
t->start(y);
}
To copy to clipboard, switch view to plain text mode
Originally Posted by
jthomps
You make it really hard for people to help you...
Please post your widget.h and the file (widget.cpp?) where you read from the text file and assign your checkremoteseconds variable.
Also, what is the value of checkremoteseconds after you execute the line:
checkremoteseconds=stream.readLine().toInt();
checkremoteseconds=stream.readLine().toInt();
To copy to clipboard, switch view to plain text mode
Bookmarks