CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkToolTipTrapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 /*=========================================================================
21 
22  Program: ParaView
23  Module: pqToolTipTrapper.h
24 
25  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
26  All rights reserved.
27 
28  ParaView is a free software; you can redistribute it and/or modify it
29  under the terms of the ParaView license version 1.2.
30 
31  See http://www.paraview.org/paraview/project/license.html for the full ParaView license.
32  A copy of this license can be obtained by contacting
33  Kitware Inc.
34  28 Corporate Drive
35  Clifton Park, NY 12065
36  USA
37 
38 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
42 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 
50 =========================================================================*/
51 
52 #ifndef __ctkToolTipTrapper_h
53 #define __ctkToolTipTrapper_h
54 
55 // Qt includes
56 #include <QObject>
57 
58 // CTK includes
59 #include "ctkWidgetsExport.h"
60 class ctkToolTipTrapperPrivate;
61 
70 class CTK_WIDGETS_EXPORT ctkToolTipTrapper : public QObject
71 {
72  Q_OBJECT
73  Q_PROPERTY( bool toolTipsTrapped READ toolTipsTrapped WRITE setToolTipsTrapped)
74  Q_PROPERTY( bool toolTipsWordWrapped READ toolTipsWordWrapped WRITE setToolTipsWordWrapped)
75 public:
76  typedef QObject Superclass;
78  explicit ctkToolTipTrapper(QObject* objectParent = 0);
79  explicit ctkToolTipTrapper(bool toolTipsTrapped,
80  bool toolTipsWordWordWrapped,
81  QObject* objectParent = 0);
82  virtual ~ctkToolTipTrapper();
83 
85  bool toolTipsTrapped()const;
86 
88  bool toolTipsWordWrapped()const;
89 
92  bool eventFilter(QObject* watched, QEvent* event);
93 
94 public Q_SLOTS:
98  void setToolTipsTrapped(bool toolTipsTrapped);
99  void setToolTipsWordWrapped(bool toolTipsWordWrapped);
100 
101 protected:
102  QScopedPointer<ctkToolTipTrapperPrivate> d_ptr;
103 
104 private:
105  Q_DECLARE_PRIVATE(ctkToolTipTrapper);
106  Q_DISABLE_COPY(ctkToolTipTrapper);
107 };
108 
109 #endif
void setToolTipsWordWrapped(bool toolTipsWordWrapped)
QScopedPointer< ctkToolTipTrapperPrivate > d_ptr
virtual ~ctkToolTipTrapper()
ctkToolTipTrapper(bool toolTipsTrapped, bool toolTipsWordWordWrapped, QObject *objectParent=0)
ctkToolTipTrapper(QObject *objectParent=0)
Constructs a ToolTip trapper which is a child of objectParent.
bool eventFilter(QObject *watched, QEvent *event)
void setToolTipsTrapped(bool toolTipsTrapped)
bool toolTipsTrapped() const
Returns true if the tooltips are trapped to prevent them from appearing.
bool toolTipsWordWrapped() const
Returns true if the tooltips are word wrapped.