LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
autoresizemixin.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 <QObject>
13
#include <QPoint>
14
#include <QRect>
15
#include "
guiconfig.h
"
16
17
class
QWidget;
18
class
QWindow;
19
20
namespace
LC::Util
21
{
44
class
AutoResizeMixin
:
public
QObject
45
{
46
const
QPoint OrigPoint_;
47
48
const
std::function<void (QPoint)> Mover_;
49
public
:
52
using
RectGetter_f
= std::function<QRect ()>;
53
private
:
54
const
RectGetter_f
Rect_;
55
public
:
68
UTIL_GUI_API
AutoResizeMixin
(
const
QPoint& point,
RectGetter_f
rect, QWidget *widget);
69
82
UTIL_GUI_API
AutoResizeMixin
(
const
QPoint& point,
RectGetter_f
rect, QWindow *window);
83
86
bool
eventFilter
(QObject*, QEvent*)
override
;
87
private
:
88
void
Refit (
const
QSize&);
89
};
90
}
LC::Util::AutoResizeMixin::RectGetter_f
std::function< QRect()> RectGetter_f
A function type used to get the rect to fit widget in.
Definition
autoresizemixin.h:52
LC::Util::AutoResizeMixin::AutoResizeMixin
UTIL_GUI_API AutoResizeMixin(const QPoint &point, RectGetter_f rect, QWidget *widget)
Constructs the resize mixin.
Definition
autoresizemixin.cpp:17
LC::Util::AutoResizeMixin::eventFilter
bool eventFilter(QObject *, QEvent *) override
Listens for resize events and refits the widget.
Definition
autoresizemixin.cpp:37
guiconfig.h
UTIL_GUI_API
#define UTIL_GUI_API
Definition
guiconfig.h:16
LC::Util
Definition
icoreproxy.h:34
src
util
gui
autoresizemixin.h
Generated by
1.17.0