Skip to content

Commit be5d657

Browse files
committed
[processing] use simple QLabel widgets for toolbox tips
1 parent 473e3ea commit be5d657

File tree

2 files changed

+34
-37
lines changed

2 files changed

+34
-37
lines changed

python/plugins/processing/gui/ProcessingToolbox.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,12 @@ def __init__(self):
6464
self.algorithmTree.doubleClicked.connect(self.executeAlgorithm)
6565
self.txtDisabled.setVisible(False)
6666
self.txtTip.setVisible(self.disabledProviders())
67-
self.txtDisabled.setOpenLinks(False)
68-
self.txtTip.setOpenLinks(False)
69-
self.txtDisabled.connect(self.txtDisabled, SIGNAL("anchorClicked(const QUrl&)"),
70-
self.showDisabled)
71-
67+
self.txtDisabled.linkActivated.connect(self.showDisabled)
7268
def openSettings():
7369
dlg = ConfigDialog(self)
7470
dlg.exec_()
7571
self.txtTip.setVisible(self.disabledProviders())
76-
self.txtTip.connect(self.txtTip, SIGNAL("anchorClicked(const QUrl&)"), openSettings)
72+
self.txtTip.linkActivated.connect(openSettings)
7773
if hasattr(self.searchBox, 'setPlaceholderText'):
7874
self.searchBox.setPlaceholderText(self.tr('Search...'))
7975

python/plugins/processing/ui/ProcessingToolbox.ui

+32-31
Original file line numberDiff line numberDiff line change
@@ -44,49 +44,50 @@
4444
</widget>
4545
</item>
4646
<item>
47-
<widget class="QTextBrowser" name="txtDisabled">
48-
<property name="maximumSize">
49-
<size>
50-
<width>16777215</width>
51-
<height>50</height>
52-
</size>
47+
<widget class="QLabel" name="txtDisabled">
48+
<property name="autoFillBackground">
49+
<bool>false</bool>
5350
</property>
5451
<property name="styleSheet">
5552
<string notr="true">background-color: rgb(255, 255, 127);</string>
5653
</property>
57-
<property name="html">
58-
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
59-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
60-
p, li { white-space: pre-wrap; }
61-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
62-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;There are disabled providers that contain algorithms including your text string. Click &lt;/span&gt;&lt;a href=&quot;view&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;to view them.&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
54+
<property name="frameShape">
55+
<enum>QFrame::Box</enum>
56+
</property>
57+
<property name="frameShadow">
58+
<enum>QFrame::Raised</enum>
59+
</property>
60+
<property name="text">
61+
<string>There are disabled providers that contain algorithms including your text string. Click &lt;a href=&quot;view&quot;&gt;to view them.&lt;/a&gt;</string>
62+
</property>
63+
<property name="wordWrap">
64+
<bool>true</bool>
65+
</property>
66+
<property name="margin">
67+
<number>5</number>
6368
</property>
6469
</widget>
6570
</item>
6671
<item>
67-
<widget class="QTextBrowser" name="txtTip">
68-
<property name="sizePolicy">
69-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
70-
<horstretch>0</horstretch>
71-
<verstretch>0</verstretch>
72-
</sizepolicy>
73-
</property>
74-
<property name="maximumSize">
75-
<size>
76-
<width>16777215</width>
77-
<height>50</height>
78-
</size>
79-
</property>
72+
<widget class="QLabel" name="txtTip">
8073
<property name="styleSheet">
8174
<string notr="true">background-color: rgb(85, 170, 255);
8275
color: rgb(255, 255, 255);</string>
8376
</property>
84-
<property name="html">
85-
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
86-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
87-
p, li { white-space: pre-wrap; }
88-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
89-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;You can add more algorithms to the toolbox,&lt;/span&gt;&lt;a href=&quot;enable&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;enabling additional providers.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
77+
<property name="frameShape">
78+
<enum>QFrame::Box</enum>
79+
</property>
80+
<property name="frameShadow">
81+
<enum>QFrame::Raised</enum>
82+
</property>
83+
<property name="text">
84+
<string>You can add more algorithms to the toolbox,&lt;a href=&quot;enable&quot;&gt;enabling additional providers.&lt;/a&gt;</string>
85+
</property>
86+
<property name="wordWrap">
87+
<bool>true</bool>
88+
</property>
89+
<property name="margin">
90+
<number>5</number>
9091
</property>
9192
</widget>
9293
</item>

0 commit comments

Comments
 (0)