|
48 | 48 | #include "DmsErrorWindow.h" |
49 | 49 | #include "DmsAddressBar.h" |
50 | 50 | #include "StatisticsBrowser.h" |
| 51 | +#include "UpdatableBrowser.h" |
51 | 52 |
|
52 | 53 | #include "StateChangeNotification.h" |
53 | 54 | #include "stg/AbstrStorageManager.h" |
@@ -1855,6 +1856,38 @@ void MainWindow::expandRecursiveFromCurrentItem() { |
1855 | 1856 | } |
1856 | 1857 |
|
1857 | 1858 | void MainWindow::findTreeItem() { |
| 1859 | + // Check if focus is on a widget that has its own find functionality |
| 1860 | + auto focusWidget = QApplication::focusWidget(); |
| 1861 | + |
| 1862 | + // Don't open tree item search if detail pages, statistics, or value info has focus |
| 1863 | + // (they have their own Ctrl+F handlers) |
| 1864 | + if (focusWidget) |
| 1865 | + { |
| 1866 | + // Check if the focus widget is or is a child of a widget with its own find handler |
| 1867 | + auto parent = focusWidget; |
| 1868 | + while (parent) |
| 1869 | + { |
| 1870 | + auto helperWindowType = parent->property("DmsHelperWindowType").value<QVariant>().toInt(); |
| 1871 | + if (helperWindowType == DmsHelperWindowType::HW_DETAILPAGES |
| 1872 | + || helperWindowType == DmsHelperWindowType::HW_STATISTICS |
| 1873 | + || helperWindowType == DmsHelperWindowType::HW_VALUEINFO) |
| 1874 | + { |
| 1875 | + // Let the widget handle Ctrl+F itself |
| 1876 | + return; |
| 1877 | + } |
| 1878 | + |
| 1879 | + // Check if it's a DataView (table view, map view, etc.) |
| 1880 | + if (dynamic_cast<QDmsViewArea*>(parent)) |
| 1881 | + { |
| 1882 | + // DataView might have its own find functionality |
| 1883 | + return; |
| 1884 | + } |
| 1885 | + |
| 1886 | + parent = parent->parentWidget(); |
| 1887 | + } |
| 1888 | + } |
| 1889 | + |
| 1890 | + // Focus is on treeview, address bar, or main window - open tree item search |
1858 | 1891 | if (!m_treeview->find_window) |
1859 | 1892 | { |
1860 | 1893 | m_treeview->find_window = new FindTextWindow(m_treeview); |
|
0 commit comments