CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
ctkScreenshotDialog.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 __ctkScreenshotDialog_h
22#define __ctkScreenshotDialog_h
23
24// Qt includes
25#include <QDialog>
26
27// CTK includes
28#include "ctkWidgetsExport.h"
29
30class ctkScreenshotDialogPrivate;
31
46class CTK_WIDGETS_EXPORT ctkScreenshotDialog : public QDialog
47{
48 Q_OBJECT
49 Q_PROPERTY(QString baseFileName READ baseFileName WRITE setBaseFileName)
50 Q_PROPERTY(QString directory READ directory WRITE setDirectory)
51 Q_PROPERTY(int delay READ delay WRITE setDelay)
52
53public:
54 typedef QDialog Superclass;
55 ctkScreenshotDialog(QWidget* parent = 0);
57
62 void setWidgetToGrab(QWidget* newWidgetToGrab);
63 QWidget* widgetToGrab()const;
64
69 void setBaseFileName(const QString& newImageName);
70 QString baseFileName() const;
71
75 void setDirectory(const QString& path);
76 QString directory()const;
77
80 void setDelay(int seconds);
81 int delay()const;
82
85 void enforceResolution(int width = 300, int height = 300);
86 void enforceResolution(QSize size = QSize(300,300));
87
89 QSize widgetSize();
90
92 void enableTransparency(bool enable = true);
93
94public Q_SLOTS:
98 void instantScreenshot();
99
101 void saveScreenshot();
102
103protected:
104 QScopedPointer<ctkScreenshotDialogPrivate> d_ptr;
105
106private:
107 Q_DECLARE_PRIVATE(ctkScreenshotDialog);
108 Q_DISABLE_COPY(ctkScreenshotDialog);
109};
110
111#endif