×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    49

    Broken vertical scrolling with QListWidget::setItemWidget() and some MMP Warnings

    Hello,

    I have a QListWidget with some buttons inside it (added using setItemWidget()). When I add enough items automatic vertical scrollbar appears. However, the scrollbar does not work (I'm able to move outside borders and it does not follow). Here is a code example:

    Code:
    #include <QtGui>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QWidget main;
    
        QListWidget *list =  new QListWidget();
        list->setFixedHeight(100);
        new QListWidgetItem("a", list);
        new QListWidgetItem("b", list);
        new QListWidgetItem("c", list);
        new QListWidgetItem("d", list);
        new QListWidgetItem("e", list);
        new QListWidgetItem("f", list);
        new QListWidgetItem("g", list);
    
        list->setItemWidget(list->item(0), new QPushButton("click"));
        list->setItemWidget(list->item(1), new QPushButton("click"));
        list->setItemWidget(list->item(2), new QPushButton("click"));
        list->setItemWidget(list->item(3), new QPushButton("click"));
        list->setItemWidget(list->item(4), new QPushButton("click"));
        list->setItemWidget(list->item(5), new QPushButton("click"));
        list->setItemWidget(list->item(6), new QPushButton("click"));
    
        QVBoxLayout layout;
        layout.addWidget(list);
    
        main.setLayout(&layout);
        main.showMaximized();
    
        return app.exec();
    }
    If you remove the setItemWidget() calls scrolling works once again. Also on E51 (E71 works fine), if you leave just one button (e.g. index 1), scrolling works as long as you don't move on the last item (index 6). If you do, then pressing the "up" key sets focus directly on the button and not on the item above the selected one (index 5). Anyone else faced similar problems and/or can provide some info how to fix them?

    Edit: I was able to fix this issue by setting FocusPolicy to NoFocus on the buttons. After that I added required functionality under QListWidget::itemActivated(QListWidgetItem*) signal.


    In addition, I moved recently from 4.6.2 to 4.6.3. I noticed that during the compilation I get warnings from the MMPFile (even when compiling an empty project). I have ignored these warning because everything seems to be working. Is there any way to remove those SYSTEMINCLUDE paths from the automatically generated MMP file (in case they are not required)?
    Code:
    perl -S makmake.pl -D \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F GCCE
    MMPFILE "\Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP"
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(47) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(48) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\sys\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(51) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\stlport\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(53) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\oem\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(56) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(57) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(58) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\loc\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(60) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\loc\sc\" not found
    WARNING: \Symbian\tests\listwidget\LISTWIDGET_0XEEB5F06F.MMP(61) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\middleware\loc\sc\" not found

    Environment: Win7, Qt4.6.2/3, QtCreator 1.3.1 and Nokia E51/E71
    Last edited by Tuomo; 2010-06-29 at 10:29.

Similar Threads

  1. Vertical scrolling in editor over a large image
    By hclemson in forum Symbian User Interface
    Replies: 2
    Last Post: 2012-02-23, 11:17
  2. Vertical Scrolling in Canvas
    By daisy_deepa@yahoo.com in forum Mobile Java Games
    Replies: 2
    Last Post: 2007-10-16, 18:04
  3. Replies: 3
    Last Post: 2006-08-29, 07:09
  4. Vertical scrolling text with background
    By Elwoodini in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-04-23, 00:15
  5. Vertical scrolling text
    By Elwoodini in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-02, 01:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×