Hallo,
I design a DAB app. Stations can be selected via pushbutton and if the right png file exists, the station logo is shown in the button(stretched to fill the button). It works but doesn't look that nice.
Auswahl_023.jpg
The code for each button looks like this (I'm sure it can be done better, but still learning ab Qt and C++...)
Qt Code:
if(dab_found_favs.size() >= 2){ ui->btn_dab_st02->setEnabled(true); bool dab_logo_exist {MainWindow::dab_logo_exists(btn_sid)}; if(dab_logo_exist == true){ ui->btn_dab_st02->setText(""); ui->btn_dab_st02->setIcon(ButtonIcon); ui->btn_dab_st02->setIconSize(pixmap.rect().size()); } else { ui->btn_dab_st02->setText(dab_vec_vec[dab_found_favs.at(1)][0]); } } else if(dab_found_favs.size() < 2){ ui->btn_dab_st02->setEnabled(false); ui->btn_dab_st02->setText("no favorite\navailable"); }To copy to clipboard, switch view to plain text mode
How can i make the corners rounded? Already tried with QPainter, but it only drew a border with rounded corners on top of the picture.
Bookmarks