×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    CAknListQueryDialog with icons

    hi,

    id like to have a CAknListQueryDialog with icons on left side and text on the right.
    I have a text and a icon array.

    dlg->SetItemTextArray( itemList );
    dlg->SetIconArrayL(iconList)

    listbox = AVKON_LIST_QUERY_LIST
    when i use listtype = EAknCtSingleGraphicPopupMenuListBox; in resource, i only see the text.
    when i use listtype = EAknCtSingleGraphicListBox; i only see the icons on the right side?, but no text??

    whats going on here? any suggestions?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,168

    Re: CAknListQueryDialog with icons

    you should check the column format, and use it right way with the text string. i.e. do remember to put tab-characters there.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknListQueryDialog with icons

    Search for something like listbox item format in the documentation or the on-line library (http://library.developer.nokia.com/), and you will find something like http://library.developer.nokia.com/i...ists_API3.html pretty fast (this latter link probably has to be opened twice)

  4. #4
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    Got it

    Thanks to both of you guys! i really appreciate your help!

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    hmm, i encountered another problem now.

    when i have a small list with about 10 items all is ok.
    but with 100 or more items the app crashes some seconds after i exit the CAknListQueryDialog?
    When i scroll the list all is ok, so it should be no memory issue? right?

    dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );
    dlg->SetIconArrayL(iconList);
    CleanupStack::Pop(iconList);
    i tried to change ownership, or rise the heap size, but it does not help?
    Heap size is at approx 8Mb now.

    Any reason for this?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknListQueryDialog with icons

    Consider enabling the error messages if you have not done that yet: http://www.developer.nokia.com/Commu...ded_panic_code

  7. #7
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    when i build the app with "phone release" the CAknListQueryDialog opens and when i exit the CAknListQueryDialog the app closes and i get a KERN-EXEC 3 error.

    when i build the app with "phone debug" the CAknListQueryDialog does not open, the app directly closes and i get a E32USER-CBase 90 error.

    i think the error gets created by CleanupStack::Pop(iconList):

    CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(1);
    CleanupStack::PushL(iconList);

    for (TInt i=0;i<X;i++)
    {
    TRAPD(err,icon= LoadIcon());
    if (err==KErrNotFound)
    {....}
    iconList->AppendL(icon);
    }

    dlg->SetIconArrayL(iconList);
    CleanupStack::Pop(iconList);
    But i dont understand whats the problem here?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknListQueryDialog with icons

    Note that this "ErrRd" thing also works in the emulator, where you can debug with complete stack traces. It can be togggled from its menu (Tools perhaps, I do not have any SDK here and now), also enable Just In Time debugging there, then the debugger will show you exactly where the panic gets raised.
    From this code snippet, those PushL and Pop are paired correctly. Unless {...} does something nasty of course.

  9. #9
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    did some further testing. When i use 150 icons in CAknListQueryDialog, the code is working. If there are e.g. 250, the app will crash on CAknListQueryDialog exit.
    So when the dialog is closed and the dialog holds 250 items the app will crash??

    this is really strange?? whats the problem here?

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknListQueryDialog with icons

    That loop may run out of memory. Since you TRAPD the LoadIcon call, it does not leave, crash, etc. However at the end the icon array may contain less elements than what you are going to index later.
    LoadIcon would be better called LoadIconL, by the way.
    EPOCHEAPSIZE is the statement which can help you in increasing your heap (in the .mmp file). By default you have 1 megabyte only. The .mmp editor of Carbide.c++ also has a setting for it somewhere.

  11. #11
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    If the loop ran out of memory, i guess the QueryDialog would not even open? But it does open and display all icons correctly. (Already rised heap to 8Mb)

    But when i select a item, press ok or cancel the app crashes. This makes no sense to me?
    Last edited by shizzl; 2012-10-20 at 19:11.

  12. #12
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,089

    Re: CAknListQueryDialog with icons

    If you do not use the icons at all with the list items , then also the same problem persists?

  13. #13
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    no, without the icons everything is working fine.


    but when the dialog with icons gets destroyed on exit, app crashes

  14. #14
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: CAknListQueryDialog with icons

    You have shown
    Code:
    {
        TRAPD(err,icon= LoadIcon());
        if (err==KErrNotFound)
        {....}
        iconList->AppendL(icon);
    }
    so far it checks for KErrNotFound only
    Code:
    {
        TRAPD(err,icon= LoadIcon());
        if (err==KErrNotFound)
        {....}
        else User::LeaveIfError(err);
        iconList->AppendL(icon);
    }
    would re-throw any other leave codes instead of ignoring them.

  15. #15
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: CAknListQueryDialog with icons

    I have identified the error. If err==KErrNotFound i load a icon created in AppUi.
    It gets displayed in the QueryDialog, but i guess it crashes the app after i exit the QueryDialog.

    Whats the problem in using a pointer to AppUi?

    Unless {...} does something nasty of course.
    seems it really is something nasty..

    {
    TRAPD(err,icon= LoadIcon());
    if (err==KErrNotFound)
    {icon= ((CMyAppAppUi*)AppUi())->Folder_icon;}
    iconList->AppendL(icon);
    }

Similar Threads

  1. Created icons doesn't showup,Only default icons shown
    By shintu in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-11-06, 15:59
  2. Icons in CAKnListQueryDialog
    By gmsk19 in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-10-24, 10:46

Posting Permissions

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