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
16class QKeySequence;
17class QWidget;
18class QObject;
19
20namespace LC::Util
21{
37 const std::function<void ()>& func, QWidget *parent);
38
39 template<typename Obj>
41 Obj *obj, void (Obj::*member) (), QWidget *parent)
42 {
43 for (const auto& sc : seqs)
44 new QShortcut { sc, parent, obj, member };
45 }
46
64 QObject *object, const char *metamethod, QWidget *parent);
65}
void CreateShortcuts(const QList< QKeySequence > &shortcuts, const std::function< void()> &func, QWidget *parent)
Makes func invokable with shortcuts in seq.
Definition util.cpp:13
#define UTIL_SHORTCUTS_API