Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

mdifloatingwindow.h 4.09 KB
Newer Older
1
2
3
4
// ================================================================================================
// 
// This file is part of the CAMPVis Software Framework.
// 
5
// If not explicitly stated otherwise: Copyright (C) 2012-2015, all rights reserved,
6
7
//      Christian Schulte zu Berge <christian.szb@in.tum.de>
//      Chair for Computer Aided Medical Procedures
8
9
//      Technische Universitaet Muenchen
//      Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
10
// 
11
12
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
// 
13
14
15
16
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
// except in compliance with the License. You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
17
// 
18
19
20
21
// Unless required by applicable law or agreed to in writing, software distributed under the 
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
// either express or implied. See the License for the specific language governing permissions 
// and limitations under the License.
22
23
24
// 
// ================================================================================================

25
26
#ifndef MDIFLOATINGWINDOW_H__
#define MDIFLOATINGWINDOW_H__
27

28
#include "application/gui/qtcolortools.h"
29
30
31
32
33
#include <QWidget>

namespace campvis {

    /**
34
     * Specialised widget for detached MDI subwindows.
35
     *
36
37
38
39
40
41
42
43
     * MdiFloatingWindow is a top-level floating window representing an undocked MDI subwindow.
     * It reports changes in its position via the s_positionChanged signal. The MDI area that
     * created it listens to this signal to decide when to scrap the floating window and dock back
     * the widget that it wraps.
     *
     * MdiFloatingWindow also implements additional methods (forceWindowDrag, stopWindowDrag)
     * that should be used to coordinate its creation/disposal with respect to grabbing/releasing
     * the mouse input.
44
     */
45
    class CAMPVIS_APPLICATION_API MdiFloatingWindow : public QWidget {
46

47
        Q_OBJECT
48
49
50

    public:
        /**
51
         * Construct a new MdiFloatingWindow.
52
         *
53
         * \param widget the widget this window is to wrap
54
         * \param parent the windows's parent
55
         */
56
        explicit MdiFloatingWindow(QWidget* widget, QWidget* parent = 0);
57
58

        /**
59
         * Enter the window into forced drag mode.
60
         *
61
         * This method causes the window to grab the mouse input and follow the cursor.
62
63
64
         */
        void forceWindowDrag();

65
        /**
66
         * Cancel the dragging of the window.
67
         *
68
         * This method causes the window to release the mouse grab and stop following the cursor.
69
70
71
         */
        void stopWindowDrag();

72
        /**
73
         * Return the widget this window wraps.
74
         */
75
        QWidget* widget() const;
76

77
78
    signals:
        /**
79
         * Emitted when the window's position changes.
80
         *
81
         * \param newPos the window's new position
82
         */
83
84
85
86
87
88
        void s_positionChanged(const QPoint& newPos);

        /**
         * Emitted when the window gets closed.
         */
        void s_closed();
89

90
91
    protected:
        /**
92
         * Event handler that receives mouse move events for the window.
93
94
95
96
         */
        virtual void mouseMoveEvent(QMouseEvent* event);

        /**
97
         * Event handler that receives mouse release events for the window.
98
99
100
         */
        virtual void mouseReleaseEvent(QMouseEvent * event);

101
102
103
104
105
        /**
         * Event handler that receives move events for the window.
         */
        virtual void moveEvent(QMoveEvent* event);

106
107
108
109
110
        /**
         * Event handler called when Qt receives a window close request for the window.
         */
        virtual void closeEvent(QCloseEvent* event);

111
    private:
112
113
114
115
116
        /**
         * Moves the window so that its title bar is centered around \p cursorPos.
         */
        void snapToCursor(const QPoint& cursorPos);

117
118
        QWidget* _widget;            ///< The widget this window wraps
        bool _dragActive;            ///< Is the window currently being dragged?
119
120
121
122

    };
}

123
#endif // MDIFLOATINGWINDOW_H__