From 161c9b91922c886e78ae95f6822754623c36e0cc Mon Sep 17 00:00:00 2001 From: giadasan Date: Thu, 4 Jul 2024 16:48:55 +0200 Subject: [PATCH 1/2] tooltips soil table --- soilWidget/soilTable.cpp | 42 +++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/soilWidget/soilTable.cpp b/soilWidget/soilTable.cpp index 6b5c32c7..67e17091 100644 --- a/soilWidget/soilTable.cpp +++ b/soilWidget/soilTable.cpp @@ -47,13 +47,45 @@ Crit3DSoilTable::Crit3DSoilTable(tableType type) : type(type) if (type == dbTable) { - QTableWidgetItem *currentHeaderItem = this->horizontalHeaderItem(2); + QTableWidgetItem *currentHeaderItem = horizontalHeaderItem(2); if (currentHeaderItem) currentHeaderItem->setToolTip("Percentage of sand (from 2.0 to 0.05 mm)"); - //currentHeaderItem = this->horizontalHeaderItem(3); - //.. - // TODO + currentHeaderItem = horizontalHeaderItem(3); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of silt (from 0.05 to 0.002 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(4); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of clay (minor than 0.002 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(5); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of coarse fragments (major than 2.0 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(6); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of organic matter"); + + currentHeaderItem = this->horizontalHeaderItem(7); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Bulk density"); + + currentHeaderItem = this->horizontalHeaderItem(8); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Saturated hydraulic conductivity"); + + currentHeaderItem = this->horizontalHeaderItem(9); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Water content at saturation"); + + currentHeaderItem = this->horizontalHeaderItem(10); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Effective cohesion"); + + currentHeaderItem = this->horizontalHeaderItem(11); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Soil friction angle"); } else if (type == modelTable) { @@ -77,7 +109,7 @@ void Crit3DSoilTable::mouseMoveEvent(QMouseEvent *event) } else if (type == modelTable) { - QToolTip::showText(this->viewport()->mapToGlobal(pos), "wrong horizon", this, QRect(pos,QSize(100,100)), 800); + QToolTip::showText(this->viewport()->mapToGlobal(pos), "wrong horizon or missing db", this, QRect(pos,QSize(100,100)), 800); } } else if(item->background().color() == Qt::yellow) From 1deec3c5d3048e60cfaf377cba5b62de692900ea Mon Sep 17 00:00:00 2001 From: giadasan Date: Thu, 4 Jul 2024 16:48:55 +0200 Subject: [PATCH 2/2] tooltips soil table --- agrolib/soilWidget/soilTable.cpp | 42 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/agrolib/soilWidget/soilTable.cpp b/agrolib/soilWidget/soilTable.cpp index 6b5c32c7..67e17091 100644 --- a/agrolib/soilWidget/soilTable.cpp +++ b/agrolib/soilWidget/soilTable.cpp @@ -47,13 +47,45 @@ Crit3DSoilTable::Crit3DSoilTable(tableType type) : type(type) if (type == dbTable) { - QTableWidgetItem *currentHeaderItem = this->horizontalHeaderItem(2); + QTableWidgetItem *currentHeaderItem = horizontalHeaderItem(2); if (currentHeaderItem) currentHeaderItem->setToolTip("Percentage of sand (from 2.0 to 0.05 mm)"); - //currentHeaderItem = this->horizontalHeaderItem(3); - //.. - // TODO + currentHeaderItem = horizontalHeaderItem(3); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of silt (from 0.05 to 0.002 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(4); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of clay (minor than 0.002 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(5); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of coarse fragments (major than 2.0 mm)"); + + currentHeaderItem = this->horizontalHeaderItem(6); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Percentage of organic matter"); + + currentHeaderItem = this->horizontalHeaderItem(7); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Bulk density"); + + currentHeaderItem = this->horizontalHeaderItem(8); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Saturated hydraulic conductivity"); + + currentHeaderItem = this->horizontalHeaderItem(9); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Water content at saturation"); + + currentHeaderItem = this->horizontalHeaderItem(10); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Effective cohesion"); + + currentHeaderItem = this->horizontalHeaderItem(11); + if (currentHeaderItem) + currentHeaderItem->setToolTip("Soil friction angle"); } else if (type == modelTable) { @@ -77,7 +109,7 @@ void Crit3DSoilTable::mouseMoveEvent(QMouseEvent *event) } else if (type == modelTable) { - QToolTip::showText(this->viewport()->mapToGlobal(pos), "wrong horizon", this, QRect(pos,QSize(100,100)), 800); + QToolTip::showText(this->viewport()->mapToGlobal(pos), "wrong horizon or missing db", this, QRect(pos,QSize(100,100)), 800); } } else if(item->background().color() == Qt::yellow)