79166269

Date: 2024-11-07 11:42:17
Score: 1
Natty:
Report link

With the help of @musicamante I found a solution and I answer my own question

I replace this code

// Defintion Bouton
userButton->setText("Select this User");
userButton->setStyleSheet("background-color: #dfdfdf; border: 1px solid #333333");
userButton->setMaximumWidth(110);

by this code (to define the button width with CSS)

// Defintion Bouton
userButton->setText("Select this User");
userButton->setStyleSheet("background-color: #dfdfdf; border: 1px solid #333333; width: 110px");

I replace this code

// Add Widgets at Button Group
buttonLayout->addWidget(userButton,Qt::AlignCenter);

by this code (using correctly addWidget and strech parameter)

// Add Widgets at Button Group
buttonLayout->addWidget(userButton,0,Qt::AlignCenter);

And like @musicamante says, I delete this code

buttonGroup->setAlignment(Qt::AlignCenter);

Hope this question and solution can help

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @musicamante
  • User mentioned (0): @musicamante
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Juan