mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Из ГУИ чат с инструкторами
This commit is contained in:
@@ -9,9 +9,11 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &ViewerInstructors::on_treeWidget_currentItemChanged);
|
||||
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
treeWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
//treeWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
||||
preparationTreeWidget();
|
||||
setNotLoggedInVisible(true);
|
||||
@@ -69,6 +71,28 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||||
Q_EMIT signal_BlockAutorization(false);
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
//if(current->childCount() == 0)
|
||||
{//Выбран обучаемый
|
||||
QString login = current->text(ColumnsTreeInsructors::clmn_Login);
|
||||
//if(login != "")
|
||||
{
|
||||
int newCurrentID = connectorToServer->getIdInstructorByLogin(login);
|
||||
|
||||
if(newCurrentID == lastCurrentID)
|
||||
return;
|
||||
|
||||
lastCurrentID = newCurrentID;
|
||||
|
||||
Q_EMIT signal_instructorSelected(login);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerInstructors::updateButtons()
|
||||
{
|
||||
if(adminMode && authComplited)
|
||||
|
||||
@@ -32,6 +32,13 @@ Q_SIGNALS:
|
||||
public Q_SLOTS:
|
||||
void on_btnEditorInstructors_clicked();
|
||||
|
||||
public slots:
|
||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал о выборе инструктора
|
||||
void signal_instructorSelected(QString login);
|
||||
|
||||
private:
|
||||
void updateButtons() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user