QMessageBox中定位哪个按钮被按下

news/2025/2/22 22:08:14


例:

int ret=QMessageBox::information(this, tr("自定义模式"), tr("立刻切换到自定义模式: ")+ui->textEdit->toPlainText(), QMessageBox::Yes | QMessageBox::No,     QMessageBox::Yes);
    if(ret==QMessageBox::Yes)
    {
      ui->label_5->setText(tr("自定义模式"));
    }
   else
   {
     ui->label_5->setText(tr("默认模式"));

}





http://www.niftyadmin.cn/n/1736315.html

相关文章

错误:Warning: File `../table/table.pro' has modification time 3.9e+08 s in the future

错误:Warning: File ../table/table.pro has modification time 3.9e08 s in the future 这个错误多半是因为改变了系统的时间,造成文件在将来被改写,,把时间改回去,把工程里面生成的中间文件例如:table.pro.user,Mak…

清空Qtablewiget 表格的内容

今天用到了Qtablewiget 清空表格内容; 其中: void QTableWidget::clear () [slot]//清空掉表格内所有内容,包括标题头Removes all items in the view. This will also remove all selections. The table dimensions stay the same.void QTableWidget::…

十说电容经典

话说电容之一:电容的作用 作为无源元件之一的电容,其作用不外乎以下几种:1、应用于电源电路,实现旁路、去藕、滤波和储能的作用。下面分类详述之:1)旁路旁路电容是为本地器件提供能量的储能器件&#xff0c…

不同窗口之间使用信号槽

不同窗口之间的信号槽&#xff0c;由一个窗口emit signal 然后在另一个窗口中用connect 响应。 editnetconfig.h #ifndef EDITNETCONFIG_H #define EDITNETCONFIG_H#include <QDialog>namespace Ui { class EditNetConfig; }class EditNetConfig : public QDialog {Q_O…

QT 获得tableWidget中QComboBox的内容

QWidget * QTableWidget::cellWidget ( int row, int column ) constReturns the widget displayed in the cell in the given row and column.QWidget * widgetui->tableWidget->cellWidget(i,0);//获得widgetQComboBox *combox(QComboBox*)widget;//强制转化为QComboBo…

FT5406触摸屏驱动

1.首先&#xff0c;分析下FT5406的基本电路接口 [html] view plaincopyExternal Interface I2C/SPI: an interface for data exchange with host INT: an interrupt signal to inform the host processor that touch data is ready for read WAKE: an interru…

qt中关于设置颜色

一般的属于QWidget子类的一些控件&#xff0c;可以直接使用样式表&#xff0c;例如 label->setStyleSheet("color:white"); Qpalette类相当于对话框或是控件的调色板&#xff0c;它管理着控件或窗体的所有颜色信息&#xff0c;每个窗体或控件都包含一个QPalette对…

错误./hello: error while loading shared libraries: libQtGui.so.4: cannot open shared object file:

之前一直想在ARM 上跑qt&#xff0c;但都出现错误&#xff1a; ./hello: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory 这主要是ARM 上的运行环境设置不当&#xff1a; 我用的是飞凌的6410 环境变量设…