示例#1
0
AppletWidget::AppletWidget(const AppletInfo& info, bool odd, QWidget *parent)
    : AppletItem(parent),
      m_appletInfo(info),
      m_odd(odd),
      m_selected(false)
{
    setFocusPolicy(QWidget::StrongFocus);
    setSelected(m_selected);
    
    itemTitle->setText("<h3>" + info.name() + "</h3>");
    itemTitle->installEventFilter(this);

    if (info.comment() != info.name())
    {
        itemDescription->setText(info.comment());
    }

    itemDescription->installEventFilter(this);

    KIconLoader * ldr = KGlobal::iconLoader();
    QPixmap icon = ldr->loadIcon(info.icon(), KIcon::Panel, KIcon::SizeLarge);
    itemPixmap->setPixmap(icon);
    itemPixmap->installEventFilter(this);
}
示例#2
0
bool AppletInfo::operator>(const AppletInfo &rhs) const
{
    return (QString::localeAwareCompare(name(), rhs.name()) > 0);
}