LeechCraft
0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <functional>
12
#include <QShortcut>
13
#include <QList>
14
#include "
shortcutsconfig.h
"
15
16
class
QKeySequence;
17
class
QWidget;
18
class
QObject;
19
20
namespace
LC::Util
21
{
36
UTIL_SHORTCUTS_API
void
CreateShortcuts
(
const
QList<QKeySequence>
&
seqs
,
37
const
std::function<
void
()>&
func
, QWidget *parent);
38
39
template
<
typename
Obj>
40
void
CreateShortcuts
(
const
QList<QKeySequence>
&
seqs
,
41
Obj
*
obj
,
void
(
Obj
::*
member
) (), QWidget *parent)
42
{
43
for
(
const
auto
&
sc
:
seqs
)
44
new
QShortcut
{
sc
, parent,
obj
,
member
};
45
}
46
63
UTIL_SHORTCUTS_API
void
CreateShortcuts
(
const
QList<QKeySequence>
&
seqs
,
64
QObject *
object
,
const
char
*
metamethod
, QWidget *parent);
65
}
QList
Definition
ianrulesstorage.h:14
LC::Util::CreateShortcuts
void CreateShortcuts(const QList< QKeySequence > &shortcuts, const std::function< void()> &func, QWidget *parent)
Makes func invokable with shortcuts in seq.
Definition
util.cpp:13
LC::Util
Definition
icoreproxy.h:34
LC::Util::Filter
Container< T > Filter(const Container< T > &c, F f)
Definition
prelude.h:118
shortcutsconfig.h
UTIL_SHORTCUTS_API
#define UTIL_SHORTCUTS_API
Definition
shortcutsconfig.h:16
src
util
shortcuts
util.h
Generated by
1.10.0