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; framenum = 0;
frame = ":icons/error_a.png"; frame = ":icons/error_a.png";
animation.setInterval(300); animation = new QTimer(this);
animation.start(); 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); 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() void ErrorIcon::changeFrame()
@ -33,6 +35,6 @@ void ErrorIcon::changeFrame()
ErrorIcon::~ErrorIcon() ErrorIcon::~ErrorIcon()
{ {
animation->stop();
} }

View File

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

View File

@ -20,7 +20,7 @@ void SDWindow::on_buttonBox_accepted()
emit fileSelected(ui->fileslist->currentItem()->text()); 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()); emit fileSelected(ui->fileslist->currentItem()->text());
this->close(); this->close();

View File

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

View File

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