Right now I have a header file called enums.h as such:

enums.h
Qt Code:
  1. #ifndef ENUMS_H
  2. #define ENUMS_H
  3.  
  4. #include <Qt>
  5.  
  6. enum paper_orient{portrait, landscape};
  7. enum ruler_orient{top_ruler, bottom_ruler, left_ruler, right_ruler};
  8. enum relationships_type{line_item, other};
  9. enum settings_type{line_object, plot, text};
  10.  
  11. #endif // ENUMS_H
To copy to clipboard, switch view to plain text mode 

With this setup, wherever I want to use these enums, I just #include "enums.h" and they are available.

In learning to do things the Qt way, it appears that QMetaEnum would be a more streamlined approach.

In the docs, I find this example:
Qt Code:
  1. class MyClass : public QObject
  2. {
  3. Q_OBJECT
  4. Q_ENUMS(Priority)
  5.  
  6. public:
  7. MyClass(QObject *parent = 0);
  8. ~MyClass();
  9.  
  10. enum Priority { High, Low, VeryHigh, VeryLow };
  11. void setPriority(Priority priority);
  12. Priority priority() const;
  13. };
To copy to clipboard, switch view to plain text mode 

If I use this approach, does this mean that the Priority enum is only available within MyClass? What if I wish to use this enum in other classes? Ultimately that is what I would like to establish, is a series of global enums that are available anywhere in my project.