1 /* 2 * shortcutsettingspage.h 3 * Copyright 2019, Thorbjørn Lindeijer <bjorn@lindeijer.nl> 4 * 5 * This file is part of Tiled. 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the Free 9 * Software Foundation; either version 2 of the License, or (at your option) 10 * any later version. 11 * 12 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15 * more details. 16 * 17 * You should have received a copy of the GNU General Public License along with 18 * this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #pragma once 22 23 #include <QWidget> 24 25 class QSortFilterProxyModel; 26 27 namespace Tiled { 28 29 class ActionsModel; 30 class KeySequenceFilterModel; 31 32 namespace Ui { 33 class ShortcutSettingsPage; 34 } 35 36 class ShortcutSettingsPage : public QWidget 37 { 38 Q_OBJECT 39 40 public: 41 explicit ShortcutSettingsPage(QWidget *parent = nullptr); 42 ~ShortcutSettingsPage() override; 43 44 QSize sizeHint() const override; 45 46 protected: 47 void showEvent(QShowEvent *event) override; 48 void hideEvent(QHideEvent *event) override; 49 50 private: 51 void refreshConflicts(); 52 void searchConflicts(); 53 54 void importShortcuts(); 55 void exportShortcuts(); 56 57 Ui::ShortcutSettingsPage *ui; 58 ActionsModel *mActionsModel; 59 KeySequenceFilterModel *mProxyModel; 60 }; 61 62 } // namespace Tiled 63