How to get to a specific item in a QMessageBox? What is their objectName? I have a message box with buttons yes and no. You can set both css through a common QPushButton, but what are they called separately? Now there is such an option, it does not work
void MattyGroupBox::deleteNote() { QMessageBox MattyWTDNMsgBox; MattyWTDNMsgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); QMessageBox::StandardButton wantToDeleteNote; MattyWTDNMsgBox.button(QMessageBox::Yes)->setObjectName(QStringLiteral("yesButton")); MattyWTDNMsgBox.setStyleSheet(QStringLiteral("#yesButton {height: 53px;" "width: 53px;" "background-color: transparent;" "background-image: url(:/MattyNotes/CommonYes.png);" "background-position: center;" "background-repeat: no-repeat;" "color: transparent; " "font-weight: bold;" "font-style: italic; }")); //MattyWTDNMsgBox.button(QMessageBox::No)->setStyleSheet(QStringLiteral()); wantToDeleteNote = MattyWTDNMsgBox.question(this, QString::fromLocal8Bit("Удаление заметки"), QString::fromLocal8Bit("Вы точно хотите удалить" " эту заметку?")); if (wantToDeleteNote == QMessageBox::Yes) { DbManager::deleteNote(ThisGroupBoxNote.getNoteId()); this->hide(); this->~MattyGroupBox(); } }
QMessageBox. - alexis031182 2:55WTDNMsgBox.setStyleSheet(QStringLiteral("#yesButton {height: 53px;"}));? Tried, also does not work - MattyWTDNMsgBox.setStyleSheet(QStringLiteral("QPushButton#yesButton {height: 53px;}"));or soWTDNMsgBox.setStyleSheet(QStringLiteral("QAbstractButton#yesButton {height: 53px;}"));or even soWTDNMsgBox.button(QMessageBox::Yes)->setStyleSheet(QStringLiteral("height: 53px;"));- alexis031182WTDNMsgBox.button(QMessageBox::Yes)->setStyleSheet(QStringLiteral("height: 53px;"));By the way, it doesn’t fit for the reason that I’ll even need to: prescribe hover. Yes, the bracket is only here that got in the wrong place, I just removed a large piece of css for example - Matty