OpenMS
SaveImageDialog.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 #include <QtWidgets/QDialog>
15 #include <QtWidgets/QComboBox>
16 #include <QtWidgets/QLineEdit>
17 #include <QtWidgets/QCheckBox>
18 
19 namespace OpenMS
20 {
28  class OPENMS_GUI_DLLAPI SaveImageDialog :
29  public QDialog
30  {
31  Q_OBJECT
32 
33 public:
35  SaveImageDialog(QWidget * parent = nullptr);
37  void setSize(int x, int y);
39  int getXSize();
41  int getYSize();
43  QString getFormat();
44 
45 public slots:
47  void xSizeChanged(const QString & s);
49  void ySizeChanged(const QString & s);
51  void proportionsActivated(bool state);
53  void checkSize();
54 
55 private:
56  //format
57  QComboBox * format_;
58  //size
61  QCheckBox * size_proportions_;
62  //ratio size_x_/size_y_
63  float size_ratio_;
64 
65  //set the size ratio (width/height)
66  void setSizeRatio_(float r);
67  };
68 }
Dialog for saving an image.
Definition: SaveImageDialog.h:30
int getXSize()
accessors for the width
QComboBox * format_
Definition: SaveImageDialog.h:57
QCheckBox * size_proportions_
Definition: SaveImageDialog.h:61
void ySizeChanged(const QString &s)
changes height keeping proportions
QLineEdit * size_x_
Definition: SaveImageDialog.h:59
void xSizeChanged(const QString &s)
changes width keeping proportions
float size_ratio_
Definition: SaveImageDialog.h:63
QLineEdit * size_y_
Definition: SaveImageDialog.h:60
void checkSize()
checks if the values for width and height are ok before accepting the dialog
SaveImageDialog(QWidget *parent=nullptr)
Constructor.
void setSize(int x, int y)
set size and size ratio
QString getFormat()
accessors for the format
int getYSize()
accessors for the height
void proportionsActivated(bool state)
set size ratio when proportions checkbox is activated
void setSizeRatio_(float r)
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19