mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #535, shortcut class where I keep global key sequences and such to avoid overlapping
This commit is contained in:
40
src/blackgui/shortcut.cpp
Normal file
40
src/blackgui/shortcut.cpp
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright (C) 2015
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*
|
||||||
|
* Class based on qLed: Copyright (C) 2010 by P. Sereno, http://www.sereno-online.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "shortcut.h"
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
const QKeySequence &CShortcut::keyStash()
|
||||||
|
{
|
||||||
|
static const QKeySequence k(Qt::ALT + Qt::Key_S);
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QKeySequence &CShortcut::keyClearSelection()
|
||||||
|
{
|
||||||
|
static const QKeySequence k(Qt::CTRL + Qt::Key_C);
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QKeySequence &CShortcut::keySelectAll()
|
||||||
|
{
|
||||||
|
static const QKeySequence k(Qt::CTRL + Qt::Key_A);
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QKeySequence &BlackGui::CShortcut::keyDisplayFilter()
|
||||||
|
{
|
||||||
|
static const QKeySequence k(Qt::CTRL + Qt::Key_F);
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // ns
|
||||||
43
src/blackgui/shortcut.h
Normal file
43
src/blackgui/shortcut.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright (C) 2015
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*
|
||||||
|
* Class based on qLed: Copyright (C) 2010 by P. Sereno, http://www.sereno-online.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
//! \file
|
||||||
|
|
||||||
|
#ifndef BLACKGUI_SHORTCUT_H
|
||||||
|
#define BLACKGUI_SHORTCUT_H
|
||||||
|
|
||||||
|
#include <QShortcut>
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
* Shortcut class to avoid overlapping shortcut defintions
|
||||||
|
*/
|
||||||
|
class CShortcut
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! No constructor
|
||||||
|
CShortcut() = delete;
|
||||||
|
|
||||||
|
//! For stashing models
|
||||||
|
static const QKeySequence &keyStash();
|
||||||
|
|
||||||
|
//! For deselecting all
|
||||||
|
static const QKeySequence &keyClearSelection();
|
||||||
|
|
||||||
|
//! For selecting all
|
||||||
|
static const QKeySequence &keySelectAll();
|
||||||
|
|
||||||
|
//! Display filter
|
||||||
|
static const QKeySequence &keyDisplayFilter();
|
||||||
|
};
|
||||||
|
} // ns
|
||||||
|
#endif // CSHORTCUT_H
|
||||||
Reference in New Issue
Block a user