當前位置: 首頁>>代碼示例>>C++>>正文


C++ Basket::basketName方法代碼示例

本文整理匯總了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);
}
開發者ID:tytycoon,項目名稱:basket,代碼行數:10,代碼來源:systemtray.cpp

示例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);
}
開發者ID:tytycoon,項目名稱:basket,代碼行數:41,代碼來源:systemtray.cpp


注:本文中的Basket::basketName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。