切换产品小更新
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
class switchProductWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
QLabel* staticLabel = new QLabel(this);
|
||||
|
||||
int currentProductIndex = 0;
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
fancyButtonText* switchBtn = new fancyButtonText(100, 60, "修改", "修改当前机型");
|
||||
@@ -13,15 +15,28 @@ public:
|
||||
QLabel* currentProduct = new QLabel(this);
|
||||
switchProductWidget()
|
||||
{
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::WindowText, Qt::white);
|
||||
QFont font("微软雅黑", 14, QFont::Bold);
|
||||
this->setLayout(layout);
|
||||
|
||||
staticLabel->setText("当前型号:");
|
||||
staticLabel->setFont(font);
|
||||
staticLabel->setPalette(palette);
|
||||
layout->addWidget(staticLabel);
|
||||
|
||||
productSelect->addItem("产品1");
|
||||
productSelect->addItem("产品2");
|
||||
productSelect->setPalette(palette);
|
||||
productSelect->setFont(font);
|
||||
|
||||
layout->addWidget(productSelect);
|
||||
productSelect->hide();
|
||||
|
||||
currentProduct->setText("产品1");
|
||||
currentProduct->setFont(font);
|
||||
currentProduct->setPalette(palette);
|
||||
|
||||
layout->addWidget(currentProduct);
|
||||
layout->addWidget(switchBtn);
|
||||
|
||||
@@ -54,6 +69,10 @@ private slots:
|
||||
void currentProductSwitch(QString input)
|
||||
{
|
||||
int index = productSelect->currentIndex();
|
||||
|
||||
currentProduct->setText(input);
|
||||
|
||||
startSwitch();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user