mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ПКМ tree
This commit is contained in:
@@ -10,7 +10,7 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::itemClicked, this, &ViewerInstructors::on_treeWidgetItemClicked);
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &ViewerInstructors::on_treeWidgetCurrentItemChanged);
|
||||
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
@@ -94,14 +94,14 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||||
connectorToServer->sendQueryBlockAuth(false);
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
|
||||
void ViewerInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
if(item == nullptr)
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
//if(current->childCount() == 0)
|
||||
{//Выбран обучаемый
|
||||
QString login = item->text(ColumnsTreeUsers::clmn_Login);
|
||||
QString login = current->text(ColumnsTreeUsers::clmn_Login);
|
||||
//if(login != "")
|
||||
{
|
||||
int newCurrentID = connectorToServer->getIdInstructorByLogin(login);
|
||||
@@ -118,11 +118,11 @@ void ViewerInstructors::on_treeWidgetItemClicked(QTreeWidgetItem *item, int colu
|
||||
{
|
||||
for (int i = 0; i < ColumnsTreeUsers::clmn_count; i++)
|
||||
{
|
||||
item->setBackground(i, QBrush(Qt::GlobalColor::white));
|
||||
current->setBackground(i, QBrush(Qt::GlobalColor::white));
|
||||
}
|
||||
mapNewMsg.take(newCurrentID);
|
||||
item->setIcon(ColumnsTreeUsers::clmn_Messages, QIcon());
|
||||
item->setText(ColumnsTreeUsers::clmn_Messages, "");
|
||||
current->setIcon(ColumnsTreeUsers::clmn_Messages, QIcon());
|
||||
current->setText(ColumnsTreeUsers::clmn_Messages, "");
|
||||
}
|
||||
}
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
@@ -32,7 +32,7 @@ public slots:
|
||||
public Q_SLOTS:
|
||||
void on_btnEditorInstructors_clicked();
|
||||
|
||||
void on_treeWidgetItemClicked(QTreeWidgetItem *item, int column);
|
||||
void on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал о выборе инструктора
|
||||
|
||||
Reference in New Issue
Block a user