Ich habe einen Eingabedialog mit Combo-Box, um zwischen 2 Optionen zu wählen.So entfernen Sie alle Schaltflächen von QInputDialog
void MainWindow::on_UpdateCPUAssmblyBtn_clicked()
{
if(!ui->AssemblyCpuSN->toPlainText().toStdString().empty())
{
QStringList items;
items << tr("OUT_FOR_PCB_REPAIR") << tr("PCB_SCRAPPED");
bool ok;
std::string scrapcode="";
QInputDialog* inputDialog = new QInputDialog();
inputDialog->setOption(QInputDialog::NoButtons);
QString item = inputDialog->getItem(NULL ,"Manufacturing Stage",
"Please select the reason for removing the old board :", items, 0,false,
&ok);
if(ok && !item.isEmpty())
scrapcode=item.toStdString();
/* Do something with scrapcode */
}
else
{
QPixmap pix("icons/angry1.png");
mbox->setIconPixmap(pix);
mbox->setWindowTitle("ERROR");
mbox->setText("Disassociation is not successful.CPU SN is empty.");
mbox->show();
}
}
Wie Schaltflächen aus QInputDialog entfernen? Ich benutze "NoButtons" -Flag, aber es hilft immer noch nicht. Empfehlen Sie bitte einen anderen Ansatz.
Vielen Dank !! – Minion