Skip to content

Commit 9b0ce4b

Browse files
authored
Fixing bugs (#15)
1 parent 32b7152 commit 9b0ce4b

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

gui/src/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define _CONFIG_H
2323

2424
#define PROGRAM_NAME "PICO SST39sf0x0 Programmer"
25-
#define PROGRAM_VERSION "1.5.0"
25+
#define PROGRAM_VERSION "1.5.1"
2626
#define UNUSED(x) (void)(x)
2727

2828
#endif // _CONFIG_H

gui/src/hexviewwidget.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,30 @@ HexViewWidget::HexViewWidget(QWidget *parent)
2828
: QAbstractScrollArea{parent} {
2929
}
3030

31+
/**
32+
* @brief set data for the HexView class to display
33+
* @param _data data to display
34+
*/
35+
void HexViewWidget::set_data(const QByteArray& _data) {
36+
QMutexLocker locker(&this->lock);
37+
this->data = _data;
38+
this->viewport()->update();
39+
}
40+
3141
/**
3242
* @brief Draw the contents of the HexViewer widget
3343
* @param event
3444
*/
3545
void HexViewWidget::paintEvent(QPaintEvent *event) {
36-
QMutexLocker(&this->lock);
46+
QMutexLocker locker(&this->lock);
3747

3848
this->update_positions();
3949

4050
QPainter painter(viewport());
4151
QSize area_size = viewport()->size();
4252
QSize widget_size = this->get_widget_size();
4353
this->verticalScrollBar()->setPageStep(area_size.height() / charheight);
44-
this->verticalScrollBar()->setRange(0, (widget_size.height() - area_size.height()) / charheight + 1);
54+
this->verticalScrollBar()->setRange(0, (widget_size.height() - area_size.height()) / charheight + 2);
4555

4656
// grab colors
4757
settings.sync();

gui/src/hexviewwidget.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ class HexViewWidget : public QAbstractScrollArea
7070
* @brief set data for the HexView class to display
7171
* @param _data data to display
7272
*/
73-
void set_data(const QByteArray& _data) {
74-
QMutexLocker(&this->lock);
75-
this->data = _data;
76-
this->viewport()->update();
77-
}
73+
void set_data(const QByteArray& _data);
7874

7975
/**
8076
* @brief Grab data from HexViewer class

0 commit comments

Comments
 (0)