casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtDisplayDataGui.qo.h
Go to the documentation of this file.
1 //# QtDisplayDataGui.qo.h: Qt options widget for single DisplayData
2 //# Copyright (C) 2005
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef QTDisplayDataGui_H
29 #define QTDisplayDataGui_H
30 
31 #include <casa/aips.h>
34 #include <casa/Containers/Record.h>
35 
36 #include <graphics/X11/X_enter.h>
37 # include <QDir>
38 # include <QColor>
39 # include <QHash>
40 #include <graphics/X11/X_exit.h>
41 
42 
43 namespace casa { //# NAMESPACE CASA - BEGIN
44 
45  class QtViewer;
46 
47 // <summary>
48 // Qt options widget for single DisplayData.
49 // </summary>
50 
51 // <synopsis>
52 // QtDisplayDataGui is a thin layer over a QtAutoGui base, to
53 // provide the options widget for a single QtDisplayData. It is normally
54 // in a tab of a QtDataOptionsPanel. Unlike QtAutoGui, which is
55 // intended to be generic and reusable for other purposes, QtDisplayDataGui
56 // knows about a QtDisplayData; QtDisplayDataGui makes the communication
57 // connections between its QtDisplayData and QtAutoGui.
58 // </synopsis>
59 
60 //class QtDisplayDataGui : protected QtAutoGui {
61  class QtDisplayDataGui : public QtAutoGui {
62 
63  Q_OBJECT //# Allows slot/signal definition. Must only occur in
64  //# implement/.../*.h files; also, makefile must include
65  //# name of this file in 'mocs' section.
66 
67  public:
68 
69  // Always pass a valid QtDisplayData* when creating QtDisplayDataGui,
70  // and use it only as long as the QtDisplayData* remains valid
72 
73  setFileName((qdd_->name()+".opts").c_str());
74 
75  loadRecord(qdd_->getOptions()); //# populate gui
76 
77  //# set up communication between gui and qdd_.
78 
79  /*
80  QtAutoGui* thisAutoGui = this;
81 
82  connect( thisAutoGui, SIGNAL(setOptions(casacore::Record)),
83  qdd_, SLOT(setOptions(casacore::Record)) );
84  connect( qdd_, SIGNAL(optionsChanged(casacore::Record)),
85  thisAutoGui, SLOT(changeOptions(casacore::Record)) ); }
86  */
87 
88 
89  connect( this, SIGNAL(setOptions(casacore::Record)),
91  //cerr<<" QDDG cn: this:"<<this<<" qdd:"<<qdd_<<endl; //#diag
92 
93  connect( qdd_, SIGNAL(optionsChanged(casacore::Record)),
95  }
96 
97 
98 
100 
101 
102  protected:
103 
105  //# (QtDisplayDataGui is not responsible for destroying qdd_).
106 
107  // Not to be used; QtDisplayDataGui must be created with a valid
108  // QtDisplayData*.
110 
111  };
112 
113 } //# NAMESPACE CASA - END
114 
115 #endif
void loadRecord(casacore::Record rec)
call once only during initialization, to populate the gui, if you used the QtAutoGui(QWidget=0) const...
QtDisplayDataGui()
Not to be used; QtDisplayDataGui must be created with a valid QtDisplayData*.
void setOptions(casacore::Record options)
virtual std::string name()
General-purpose Qt options widget created from Record.
Definition: QtAutoGui.qo.h:66
QtDisplayDataGui(QtDisplayData *qdd)
Always pass a valid QtDisplayData* when creating QtDisplayDataGui, and use it only as long as the QtD...
Qt options widget for single DisplayData.
virtual void changeOptions(casacore::Record changedOptions)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void setFileName(const QString &file_name)
virtual casacore::Record getOptions()
retrieve the casacore::Record of options.