コード例 #1
0
void BackupListWidget::removeItems()
{
    if(selectedItems().count() == 0)
    {
        // attempt to remove the sender
        BackupListItem* backupItem = qobject_cast<BackupListItem*>(sender());
        if(backupItem) delete backupItem;
    }
    else
    {
        foreach(QListWidgetItem *item, selectedItems())
        {
            if(item && item->isSelected())
                delete item;
        }
    }
    recomputeListTotals();
}
コード例 #2
0
void BackupListWidget::addItemsWithUrls(QList<QUrl> urls)
{
    foreach(QUrl url, urls)
        addItemWithUrl(url);
    recomputeListTotals();
}
コード例 #3
0
void BackupListWidget::changeEvent(QEvent *event)
{
    if(event->type() == QEvent::LanguageChange)
        recomputeListTotals();
    QWidget::changeEvent(event);
}