Skip to content

Commit c271af4

Browse files
author
g_j_m
committedJan 22, 2006
More migration from qt3 to qt4
Use a real copyright symbol instead of (c) git-svn-id: http://svn.osgeo.org/qgis/trunk@4715 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 428aeb4 commit c271af4

File tree

5 files changed

+128
-194
lines changed

5 files changed

+128
-194
lines changed
 

‎src/plugins/copyright_label/plugin.cpp

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,10 @@ email : tim@linfiniti.com
2929
#include <qgsproject.h>
3030
#include <qgsmapcanvas.h>
3131

32-
#include <q3toolbar.h>
33-
#include <qmenubar.h>
34-
#include <qmessagebox.h>
35-
#include <q3popupmenu.h>
36-
#include <qlineedit.h>
37-
#include <qaction.h>
38-
#include <qapplication.h>
39-
#include <qcursor.h>
40-
#include <qpixmap.h>
41-
#include <qpainter.h>
42-
#include <qfont.h>
43-
#include <qrect.h>
44-
#include <qbrush.h>
45-
#include <q3button.h>
46-
#include <qcheckbox.h>
47-
#include <q3paintdevicemetrics.h>
48-
#include <qglobal.h>
32+
#include <Q3Button>
33+
#include <Q3PaintDeviceMetrics>
34+
#include <Q3SimpleRichText>
35+
#include <QPainter>
4936

5037
//non qt includes
5138
#include <iostream>
@@ -97,11 +84,7 @@ void QgsCopyrightLabelPlugin::initGui()
9784
pluginMenu->setWhatsThis(menuId, "Creates a copyright label that is displayed on the map canvas.");
9885

9986
// Create the action for tool
100-
#if QT_VERSION < 0x040000
101-
myQActionPointer = new QAction("Copyright Label", QIcon(icon), "&Wmi",0, this, "run");
102-
#else
10387
myQActionPointer = new QAction(QIcon(icon), "Copyright Label", this);
104-
#endif
10588
myQActionPointer->setWhatsThis("Creates a copyright label that is displayed on the map canvas.");
10689
// Connect the action to the run
10790
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
@@ -125,7 +108,7 @@ void QgsCopyrightLabelPlugin::projectRead()
125108

126109
mQFont.setFamily(QgsProject::instance()->readEntry("CopyrightLabel","/FontName","Arial"));
127110
mQFont.setPointSize(QgsProject::instance()->readNumEntry("CopyrightLabel","/FontSize",14));
128-
mLabelQString = QgsProject::instance()->readEntry("CopyrightLabel","/Label","(c) QGIS 2006");
111+
mLabelQString = QgsProject::instance()->readEntry("CopyrightLabel","/Label","&copy; QGIS 2006");
129112
mPlacement = QgsProject::instance()->readEntry("CopyrightLabel","/Placement","Bottom Right");
130113
mEnable = QgsProject::instance()->readBoolEntry("CopyrightLabel","/Enabled",true);
131114
// todo - read & store state of font color

‎src/plugins/copyright_label/plugin.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
#define QGSCOPYRIGHTLABELPLUGIN
2222
#include "../qgisplugin.h"
2323
#include "qgisapp.h"
24-
#include <qwidget.h>
25-
#include <qfont.h>
26-
#include <qcolor.h>
27-
#include <q3simplerichtext.h>
28-
#include <qpainter.h>
24+
25+
class QPainter;
26+
2927
/**
3028
* \class Plugin
3129
* \brief OpenModeller plugin for QGIS

‎src/plugins/copyright_label/plugingui.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
***************************************************************************/
1212
#include "plugingui.h"
1313
#include "qgscontexthelp.h"
14-
#include <q3textedit.h>
15-
#include <q3simplerichtext.h>
16-
#include <QComboBox>
17-
#include <qcheckbox.h>
18-
#include <qlabel.h>
1914

2015
//qt includes
2116

@@ -70,7 +65,7 @@ void QgsCopyrightLabelPluginGui::setEnabled(bool theBool)
7065

7166
void QgsCopyrightLabelPluginGui::setText(QString theTextQString)
7267
{
73-
txtCopyrightText->setText(theTextQString);
68+
txtCopyrightText->setPlainText(theTextQString);
7469
}
7570

7671
void QgsCopyrightLabelPluginGui::setPlacement(QString thePlacementQString)

‎src/plugins/copyright_label/plugingui.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#define QGSCOPYRIGHTLABELPLUGINGUI_H
1414

1515
#include <ui_pluginguibase.h>
16-
#include <QDialog>
1716
#include <qfont.h>
1817
#include <qcolor.h>
1918

‎src/plugins/copyright_label/pluginguibase.ui

Lines changed: 119 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,56 @@
2525
<property name="spacing" >
2626
<number>6</number>
2727
</property>
28-
<item row="4" column="0" colspan="3" >
28+
<item row="0" column="2" >
29+
<widget class="QTextEdit" name="textEdit3" >
30+
<property name="html" >
31+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt;">Description&lt;/span>&lt;/p>&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter your copyright label below. This plugin supports basic html markup tags for formatting the label. For example:&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">&amp;lt;B&amp;gt; Bold text &amp;lt;/B&amp;gt; &lt;/span>&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">&lt;span style=" font-weight:400; font-style:italic;">&amp;lt;I&amp;gt; Italics &amp;lt;/I&amp;gt;&lt;/span>&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;">&lt;span style=" font-style:normal;">(note: &amp;amp;copy; gives a copyright symbol)&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
32+
</property>
33+
</widget>
34+
</item>
35+
<item row="1" column="2" >
36+
<widget class="QTextEdit" name="txtCopyrightText" >
37+
<property name="html" >
38+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:14pt;">© QGIS 2006&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
39+
</property>
40+
</widget>
41+
</item>
42+
<item rowspan="4" row="0" column="1" >
43+
<widget class="Line" name="line1" >
44+
<property name="maximumSize" >
45+
<size>
46+
<width>2</width>
47+
<height>32767</height>
48+
</size>
49+
</property>
50+
<property name="frameShape" >
51+
<enum>QFrame::VLine</enum>
52+
</property>
53+
<property name="frameShadow" >
54+
<enum>QFrame::Sunken</enum>
55+
</property>
56+
<property name="orientation" >
57+
<enum>Qt::Vertical</enum>
58+
</property>
59+
</widget>
60+
</item>
61+
<item rowspan="4" row="0" column="0" >
62+
<widget class="QLabel" name="pixmapLabel2" >
63+
<property name="maximumSize" >
64+
<size>
65+
<width>150</width>
66+
<height>32767</height>
67+
</size>
68+
</property>
69+
<property name="pixmap" >
70+
<pixmap resource="copyright_plugin.qrc" >:/copyright.png</pixmap>
71+
</property>
72+
<property name="scaledContents" >
73+
<bool>true</bool>
74+
</property>
75+
</widget>
76+
</item>
77+
<item row="2" column="2" >
2978
<layout class="QHBoxLayout" >
3079
<property name="margin" >
3180
<number>0</number>
@@ -34,49 +83,55 @@
3483
<number>6</number>
3584
</property>
3685
<item>
37-
<widget class="QPushButton" name="pbnHelp" >
86+
<widget class="QLabel" name="textLabel16" >
3887
<property name="text" >
39-
<string>Help</string>
40-
</property>
41-
<property name="shortcut" >
42-
<string>Alt+O</string>
88+
<string>Placement</string>
4389
</property>
4490
</widget>
4591
</item>
4692
<item>
47-
<spacer>
48-
<property name="orientation" >
49-
<enum>Qt::Horizontal</enum>
50-
</property>
51-
<property name="sizeType" >
52-
<enum>QSizePolicy::Expanding</enum>
53-
</property>
54-
<property name="sizeHint" >
55-
<size>
56-
<width>281</width>
57-
<height>26</height>
58-
</size>
59-
</property>
60-
</spacer>
93+
<widget class="QComboBox" name="cboPlacement" >
94+
<item>
95+
<property name="text" >
96+
<string>Bottom Left</string>
97+
</property>
98+
</item>
99+
<item>
100+
<property name="text" >
101+
<string>Top Left</string>
102+
</property>
103+
</item>
104+
<item>
105+
<property name="text" >
106+
<string>Bottom Right</string>
107+
</property>
108+
</item>
109+
<item>
110+
<property name="text" >
111+
<string>Top Right</string>
112+
</property>
113+
</item>
114+
</widget>
61115
</item>
62116
<item>
63-
<widget class="QPushButton" name="pbnOK" >
117+
<widget class="QLabel" name="textLabel15" >
64118
<property name="text" >
65-
<string>&amp;OK</string>
66-
</property>
67-
<property name="shortcut" >
68-
<string>Alt+O</string>
119+
<string>Orientation</string>
69120
</property>
70121
</widget>
71122
</item>
72123
<item>
73-
<widget class="QPushButton" name="pbnCancel" >
74-
<property name="text" >
75-
<string>&amp;Cancel</string>
76-
</property>
77-
<property name="shortcut" >
78-
<string>Alt+C</string>
79-
</property>
124+
<widget class="QComboBox" name="cboOrientation" >
125+
<item>
126+
<property name="text" >
127+
<string>Horizontal</string>
128+
</property>
129+
</item>
130+
<item>
131+
<property name="text" >
132+
<string>Vertical</string>
133+
</property>
134+
</item>
80135
</widget>
81136
</item>
82137
</layout>
@@ -117,7 +172,7 @@
117172
</item>
118173
</layout>
119174
</item>
120-
<item row="2" column="2" >
175+
<item row="4" column="0" colspan="3" >
121176
<layout class="QHBoxLayout" >
122177
<property name="margin" >
123178
<number>0</number>
@@ -126,153 +181,57 @@
126181
<number>6</number>
127182
</property>
128183
<item>
129-
<widget class="QLabel" name="textLabel16" >
184+
<widget class="QPushButton" name="pbnHelp" >
130185
<property name="text" >
131-
<string>Placement</string>
186+
<string>Help</string>
187+
</property>
188+
<property name="shortcut" >
189+
<string>Alt+O</string>
132190
</property>
133191
</widget>
134192
</item>
135193
<item>
136-
<widget class="QComboBox" name="cboPlacement" >
137-
<item>
138-
<property name="text" >
139-
<string>Bottom Left</string>
140-
</property>
141-
</item>
142-
<item>
143-
<property name="text" >
144-
<string>Top Left</string>
145-
</property>
146-
</item>
147-
<item>
148-
<property name="text" >
149-
<string>Bottom Right</string>
150-
</property>
151-
</item>
152-
<item>
153-
<property name="text" >
154-
<string>Top Right</string>
155-
</property>
156-
</item>
157-
</widget>
194+
<spacer>
195+
<property name="orientation" >
196+
<enum>Qt::Horizontal</enum>
197+
</property>
198+
<property name="sizeType" >
199+
<enum>QSizePolicy::Expanding</enum>
200+
</property>
201+
<property name="sizeHint" >
202+
<size>
203+
<width>281</width>
204+
<height>26</height>
205+
</size>
206+
</property>
207+
</spacer>
158208
</item>
159209
<item>
160-
<widget class="QLabel" name="textLabel15" >
210+
<widget class="QPushButton" name="pbnOK" >
161211
<property name="text" >
162-
<string>Orientation</string>
212+
<string>&amp;OK</string>
213+
</property>
214+
<property name="shortcut" >
215+
<string>Alt+O</string>
163216
</property>
164217
</widget>
165218
</item>
166219
<item>
167-
<widget class="QComboBox" name="cboOrientation" >
168-
<item>
169-
<property name="text" >
170-
<string>Horizontal</string>
171-
</property>
172-
</item>
173-
<item>
174-
<property name="text" >
175-
<string>Vertical</string>
176-
</property>
177-
</item>
220+
<widget class="QPushButton" name="pbnCancel" >
221+
<property name="text" >
222+
<string>&amp;Cancel</string>
223+
</property>
224+
<property name="shortcut" >
225+
<string>Alt+C</string>
226+
</property>
178227
</widget>
179228
</item>
180229
</layout>
181230
</item>
182-
<item row="1" column="2" >
183-
<widget class="Q3TextEdit" name="txtCopyrightText" >
184-
<property name="frameShape" >
185-
<enum>QFrame::Box</enum>
186-
</property>
187-
<property name="frameShadow" >
188-
<enum>QFrame::Sunken</enum>
189-
</property>
190-
<property name="lineWidth" >
191-
<number>1</number>
192-
</property>
193-
<property name="textFormat" >
194-
<enum>Qt::PlainText</enum>
195-
</property>
196-
<property name="text" >
197-
<string>© QGIS 20056</string>
198-
</property>
199-
<property name="wordWrap" >
200-
<enum>Q3TextEdit::WidgetWidth</enum>
201-
</property>
202-
</widget>
203-
</item>
204-
<item row="0" column="2" >
205-
<widget class="Q3TextEdit" name="textEdit2" >
206-
<property name="lineWidth" >
207-
<number>1</number>
208-
</property>
209-
<property name="margin" >
210-
<number>0</number>
211-
</property>
212-
<property name="text" >
213-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style="font-size:10pt;font-family:helvetica">
214-
&lt;p style="margin-top:18px">&lt;span style="font-size:19pt;font-weight:600">Description&lt;/span>&lt;/p>
215-
&lt;p>Enter your copyright label below. This plugin supports basic html markup tags for formatting the label. For example:&lt;/p>
216-
&lt;p>&lt;span style="font-family:Courier New">&amp;lt;B&amp;gt; &lt;/span>&lt;span style="font-family:Courier New;font-weight:600">Bold text&lt;/span>&lt;span style="font-family:Courier New"> &amp;lt;/B&amp;gt;&lt;br />&amp;lt;I&amp;gt; &lt;/span>&lt;span style="font-family:Courier New;font-style:italic">Italics&lt;/span>&lt;span style="font-family:Courier New"> &amp;lt;/I&amp;gt;&lt;/span>&lt;/p>
217-
&lt;/body>&lt;/html>
218-
</string>
219-
</property>
220-
<property name="wordWrap" >
221-
<enum>Q3TextEdit::WidgetWidth</enum>
222-
</property>
223-
<property name="readOnly" >
224-
<bool>true</bool>
225-
</property>
226-
</widget>
227-
</item>
228-
<item rowspan="4" row="0" column="0" >
229-
<widget class="QLabel" name="pixmapLabel2" >
230-
<property name="maximumSize" >
231-
<size>
232-
<width>150</width>
233-
<height>32767</height>
234-
</size>
235-
</property>
236-
<property name="pixmap" >
237-
<pixmap resource="copyright_plugin.qrc" >:/copyright.png</pixmap>
238-
</property>
239-
<property name="scaledContents" >
240-
<bool>true</bool>
241-
</property>
242-
</widget>
243-
</item>
244-
<item rowspan="4" row="0" column="1" >
245-
<widget class="Line" name="line1" >
246-
<property name="maximumSize" >
247-
<size>
248-
<width>2</width>
249-
<height>32767</height>
250-
</size>
251-
</property>
252-
<property name="frameShape" >
253-
<enum>QFrame::VLine</enum>
254-
</property>
255-
<property name="frameShadow" >
256-
<enum>QFrame::Sunken</enum>
257-
</property>
258-
<property name="orientation" >
259-
<enum>Qt::Vertical</enum>
260-
</property>
261-
</widget>
262-
</item>
263231
</layout>
264232
</widget>
265233
<layoutdefault spacing="6" margin="11" />
266234
<pixmapfunction></pixmapfunction>
267-
<customwidgets>
268-
<customwidget>
269-
<class>Q3TextEdit</class>
270-
<extends></extends>
271-
<header>q3textedit.h</header>
272-
<container>0</container>
273-
<pixmap></pixmap>
274-
</customwidget>
275-
</customwidgets>
276235
<resources>
277236
<include location="copyright_plugin.qrc" />
278237
</resources>

0 commit comments

Comments
 (0)
Please sign in to comment.