×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    15

    Need help in setting the background of a QListPickSelector entry to an image ..

    Hi all .... I'm using a QListPickSelector in my project and the idea is that it displays a set of images, rather than a list of strings .. Now I have tried using the setIcon() function, which works, but the image displayed is very tiny .. !

    Here is the output I get when I use the setIcon() function:



    As you can see, the image displayed is *very* tiny ... I would like it to be filled throughout its respective list entry area (which is also rectangular) ...

    I am trying to use the setBackground() function by passing it a QBrush, which has the said image as its texture .. but when I try this, nothing happens, the background is setting black as usual .. Can somebody help me with this .. ?

    Here is one variable of many different combinations I have tried:

    Code:
    QBrush brush;
    brush.setTexture(QPixmap(":/p1.png"));
    brush.setStyle(Qt::TexturePattern);
    
    QStandardItemModel *model = new QStandardItemModel(10,2);
    int i,j,k;
    for(j=0;j<=1;j++)
    {
          k=0;
          for(i=0;i<=9;i++)
          {
             QStandardItem *item = new QStandardItem("Hello");
             QStandardItem itemx;
             item->setBackground(brush);
             k+=5;
             model->setItem(i,j,item);
          }
    }
    canvasBackgroundTypeSelector->setModel(model);
    I really need help with this ..

  2. #2
    Registered User
    Join Date
    Jul 2009
    Posts
    15

    Re: Need help in setting the background of a QListPickSelector entry to an image ..

    Can someone help me with this please ?

  3. #3
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Need help in setting the background of a QListPickSelector entry to an image ..


  4. #4
    Registered User
    Join Date
    Jul 2009
    Posts
    15

    Re: Need help in setting the background of a QListPickSelector entry to an image ..

    Quote Originally Posted by divanov View Post
    No sadly QMaemo5ListPickSelector does not inherit from QAbstractItemView, so there is no method in QMaemo5ListPickSelector for changing the icon size .... Or have I misunderstood what you were trying to suggest ?

Similar Threads

  1. Replies: 47
    Last Post: 2009-07-21, 11:08
  2. Replies: 2
    Last Post: 2009-03-09, 00:14
  3. problem in display an image button on canvas(Background image)
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-11-12, 04:51
  4. Setting a background image on CAknGrid
    By aljaz24 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-01-30, 08:40

Posting Permissions

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