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

QTabWidget::tabText return string with ampersand (&) prepended (linux plasma-kde)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.5.0
    • None

    Description

      After addition of tab in a QTabWidget, when I try to get the tab text, I get a string with an ampersand prepended.
      I tested it with an environnement kde free (a fresh debian VM with XFCE; either french or english) and I got the usual behaviour, but when I install the package kde-full (with the plasma environnement) I get the wrong behaviour; to be more precise: when I have installed both and at the same time XFCE and KDE(plasma):

      • in XFCE: I get the goog behaviour
      • in KDE: I got the wrong behaviour

      It seems that there is a bad interaction with plasme/KDE:

      • right after addition of a tab if I display the label, I get the good text
      • but later (another GUI event), I get the bad text

      I tested with Windows and all is good.

      Description of the snipped code:
      ----------------------------------------

      • through QtCreator creation of an Application with widget
      • addition of an QTabWidget with no page
      • addition of a pushbutton
      • in the MainWindow creator addition of a tab with a label
      • when click on the button display of the tab's label

      this my snipped code:

      -------------------------------
      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      #include <QPlainTextEdit>
      #include <QDebug>
      MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
      {
        ui->setupUi(this);
        ui->tabWidget->addTab(new QPlainTextEdit, "a sentence");
      }
      
      MainWindow::~MainWindow()
      {
        delete ui;
      }
      
      void MainWindow::on_pushButton_clicked()
      {
        qDebug() << ui->tabWidget->tabText(0);
        // it display in the output window:  "&a sentence"
      }
      ------------------------------
      

      Here the ldd output on the binary:
      --------------
      linux-vdso.so.1 (0x00007ffff7305000)
      libQt5Widgets.so.5 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libQt5Widgets.so.5 (0x00007f808e697000)
      libQt5Gui.so.5 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libQt5Gui.so.5 (0x00007f808de84000)
      libQt5Core.so.5 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libQt5Core.so.5 (0x00007f808d73f000)
      libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f808d4a7000)
      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f808d28a000)
      libstdc+.so.6 => /usr/lib/x86_64-linux-gnu/libstdc+.so.6 (0x00007f808cf7e000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f808cc7d000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f808ca67000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f808c6be000)
      libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f808c46c000)
      libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f808c26a000)
      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f808c062000)
      libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f808bd53000)
      libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f808bb41000)
      libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f808b7fe000)
      libicui18n.so.54 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libicui18n.so.54 (0x00007f808b390000)
      libicuuc.so.54 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libicuuc.so.54 (0x00007f808afe2000)
      libicudata.so.54 => /home/melidrissi/.root/Applications/Qt5.5.0/5.5/gcc_64/lib/libicudata.so.54 (0x00007f80895b8000)
      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f80893b4000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f808ef15000)
      libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f808918b000)
      libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f8088f5d000)
      libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f8088d5a000)
      libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f8088b54000)
      libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f8088952000)
      libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f8088739000)
      libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f8088534000)
      libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f8088331000)
      libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f808812e000)
      libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f8087f27000)
      libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f8087d05000)
      libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f8087b02000)
      libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f80878fc000)
      libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f80876ee000)
      libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f80874e5000)
      libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8087277000)
      libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f8087073000)
      libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f8086e6d000)

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            lem__mel Majid EL IDRISSI
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes