Qt Button
-
Thank you for your response.
The code I am using is as follows:
QPixmap pixmap(":/new/prefix1/icons/a.png");
if (pixmap.isNull()) {
qDebug() << "Pixmap failed to load!";
return;
}QBitmap bitmap = pixmap.createMaskFromColor(Qt::white, Qt::MaskInColor); if (bitmap.isNull()) { qDebug() << "Could not create mask!"; return; } QBitmap scaledBitmap = QBitmap::fromPixmap(bitmap.scaled(ui->nozzleLeft10mmBtn->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
ui->LeftBtn->setMask(scaledBitmap);
ui->LeftBtn->update(); -
Thank you for your response.
I have not added any specific functionality to the button. It only lags when the button is in the pressed state.
Additionally, I have another button next to it where I rotate an image, and it works smoothly. However, when I press the button with the pixmap, the image freezes.
Could you provide any suggestions to resolve this issue?
-
Thank you for your response.
Could you please clarify what exactly you are asking about? Are you referring to the context in which the code is executed, such as whether it's within a specific function, event handler, or somewhere else? I want to make sure I provide the exact information you need.
-