Got rid of compilation warnings

More refactoring
This commit is contained in:
NeoTheFox 2015-03-21 18:42:44 +03:00
parent 7e354a56d7
commit 2e24c28bbf
5 changed files with 17 additions and 15 deletions

View File

@ -4,16 +4,18 @@ ErrorIcon::ErrorIcon(QWidget *parent) : QWidget(parent)
{
framenum = 0;
frame = ":icons/error_a.png";
animation.setInterval(300);
animation.start();
animation = new QTimer(this);
animation->setInterval(300);
animation->start();
connect(&animation, SIGNAL(timeout()), this, SLOT(changeFrame()));
connect(animation, &QTimer::timeout, this, &ErrorIcon::changeFrame);
}
void ErrorIcon::paintEvent(QPaintEvent *pe)
void ErrorIcon::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.drawPixmap(0,0,128,87,QPixmap(frame));
QPixmap pframe(frame);
painter.drawPixmap(0,0,pframe.width(),pframe.height(),pframe);
}
void ErrorIcon::changeFrame()
@ -33,6 +35,6 @@ void ErrorIcon::changeFrame()
ErrorIcon::~ErrorIcon()
{
animation->stop();
}

View File

@ -11,12 +11,12 @@ class ErrorIcon : public QWidget
public:
explicit ErrorIcon(QWidget *parent = 0);
~ErrorIcon();
QTimer animation;
QTimer *animation;
QString frame;
int framenum;
protected:
virtual void paintEvent(QPaintEvent *pe);
virtual void paintEvent(QPaintEvent *);
signals:

View File

@ -20,7 +20,7 @@ void SDWindow::on_buttonBox_accepted()
emit fileSelected(ui->fileslist->currentItem()->text());
}
void SDWindow::on_fileslist_doubleClicked(const QModelIndex &index)
void SDWindow::on_fileslist_doubleClicked(const QModelIndex &)
{
emit fileSelected(ui->fileslist->currentItem()->text());
this->close();

View File

@ -21,7 +21,7 @@ signals:
private slots:
void on_buttonBox_accepted();
void on_fileslist_doubleClicked(const QModelIndex &index);
void on_fileslist_doubleClicked(const QModelIndex &);
private:
Ui::SDWindow *ui;

View File

@ -23,11 +23,11 @@ public:
protected:
QSerialPort *printer;
QTimer *sendTimer;
unsigned int currentLine;
unsigned int totalLineNum;
unsigned int resendNum;
unsigned int baudrate;
int flowcontrol;
long int currentLine;
long int totalLineNum;
long int resendNum;
long int baudrate;
long int flowcontrol;
bool paused;
bool sending;
bool dtr;