void MainWindow::on_button_update_clicked() { ui->stack_widget->setCurrentIndex(6); ui->button_update->setStyleSheet("QPushButton { color: white;}"); selectedIndex = 6; setButtonClicked(selectedIndex); }
void MainWindow::on_button_discover_clicked() { ui->stack_widget->setCurrentIndex(5); ui->button_discover->setStyleSheet("QPushButton { color: white;}"); selectedIndex = 5; setButtonClicked(selectedIndex); }
void MainWindow::on_button_removefrom_database_clicked() { ui->stack_widget->setCurrentIndex(4); ui->button_removefrom_database->setStyleSheet("QPushButton { color: white;}"); selectedIndex = 4; setButtonClicked(selectedIndex); }
Dialog::Dialog(QWidget *parent) : QDialog(parent) { /*界面初始化*/ globalData = GlobalData::getGlobalData();//初始化数据,防止多线程危险(暂时方法) // fingergather = new Finger_Gather; // QFont font; interfaceInit(); int a = 0; for(; a<10;a++){ qDebug() << "test *****777777777************"; } // picture_send_test *test = new picture_send_test(); // test->start(); //paintInit(); /*定义定时器,定时刷新显示*/ //QTimer *timer1 = new QTimer(this); // DataProcess *dataProcess = new DataProcess(this); //数据采集与处理线程 //dataProcess->start(); // GprsConnect *gprs_start = GprsConnect::Instance(); //gprs_start->start(); // VoicePlay *voicePlay = new VoicePlay(this); //语音播放处理线程 // voicePlay->start(); /*2014.03.02 先关闭zigbee配置功能*/ //ZigbeeReceive *zigbeeReceive = new ZigbeeReceive(this); //zigbeeReceive->start(); // DataGather *datagather = new DataGather; // datagather->start(); // voicePlay.start(); //QTimer *timer2 = new QTimer(this); //connect(dataProcess,SIGNAL(paintSignal()),this,SLOT(timer1UpDate()),Qt::DirectConnection);//定时器1做图像更新 //connect(timer1,SIGNAL(timeout()),this,SLOT(timer1UpDate()));//定时器1做图像更新 //connect(timer2,SIGNAL(timeout()),this,SLOT(timer2UpDate())); //timer1->start(500);//100毫秒定时 connect(setButton , SIGNAL( clicked() ) , this , SLOT(setButtonClicked())); connect(ChangeTab , SIGNAL( clicked() ),this,SLOT(ChangeTabButtonClicked())); // connect(fingerButton , SIGNAL( clicked() ) , fingergather , SLOT(finger_data_process()),Qt::DirectConnection); connect(fingerButton , SIGNAL( clicked() ) , this,SLOT(fingerButtonClicked())); /*2014.03.02 先关闭SerialSendData功能*/ //2014.01.16 //qDebug()<<"angle"<<globalData->craneList.at(0).angle; // SerialSendData *serialSendData = new SerialSendData();//串口发送线程实例化 //serialSendData->start(); /*2014.03.02 先关闭zigbee配置功能*/ // connect(zigbeeReceive,SIGNAL(reqest_Info(quint8,quint32)),serialSendData,SLOT(sendInfo_afterRequest(quint8,quint32))); // connect(zigbeeReceive,SIGNAL(transimit_Info(quint8,quint32,quint32)),serialSendData,SLOT(storeInfo_afterRecv(quint8,quint32,quint32))); // connect(zigbeeReceive,SIGNAL(resetDevice()),serialSendData,SLOT(ResetDevice()));//重启设备 //////////////////////// }
void MainWindow::on_button_view_database_clicked() { qDebug()<<"should change"; ui->stack_widget->setCurrentIndex(1); ui->button_view_database->setStyleSheet("QPushButton { color: white;}"); selectedIndex = 1; setButtonClicked(selectedIndex); }
void KbLayoutWidget::initConnect() { const int count = m_layoutButtons.length(); for (int i = 0; i != count; ++i) { connect(m_layoutButtons.at(i), SIGNAL(clicked(bool)), m_layoutButtons.at(i), SLOT(OnlyMeChecked(bool))); connect(m_layoutButtons.at(i), SIGNAL(onlyOneChecked(QString)), this, SLOT(setButtonsChecked(QString))); connect(m_layoutButtons.at(i), SIGNAL(onlyOneChecked(QString)), this, SIGNAL(setButtonClicked(QString))); } }
void KbLayoutWidget::setButtonsChecked(QString text) { qDebug() << "XsetButtonsChecked:" << text; for (int i = 0; i < m_layoutButtons.length(); i++) { if (m_layoutButtons.at(i)->m_text != text) { m_layoutButtons.at(i)->setButtonChecked(false); } else { m_layoutButtons.at(i)->setButtonChecked(true); } } emit setButtonClicked(text); }
int Dialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: timer1UpDate(); break; case 1: timer2UpDate(); break; case 2: setButtonClicked(); break; case 3: ChangeTabButtonClicked(); break; case 4: ChangeCamButtonClicked(); break; case 5: fingerButtonClicked(); break; default: ; } _id -= 6; } return _id; }