LCOV - code coverage report
Current view: top level - muse/framework/ui/view - widgetnavigationfix.cpp Coverage Total Hit
Test: filtered_coverage.info Lines: 0.0 % 18 0
Test Date: 2026-11-05 04:07:02

            Line data    Source code
       1              : /*
       2              :  * SPDX-License-Identifier: GPL-3.0-only
       3              :  * MuseScore-CLA-applies
       4              :  *
       5              :  * MuseScore Studio
       6              :  * Music Composition & Notation
       7              :  *
       8              :  * Copyright (C) 2021 MuseScore Limited and others
       9              :  *
      10              :  * This program is free software: you can redistribute it and/or modify
      11              :  * it under the terms of the GNU General Public License version 3 as
      12              :  * published by the Free Software Foundation.
      13              :  *
      14              :  * This program is distributed in the hope that it will be useful,
      15              :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      16              :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17              :  * GNU General Public License for more details.
      18              :  *
      19              :  * You should have received a copy of the GNU General Public License
      20              :  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
      21              :  */
      22              : 
      23              : #include "widgetnavigationfix.h"
      24              : 
      25              : #include <QWidget>
      26              : #include <QTableWidget>
      27              : 
      28              : using namespace muse::ui;
      29              : 
      30            0 : bool WidgetNavigationFix::fixNavigationForTableWidget(const WidgetNavigationFix::NavigationChain& chain, int key)
      31              : {
      32            0 :     QTableWidget* tableWidget = qobject_cast<QTableWidget*>(chain.widget);
      33              : 
      34            0 :     if (!tableWidget || !tableWidget->hasFocus()) {
      35            0 :         return false;
      36              :     }
      37              : 
      38            0 :     switch (key) {
      39            0 :     case Qt::Key_Tab: {
      40            0 :         if (!chain.nextWidget) {
      41            0 :             return false;
      42              :         }
      43              : 
      44            0 :         chain.nextWidget->setFocus();
      45            0 :         return true;
      46              :     }
      47            0 :     case Qt::Key_Backtab: {
      48            0 :         if (!chain.prevWidget) {
      49            0 :             return false;
      50              :         }
      51              : 
      52            0 :         chain.prevWidget->setFocus();
      53            0 :         return true;
      54              :     }
      55            0 :     default:
      56            0 :         break;
      57              :     }
      58              : 
      59            0 :     return false;
      60              : }
        

Generated by: LCOV version 2.0-1