18 |
18 |
19 #pragma once |
19 #pragma once |
20 #include <QObject> |
20 #include <QObject> |
21 #include "main.h" |
21 #include "main.h" |
22 #include "configuration.h" |
22 #include "configuration.h" |
|
23 #include "messageLog.h" |
|
24 #include "mainwindow.h" |
23 |
25 |
24 class MainWindow; |
|
25 class GuiUtilities; |
26 class GuiUtilities; |
26 class LDDocument; |
27 class LDDocument; |
27 class DocumentManager; |
28 class DocumentManager; |
28 class PrimitiveManager; |
29 class PrimitiveManager; |
29 class Grid; |
30 class Grid; |
30 class MathFunctions; |
31 class MathFunctions; |
|
32 class MainWindow; |
31 |
33 |
32 // |
34 // |
33 // Objects that are to take part in the MainWindow's hierarchy multiple-inherit from this class to get a pointer back |
35 // Objects that are to take part in the MainWindow's hierarchy multiple-inherit from this class to get a pointer back |
34 // to the MainWindow class along with a few useful pointers and methods. |
36 // to the MainWindow class along with a few useful pointers and methods. |
35 // |
37 // |
46 MathFunctions* math() const; |
48 MathFunctions* math() const; |
47 |
49 |
48 // Utility functions |
50 // Utility functions |
49 QString preferredLicenseText() const; |
51 QString preferredLicenseText() const; |
50 |
52 |
|
53 // Format and print the given args to the message log. |
|
54 template<typename... Args> |
|
55 void print(QString formatString, Args... args) |
|
56 { |
|
57 formatHelper(formatString, args...); |
|
58 m_window->addMessage(formatString); |
|
59 } |
|
60 |
51 protected: |
61 protected: |
52 MainWindow* m_window; |
62 MainWindow* m_window; |
53 DocumentManager* m_documents; |
63 DocumentManager* m_documents; |
54 Configuration* m_config; |
64 Configuration* m_config; |
55 }; |
65 }; |