Unsolved I want to remove automatique shortcut (&) on Qlabel
-
in QtDesigner i created few Qlabel but char (&) appear on some of them and when i run appli letter on text are underlined, i deleted them but as soon i run appli they appear again.
Is there a way to remove those & or _ in menu too.If some one could help me........
-
@brashen I can't reproduce this.
Can you show an example text you put into your QLabel which shows this behaviour? -
@jsulm
here attached a base of my interface, I could not remove underline (&) on label if i delete text the underline goes to next label.
[0_1565192418484_win_principale.ui](Uploading 100%) -
@brashen said in I want to remove automatique shortcut (&) on Qlabel:
here attached a base of my interface
Unfortunately, we can't see your file because this forum doesn't support file uploads.
Please create a minimal example and then copy+paste the XML text from your *.ui file.
-
Hi, I only get that (old Windows behavior) on QPushButtons, not on QLabels. Anyway, to make an & appear as normal and not cause any underlines, just double them, i.e. write 2 && instead of 1.
-
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>win_liste_banques</class>
<widget class="QDialog" name="win_liste_banques">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>269</width>
<height>278</height>
</rect>
</property>
<property name="windowTitle">
<string>Banques</string>
</property>
<property name="windowIcon">
<iconset resource="images/images.qrc">
<normaloff>:/banque.png</normaloff>:/banque.png</iconset>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>227</width>
<height>242</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">id :</string>
</property>
<property name="buddy">
<cstring>txt_id</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txt_id">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"><id></string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">no&m :</string>
</property>
<property name="buddy">
<cstring>txt_nom</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txt_nom">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">adresse :</string>
</property>
<property name="buddy">
<cstring>txt_adresse</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="txt_adresse">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">con&tact :</string>
</property>
<property name="buddy">
<cstring>txt_contact</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="txt_contact">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">IBAN :</string>
</property>
<property name="buddy">
<cstring>txt_iban</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="txt_iban">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">S&WIFT :</string>
</property>
<property name="buddy">
<cstring>txt_swift</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="txt_swift">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">Télép&hone :</string>
</property>
<property name="buddy">
<cstring>txt_telephone</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="txt_telephone">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">E-&mail :</string>
</property>
<property name="buddy">
<cstring>txt_email</cstring>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="txt_email">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string notr="true"/>
</property>
<property name="statusTip">
<string notr="true"/>
</property>
<property name="whatsThis">
<string notr="true"/>
</property>
<property name="accessibleName">
<string notr="true"/>
</property>
<property name="accessibleDescription">
<string notr="true"/>
</property>
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources>
<include location="images/images.qrc"/>
</resources>
<connections/>
</ui> -
@Brashen What version of Qt are you using?
The XML document that you posted was corrupted. Try replacing your file with this and see if the problem remains:
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>win_liste_banques</class> <widget class="QDialog" name="win_liste_banques"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>269</width> <height>278</height> </rect> </property> <property name="windowTitle"> <string>Banques</string> </property> <property name="windowIcon"> <iconset> <normaloff>:/banque.png</normaloff>:/banque.png</iconset> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <widget class="QWidget" name="layoutWidget"> <property name="geometry"> <rect> <x>10</x> <y>10</y> <width>227</width> <height>242</height> </rect> </property> <layout class="QFormLayout" name="formLayout"> <item row="0" column="0"> <widget class="QLabel" name="label"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">id :</string> </property> <property name="buddy"> <cstring>txt_id</cstring> </property> </widget> </item> <item row="0" column="1"> <widget class="QLineEdit" name="txt_id"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"><id></string> </property> <property name="frame"> <bool>false</bool> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> <property name="readOnly"> <bool>true</bool> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="label_2"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">nom :</string> </property> <property name="textFormat"> <enum>Qt::PlainText</enum> </property> <property name="buddy"> <cstring>txt_nom</cstring> </property> </widget> </item> <item row="1" column="1"> <widget class="QLineEdit" name="txt_nom"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="2" column="0"> <widget class="QLabel" name="label_3"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">adresse :</string> </property> <property name="buddy"> <cstring>txt_adresse</cstring> </property> </widget> </item> <item row="2" column="1"> <widget class="QLineEdit" name="txt_adresse"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="3" column="0"> <widget class="QLabel" name="label_4"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">contact :</string> </property> <property name="buddy"> <cstring>txt_contact</cstring> </property> </widget> </item> <item row="3" column="1"> <widget class="QLineEdit" name="txt_contact"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="4" column="0"> <widget class="QLabel" name="label_5"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">IBAN :</string> </property> <property name="buddy"> <cstring>txt_iban</cstring> </property> </widget> </item> <item row="4" column="1"> <widget class="QLineEdit" name="txt_iban"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="5" column="0"> <widget class="QLabel" name="label_6"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">SWIFT :</string> </property> <property name="buddy"> <cstring>txt_swift</cstring> </property> </widget> </item> <item row="5" column="1"> <widget class="QLineEdit" name="txt_swift"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="6" column="0"> <widget class="QLabel" name="label_7"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">Téléphone :</string> </property> <property name="buddy"> <cstring>txt_telephone</cstring> </property> </widget> </item> <item row="6" column="1"> <widget class="QLineEdit" name="txt_telephone"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> <item row="7" column="0"> <widget class="QLabel" name="label_8"> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="text"> <string notr="true">E-mail :</string> </property> <property name="buddy"> <cstring>txt_email</cstring> </property> </widget> </item> <item row="7" column="1"> <widget class="QLineEdit" name="txt_email"> <property name="mouseTracking"> <bool>false</bool> </property> <property name="acceptDrops"> <bool>false</bool> </property> <property name="toolTip"> <string notr="true"/> </property> <property name="statusTip"> <string notr="true"/> </property> <property name="whatsThis"> <string notr="true"/> </property> <property name="accessibleName"> <string notr="true"/> </property> <property name="accessibleDescription"> <string notr="true"/> </property> <property name="inputMask"> <string notr="true"/> </property> <property name="text"> <string notr="true"/> </property> <property name="placeholderText"> <string notr="true"/> </property> </widget> </item> </layout> </widget> </widget> <resources> <include location="images/images.qrc"/> </resources> <connections/> </ui>
-
I copy your XML in a new file .ui , i open it with Qt designer and ampersand comes back. I use QT 5.11.3 , qt creator 4.8.2 on debian buster
-
@brashen said in I want to remove automatique shortcut (&) on Qlabel:
I copy your XML in a new file .ui , i open it with Qt designer and ampersand comes back.
That's very strange. I don't get any ampersands (Windows 10, Qt 5.12.3, Qt Creator 4.9.1).
What is your computer's locale?
Try using a text editor like gedit to copy and paste my XML into a new .ui file. Make sure you save it with the UTF-8 character encoding.
-
I change PC i install for clean disks Buster and all stuff , still the same !!! & appear on random in few labels.
-
@Brashen said in I want to remove automatique shortcut (&) on Qlabel:
I change PC i install for clean disks Buster and all stuff , still the same !!! & appear on random in few labels.
See my previous post