CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkMenuButton.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 #ifndef __ctkMenuButton_h
22 #define __ctkMenuButton_h
23 
24 // Qt includes
25 #include <QPushButton>
26 
27 // CTK includes
28 #include <ctkPimpl.h>
29 
30 #include "ctkWidgetsExport.h"
31 
32 class ctkMenuButtonPrivate;
33 
41 class CTK_WIDGETS_EXPORT ctkMenuButton : public QPushButton
42 {
43  Q_OBJECT
44 
45 public:
46  ctkMenuButton(QWidget *parent = 0);
47  ctkMenuButton(const QString& text, QWidget *parent = 0);
48  virtual ~ctkMenuButton();
49 
51  virtual QSize minimumSizeHint()const;
53  virtual QSize sizeHint()const;
54 
55 protected:
57  virtual void paintEvent(QPaintEvent*);
59  virtual void mousePressEvent(QMouseEvent* event);
61  virtual bool hitButton(const QPoint & pos) const;
63  virtual void initStyleOption ( QStyleOptionButton * option ) const;
64 protected:
65  QScopedPointer<ctkMenuButtonPrivate> d_ptr;
66 
67 private:
68  Q_DECLARE_PRIVATE(ctkMenuButton);
69  Q_DISABLE_COPY(ctkMenuButton);
70 };
71 
72 #endif
virtual void paintEvent(QPaintEvent *)
Reimplemented for internal reasons.
virtual void mousePressEvent(QMouseEvent *event)
Reimplemented for internal reasons.
virtual bool hitButton(const QPoint &pos) const
Reimplemented for internal reasons.
QScopedPointer< ctkMenuButtonPrivate > d_ptr
Definition: ctkMenuButton.h:65
virtual ~ctkMenuButton()
virtual QSize minimumSizeHint() const
Reimplemented for internal reasons.
ctkMenuButton(const QString &text, QWidget *parent=0)
virtual void initStyleOption(QStyleOptionButton *option) const
Reimplemented for internal reasons.
ctkMenuButton(QWidget *parent=0)
virtual QSize sizeHint() const
Reimplemented for internal reasons.