Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2256

QLabel displays '&' if it has a buddy and focus policy is set to Qt::ClickFocus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 4.6.1
    • 4.4.0
    • None

    Description

      In the form below, preview it with Designer and click on the label. A '&' character will be inserted in the QLabel. This has been confirmed in Qt 4.3 and 4.4.0. The same behavior happens with hand-written code (i.e. no use of Designer).

      Designer form to reproduce:
      -----------------------------------------------------------------------------------
      <ui version="4.0" >
      <class>MainWindow</class>
      <widget class="QMainWindow" name="MainWindow" >
      <property name="geometry" >
      <rect>
      <x>0</x>
      <y>0</y>
      <width>154</width>
      <height>123</height>
      </rect>
      </property>
      <property name="windowTitle" >
      <string>MainWindow</string>
      </property>
      <widget class="QWidget" name="centralwidget" >
      <layout class="QVBoxLayout" >
      <item>
      <widget class="QLineEdit" name="lineEdit" />
      </item>
      <item>
      <layout class="QHBoxLayout" >
      <item>
      <widget class="QLabel" name="label" >
      <property name="focusPolicy" >
      <enum>Qt::ClickFocus</enum>
      </property>
      <property name="text" >
      <string>&TextLabel</string>
      </property>
      <property name="buddy" >
      <cstring>comboBox</cstring>
      </property>
      </widget>
      </item>
      <item>
      <widget class="QComboBox" name="comboBox" >
      <item>
      <property name="text" >
      <string>asdfas</string>
      </property>
      </item>
      <item>
      <property name="text" >
      <string>23r23423tr</string>
      </property>
      </item>
      </widget>
      </item>
      </layout>
      </item>
      </layout>
      </widget>
      <widget class="QMenuBar" name="menubar" >
      <property name="geometry" >
      <rect>
      <x>0</x>
      <y>0</y>
      <width>154</width>
      <height>29</height>
      </rect>
      </property>
      </widget>
      <widget class="QStatusBar" name="statusbar" />
      </widget>
      <resources/>
      <connections/>
      </ui>
      -----------------------------------------------------------------------------------

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes