FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
quantity_editor_manager.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** FougTools
3 ** Copyright Fougue (30 Mar. 2015)
4 ** contact@fougue.pro
5 **
6 ** This software is a computer program whose purpose is to provide utility
7 ** tools for the C++ language and the Qt toolkit.
8 **
9 ** This software is governed by the CeCILL-C license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-C
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info".
14 ****************************************************************************/
15 
16 #pragma once
17 
18 #include "gui.h"
19 #include <QtCore/QLocale>
20 #include <QtCore/QSet>
21 
22 namespace qtgui {
23 
24 class AbstractQuantityEditor;
25 
26 namespace internal { class QuantityEditorManagerCreator; }
27 
29 {
30  Q_OBJECT
31 
32 private:
35 
36  void attach(AbstractQuantityEditor* editor);
37  void detach(AbstractQuantityEditor* editor);
38 
39 public:
40  static QuantityEditorManager* globalInstance();
41 
42  QLocale::MeasurementSystem measurementSytem() const;
43  void setMeasurementSystem(QLocale::MeasurementSystem sys);
44 
45 signals:
46  void currentMeasurementSytemChanged(QLocale::MeasurementSystem sys);
47 
48 private:
49  friend class internal::QuantityEditorManagerCreator;
50  friend class AbstractQuantityEditor;
51  QSet<AbstractQuantityEditor*> m_qtyEditors;
52  QLocale::MeasurementSystem m_measureSys;
53 };
54 
55 } // namespace qtgui
Definition: abstract_length_editor.cpp:20
#define QTTOOLS_GUI_EXPORT
Definition: gui.h:27
Base abstract class for editor of quantities, works in coordination with QuantityEditorManager.
Definition: abstract_quantity_editor.h:23
Manages a set of AbstractQuantityEditor objects that will get notified when the current measurement s...
Definition: quantity_editor_manager.h:28