Wireshark mailing list archives

C++ help - call QLabel::setText for ElidedLabel


From: chuck c <bubbasnmp () gmail com>
Date: Wed, 2 Dec 2020 19:43:18 -0600

The italic text in a path label at the bottom of a UAT editor gets clipped.
https://bugreports.qt.io/browse/QTBUG-53502

The easy fix is to add a " " space to the text but because it's underlined,
the space at end shows up as an underline. I have tried the fix mentioned
(setMargin) mentioned in the Qt bug - no luck.

Adding a space to the end after the HTML works but I don't want to change
elided_label.cpp.

If I could call QLabel::setText on ui->pathLabel then I can replace the
text with a " " appended.
Is there a way to do this?

thanks
chuckc

https://gitlab.com/wireshark/wireshark/-/blob/master/ui/qt/widgets/elided_label.cpp

void ElidedLabel::setText(const QString &text)
{
    full_text_ = text;
    updateText();
}

https://gitlab.com/wireshark/wireshark/-/blob/master/ui/qt/uat_dialog.cpp

        QString abs_path =
gchar_free_to_qstring(uat_get_actual_filename(uat_, FALSE));
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
 ui->pathLabel->setToolTip(tr("Open ") + uat->filename);
ui->pathLabel->setEnabled(true);
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: