API Documentation
Loading...
Searching...
No Matches
ResizeVisibleAnimation.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: ResizeVisibleAnimation
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/PopupInfo.h>
35#include <NDEVR/Dictionary.h>
36#include <QWidget>
37#include <QPropertyAnimation>
38#include <QGraphicsOpacityEffect>
39#include <QRect>
40#include <QPointer>
41namespace NDEVR
42{
43 class ImageView;
44 class NDEVR_WIDGETS_API ResizeVisibleAnimation : public QPropertyAnimation
45 {
46 Q_OBJECT
47 Q_PROPERTY(double visible_size READ activeSize WRITE setActiveSize)
48 protected:
49 ResizeVisibleAnimation(QWidget* widget, bool visible, bool vertical, int duration = 300, int delay = 0);
50 ResizeVisibleAnimation(QWidget* widget, bool visible, PopupInfo start_location, PopupInfo end_location, int duration = 300, int delay = 0);
51 public:
53 void setActiveSize(double size);
54 void setDeleteWidgetOnEnd(bool delete_widget) { m_delete_on_end = delete_widget; }
55 void setup(int duration, int start_delay, bool ignore_max_min_size);
56 void reverse();
57 double activeSize() const
58 {
59 return m_active_size;
60 }
61 static ResizeVisibleAnimation* run(QWidget* widget, bool visible, bool vertical, int duration = -1, int delay = 0);
62 static ResizeVisibleAnimation* run(QWidget* widget, bool visible, const PopupInfo& start_location, const PopupInfo& end_location, int duration = -1, int delay = 0);
63 bool eventFilter(QObject* object, QEvent* event) override;
64 static ResizeVisibleAnimation* runRemove(QWidget* widget, bool vertical, int duration = -1, int delay = 0);
65 static void setTopLevelWidget(QWidget* top_widget);
66 static ResizeVisibleAnimation* ActiveAnimation(QWidget* widget);
67 protected slots:
68 void onFinishedSlot();
69 protected:
70 void setupSourceWidget(QWidget* source_widget, QSize size);
71 void createFadeInAnimation(int msec);
72 QRect getGeometry(double percent);
73 protected slots:
74 void startAnimation();
75 protected:
80 QPointer<QPropertyAnimation> m_primary_animation = nullptr;
81 QPointer<QGraphicsOpacityEffect> m_fade_primary_effect;
82 QPointer<ImageView> m_primary_image_view;
83 QPointer<QWidget> m_widget;
84 QPointer<QWidget> m_animation_widget;
85
88
92
93 Qt::WindowFlags m_original_flags;
95 static QWidget* s_top_level_widget;
96 };
97}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition Dictionary.h:48
Definition ResizeVisibleAnimation.h:45
bool m_delete_on_end
Definition ResizeVisibleAnimation.h:91
static Dictionary< QWidget *, ResizeVisibleAnimation * > s_active_resize_effects
Definition ResizeVisibleAnimation.h:94
QPointer< QGraphicsOpacityEffect > m_fade_primary_effect
Definition ResizeVisibleAnimation.h:81
int m_widget_size
Definition ResizeVisibleAnimation.h:77
QSize m_restore_max_widget_size
Definition ResizeVisibleAnimation.h:78
PopupInfo m_end_size
Definition ResizeVisibleAnimation.h:87
static QWidget * s_top_level_widget
Definition ResizeVisibleAnimation.h:95
QSize m_restore_min_widget_size
Definition ResizeVisibleAnimation.h:79
QPointer< QWidget > m_animation_widget
Definition ResizeVisibleAnimation.h:84
bool m_is_vertical
Definition ResizeVisibleAnimation.h:89
QPointer< QWidget > m_widget
Definition ResizeVisibleAnimation.h:83
Qt::WindowFlags m_original_flags
Definition ResizeVisibleAnimation.h:93
PopupInfo m_start_size
Definition ResizeVisibleAnimation.h:86
double activeSize() const
Definition ResizeVisibleAnimation.h:57
void setDeleteWidgetOnEnd(bool delete_widget)
Definition ResizeVisibleAnimation.h:54
fltp08 m_active_size
Definition ResizeVisibleAnimation.h:76
bool m_make_visible
Definition ResizeVisibleAnimation.h:90
QPointer< ImageView > m_primary_image_view
Definition ResizeVisibleAnimation.h:82
Definition ACIColor.h:37
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition PopupInfo.h:10