本文整理汇总了C++中Basket::basketName方法的典型用法代码示例。如果您正苦于以下问题:C++ Basket::basketName方法的具体用法?C++ Basket::basketName怎么用?C++ Basket::basketName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Basket
的用法示例。
在下文中一共展示了Basket::basketName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateToolTipDelayed
void SystemTray::updateToolTipDelayed()
{
Basket *basket = Global::bnpView->currentBasket();
QString tip = "<p><nobr>" + ( basket->isLocked() ? KDialog::makeStandardCaption(i18n("%1 (Locked)"))
: KDialog::makeStandardCaption( "%1") )
.arg(Tools::textToHTMLWithoutP(basket->basketName()));
QToolTip::add(this, tip);
}
示例2: updateDisplay
/** Updates the icon and tooltip in the system tray */
void SystemTray::updateDisplay()
{
Basket *basket = Global::bnpView->currentBasket();
if (!basket)
return;
// Update the icon
if (basket->icon().isEmpty()
|| basket->icon() == "basket"
|| !Settings::showIconInSystray())
setIcon(basket->isLocked() ? m_lockedIcon : m_icon);
else {
// Code that comes from JuK:
QPixmap bgPix = loadIcon("basket").pixmap(m_iconSize);
int smallIconSize = kapp->style()->pixelMetric(QStyle::PM_SmallIconSize);
QPixmap fgPix = loadIcon(basket->icon()).pixmap(smallIconSize);
QImage bgImage = bgPix.toImage(); // Probably 22x22
QImage fgImage = fgPix.toImage(); // Should be 16x16
KIconEffect::semiTransparent(bgImage);
copyImage(bgImage, fgImage, bgImage.width()-fgImage.width() / 2,
bgImage.height()-fgImage.height() / 2);
if (basket->isLocked()) {
QImage lockOverlay = loadIcon("lockoverlay").pixmap(m_iconSize).toImage();
KIconEffect::overlay(bgImage, lockOverlay);
}
setIcon(QPixmap::fromImage(bgImage));
}
// update the tooltip
QString tip = "<p><nobr>";
QString basketName = "%1";
if (basket->isLocked())
basketName += i18n(" (Locked)");
tip += KDialog::makeStandardCaption(basketName);
tip = tip.arg(Tools::textToHTMLWithoutP(basket->basketName()));
setToolTip(tip);
}