Bug 295485

Summary: repository names are cut off
Product: [openSUSE] openSUSE 10.3 Reporter: Stephan Kulow <coolo>
Component: YaST2Assignee: Stefan Hundhammer <shundhammer>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: locilka
Version: Alpha 6   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot of qemu
ncurses
Qt
screen shot of MultiSelectionBox with long text
Simple UI testcase to show the problem
Test case

Description Stephan Kulow 2007-07-29 08:22:31 UTC
The repository names are cut. Is this for ncurses? Attaching screenshot
Comment 1 Stephan Kulow 2007-07-29 08:23:44 UTC
Created attachment 153769 [details]
screenshot of qemu
Comment 2 Lukas Ocilka 2007-07-29 20:35:41 UTC
No, this is feature of YaST-Qt (or maybe just Qt).
Comment 3 Stefan Hundhammer 2007-07-30 10:09:33 UTC
That's not in the C++ YQPackageSelector, it's in the YCP repository selection.
-> jsuchome
Comment 4 Stefan Hundhammer 2007-07-30 10:10:40 UTC
Oops, sorry, wrong maintainer: lslezak
Comment 5 Ladislav Slezák 2007-08-02 13:37:31 UTC
Back to Lukas... :-)
Comment 6 Lukas Ocilka 2007-08-02 13:49:15 UTC
Err, this is a feature/bug of MultiSelectionBox in Qt. It works well in ncurses.
I'll attach screenshots.
Comment 7 Lukas Ocilka 2007-08-02 13:49:45 UTC
Created attachment 155198 [details]
ncurses
Comment 8 Lukas Ocilka 2007-08-02 13:50:00 UTC
Created attachment 155199 [details]
Qt
Comment 9 Stefan Hundhammer 2007-08-02 14:00:09 UTC
{
    // Simple MultiSelectionBox example:
    //
    // All items are simple strings, none has an ID, no item preselected.

    UI::OpenDialog(
               `VBox(
                     `MultiSelectionBox( "Select pizza toppings:",
                                         [
                                          "Cheese with a very damn long description that can get even longer than you think",
                                          "Tomatoes",
                                          "Mushrooms",
                                          "Onions",
                                          "Salami",
                                          "Ham"
                                         ] ),
                     `PushButton("&OK")
                     )
               );
    UI::UserInput();
    UI::CloseDialog();
}
Comment 10 Stefan Hundhammer 2007-08-02 14:01:56 UTC
Created attachment 155205 [details]
screen shot of MultiSelectionBox with long text

if it allegedly doesn't work in general, why does it work with the simplest UI example we have (MultiSelectionBox1.ycp with longer text)?
Comment 11 Stefan Hundhammer 2007-08-02 14:03:13 UTC
Please check the YCP code.
Comment 12 Stanislav Visnovsky 2007-08-02 14:16:17 UTC
Created attachment 155206 [details]
Simple UI testcase to show the problem

The wrong behavior is introduced by using UI::ChangeWidget
Comment 13 Stanislav Visnovsky 2007-08-02 14:16:53 UTC
Stefan, please, check again.
Comment 14 Stefan Hundhammer 2007-08-03 10:35:11 UTC
Some experiments with a modified MultiSelectionBox-replace-items1.ycp example show that it is indeed a Qt specific problem: The first UI::ChangeWidget() call to a MultiSelectionBox with wider content than before cuts off some characters. Subsequent calls do what is expected.

It's really a bug in QListView, but there seems to be a simple workaround: Calling QListView::header()->setStretchEnabled( true ) fixes the problem (although according to the Qt documentation this should not be necessary; QListView::addColumn( xy ) should do the same thing).
Comment 15 Stefan Hundhammer 2007-08-03 10:37:28 UTC
Created attachment 155433 [details]
Test case

Toggle the "Vegetarian" check box in this example to see the effect. Only the first toggle cuts off any text, any subsequent toggle will set the correct width.