@@ -34,6 +34,7 @@ email : tim@linfiniti.com
34
34
#include < Q3SimpleRichText>
35
35
#include < QPainter>
36
36
#include < QMenu>
37
+ #include < QDate>
37
38
38
39
// non qt includes
39
40
#include < iostream>
@@ -105,10 +106,15 @@ void QgsCopyrightLabelPlugin::projectRead()
105
106
std::cout << " +++++++++ Copyright plugin - project read slot called...." << std::endl;
106
107
#endif // default text to start with - try to fetch it from qgsproject
107
108
109
+ QDate now;
110
+ QString defString;
108
111
109
- mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Arial" ));
110
- mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,14 ));
111
- mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" ," © QGIS 2007" );
112
+ now = QDate::currentDate ();
113
+ defString = " © QGIS " + now.toString (" yyyy" );
114
+
115
+ mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Sans Serif" ));
116
+ mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,9 ));
117
+ mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" , defString);
112
118
mPlacementIndex = QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /Placement" ,3 );
113
119
mEnable = QgsProject::instance ()->readBoolEntry (" CopyrightLabel" ," /Enabled" ,true );
114
120
// todo - read & store state of font color
0 commit comments