[mythtv] Image is a null image

Alvaro Gonzalez Sola cojonuo at gmail.com
Wed Aug 27 10:11:21 UTC 2008


When use image on MythUIB uttonListItem constructor

I recibe this Exception

    QImage::scaled: Image is a null image

This is my code:

    //add all channel on m_channels
    for (Channel *program = m_channels.first(); program; program = 
m_channels.next())
    {
        MythImage *image = GetMythPainter()->GetFormatImage();
        QString imgFile = program->channelDir() + "/logo";

        if(QFile::exists(imgFile)){
            image->Load(imgFile);
            MythUIButtonListItem* item =
                new MythUIButtonListItem(m_channelList, 
program->name(),image);
            item->setData(program);
         }
         else{
            MythUIButtonListItem* item =
                new MythUIButtonListItem(m_channelList, program->name());
            item->setData(program);
         }
    }

If not exist "logo" i call MythUIButtonListItem without image but 
painter return exception ¿why?
This don't appear only if all item don't has image.

What can I do?

Is posible add a default image on xml to a button?? (note: no background)

thanks


More information about the mythtv-dev mailing list