File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 3030extern "C" {
3131 #include "utils/Settings.h"
3232}
33- extern QPushButton * * penButtons ;
33+ extern QMap < qint64 , QPushButton * > penButtons ;
3434
3535extern DrawingWidget * drawing ;
3636extern FloatingWidget * floatingWidget ;
@@ -60,8 +60,6 @@ extern int getPen();
6060extern void setPenStyle (int style );
6161extern void setLineStyle (int style );
6262
63- extern QPushButton * * penButtons ;
64-
6563extern QPushButton * typeButton ;
6664
6765extern OverView * ov ;
Original file line number Diff line number Diff line change 11#include " ../tools.h"
22
3- QPushButton ** penButtons;
3+ QMap<qint64, QPushButton*> penButtons;
44
55QPushButton *penSwitch;
66
@@ -65,8 +65,6 @@ void setLineStyle(int style){
6565}
6666
6767void setupPenType (){
68- penButtons = (QPushButton**)calloc (1024 , sizeof (QPushButton*));
69-
7068 penButtons[PEN] = create_button (" :images/pen.svg" , [=](){
7169 setPen (PEN);
7270 });
Original file line number Diff line number Diff line change @@ -44,11 +44,8 @@ void updateGoBackButtons(){
4444}
4545
4646void backgroundStyleEvent (){
47- for (int i=0 ; i<1024 ; i++){
48- if (penButtons[i] != nullptr ){
49- // printf("%d\n", i);
50- penButtons[i]->setStyleSheet (QString (" background-color: none;" ));
51- }
47+ for (auto it = penButtons.begin (); it != penButtons.end (); ++it) {
48+ it.value ()->setStyleSheet (QString (" background-color: none;" ));
5249 }
5350 int btns[] = {
5451 getPen (), drawing->getLineStyle (),
You can’t perform that action at this time.
0 commit comments