addmaterialform.ui.h

来自「The purpose of this program is to enable」· C头文件 代码 · 共 59 行

H
59
字号
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you wish to add, delete or rename functions or slots use** Qt Designer which will update this file, preserving your code. Create an** init() function in place of a constructor, and a destroy() function in** place of a destructor.*****************************************************************************/void AddMaterialForm::OKSlot(){  QString name = materialNameLineEdit->text();  float eps = epsilonLineEdit->text().toFloat();  float sigma = sigmaLineEdit->text().toFloat();  QColor color(RlineEdit->text().toInt(),               GlineEdit->text().toInt(),               BlineEdit->text().toInt());  emit NewMaterial(name,eps,sigma,color);}void AddMaterialForm::CancelSlot(){  emit Cancel();}void AddMaterialForm::init(){  int R = rand()%156 + 100;  int G = rand()%156 + 100;  int B = rand()%156 + 100;  RlineEdit->setText(QString::number(R));  GlineEdit->setText(QString::number(G));  BlineEdit->setText(QString::number(B));  QColor col(R,G,B);  QPixmap pix(pixmapLabel->width(),pixmapLabel->height());  pix.fill(col);  pixmapLabel->setPixmap(pix);}void AddMaterialForm::colorSelectSlot(){  QColor color = QColorDialog::getColor();  if ((color.red() == 0)&&(color.green() == 0)&&(color.blue() == 0))    return;  RlineEdit->setText(QString::number(color.red()));  GlineEdit->setText(QString::number(color.green()));  BlineEdit->setText(QString::number(color.blue()));  QColor col(color.red(),color.green(),color.blue());  QPixmap pix(pixmapLabel->width(),pixmapLabel->height());  pix.fill(col);  pixmapLabel->setPixmap(pix);  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?