代码拉取完成,页面将自动刷新
同步操作将从 ZzqiZQute/BPNNDemoQt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "classifiercontroller.h"
#include "classifierselector.h"
#include "ui_classifiercontroller.h"
#include <QDebug>
ClassifierController::ClassifierController(QWidget *parent) :
QWidget(parent),
ui(new Ui::ClassifierController)
{
ui->setupUi(this);
connect(ui->btnAddClass,SIGNAL(clicked()),this,SLOT(onBtnAddClassClicked()));
connect(ui->btnRemoveClass,SIGNAL(clicked()),this,SLOT(onBtnRemoveClassClicked()));
connect(ui->listWidget,SIGNAL(colorChanged(int,QRgb)),this,SLOT(onColorChanged(int,QRgb)));
for(int i=0;i<mCnt;i++)
{
ui->listWidget->addItemByNum(i);
}
}
ClassifierController::~ClassifierController()
{
delete ui;
}
int ClassifierController::getClassifierNum()
{
return ui->listWidget->currentRow();
}
QColor ClassifierController::getClassifierColor(int type)
{
return ui->listWidget->getItem(type)->color();
}
int ClassifierController::getClassifierCnt()
{
return ui->listWidget->count();
}
void ClassifierController::setAddDelButtonEnabled(bool b)
{
ui->btnAddClass->setEnabled(b);
ui->btnRemoveClass->setEnabled(b);
}
void ClassifierController::setCurrentClassNum(int i)
{
ui->listWidget->setCurrentRow(i);
}
void ClassifierController::setClassifierNum(int i)
{
int c=mCnt;
if (i<c){
while(i++<c){
onBtnRemoveClassClicked();
}
}else{
while(i-->c){
onBtnAddClassClicked();
}
}
}
void ClassifierController::onBtnAddClassClicked()
{
if(mCnt<6)
{
ui->listWidget->addItemByNum(mCnt);
mCnt++;
}
}
void ClassifierController::onBtnRemoveClassClicked()
{
if(mCnt>2)
{
ui->listWidget->removeItem();
mCnt--;
emit(classCntChanged(mCnt));
}
}
void ClassifierController::onColorChanged(int i , QRgb color)
{
emit colorChanged(i,color);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。