ImageDialog.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2007 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_IMAGE_DIALOG_H
17 #define SV_IMAGE_DIALOG_H
18 
19 #include <QDialog>
20 #include <QString>
21 
22 class QLineEdit;
23 class QLabel;
24 class QPushButton;
25 class FileSource;
26 
27 class ImageDialog : public QDialog
28 {
29  Q_OBJECT
30 
31 public:
32  ImageDialog(QString title,
33  QString image = "",
34  QString label = "",
35  QWidget *parent = 0);
36  virtual ~ImageDialog();
37 
38  QString getImage();
39  QPixmap getPixmap();
40  QString getLabel();
41 
42 signals:
43  void imageChanged(QString image);
44  void labelChanged(QString label);
45 
46 public slots:
47  void setImage(QString image);
48  void setLabel(QString label);
49  void updatePreview();
50 
51 protected slots:
52  void browseClicked();
53  void imageEditEdited(const QString &);
54  void imageEditEdited();
55 
56 protected:
57  void resizeEvent(QResizeEvent *) override;
58 
59  QLineEdit *m_imageEdit;
60  QLineEdit *m_labelEdit;
61  QLabel *m_imagePreview;
62 
64  QPixmap m_loadedImage;
65 
66  QPushButton *m_okButton;
67 
68  FileSource *m_remoteFile;
69 };
70 
71 #endif
QLineEdit * m_imageEdit
Definition: ImageDialog.h:59
void updatePreview()
QPixmap m_loadedImage
Definition: ImageDialog.h:64
QString getImage()
void setLabel(QString label)
void setImage(QString image)
void imageEditEdited()
QPushButton * m_okButton
Definition: ImageDialog.h:66
QString getLabel()
FileSource * m_remoteFile
Definition: ImageDialog.h:68
void browseClicked()
QLineEdit * m_labelEdit
Definition: ImageDialog.h:60
virtual ~ImageDialog()
void labelChanged(QString label)
void imageChanged(QString image)
ImageDialog(QString title, QString image="", QString label="", QWidget *parent=0)
Definition: ImageDialog.cpp:36
void resizeEvent(QResizeEvent *) override
QLabel * m_imagePreview
Definition: ImageDialog.h:61
QString m_loadedImageFile
Definition: ImageDialog.h:63
QPixmap getPixmap()