91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 664KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-22
  • 語言: 其他
  • 標(biāo)簽: Qt,滑動(dòng)??

資源簡介

QGraphicsView用來顯示一個(gè)滾動(dòng)視圖區(qū)的QGraphicsScene內(nèi)容。QGraphicsScene提供了QGraphicsItem的容器功能。通常與QGraphicsView一起使用來描述可視化圖形項(xiàng)目。 QGraphicsScene提供了一個(gè)視圖的場(chǎng)景,通過在這樣一個(gè)場(chǎng)景之上加入不同的QGraphicsItem來構(gòu)建視圖。而QGraphicsView則提供了一個(gè)widget來顯示QGraphicsScene的內(nèi)容。所以要想成功構(gòu)建一個(gè)視圖,這三個(gè)元素缺一不可。 以下是一個(gè)QGraphicsView的例子,實(shí)現(xiàn)滑動(dòng)的窗體效果,工具欄和圖片均為場(chǎng)景中的Item。

資源截圖

代碼片段和文件信息

/****************************************************************************
**
**?Copyright?(C)?2009?Nokia?Corporation?and/or?its?subsidiary(-ies).
**?Contact:?Qt?Software?Information?(qt-info@nokia.com)
**
**?This?file?is?part?of?the?Graphics?Dojo?project?on?Qt?Labs.
**
**?This?file?may?be?used?under?the?terms?of?the?GNU?General?Public
**?License?version?2.0?or?3.0?as?published?by?the?Free?Software?Foundation
**?and?appearing?in?the?file?LICENSE.GPL?included?in?the?packaging?of
**?this?file.??Please?review?the?following?information?to?ensure?GNU
**?General?Public?Licensing?requirements?will?be?met:
**?http://www.fsf.org/licensing/licenses/info/GPLv2.html?and
**?http://www.gnu.org/copyleft/gpl.html.
**
**?If?you?are?unsure?which?license?is?appropriate?for?your?use?please
**?contact?the?sales?department?at?qt-sales@nokia.com.
**
**?This?file?is?provided?AS?IS?with?NO?WARRANTY?OF?ANY?KIND?INCLUDING?THE
**?WARRANTY?OF?DESIGN?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE.
**
****************************************************************************/

#include?
#include?
#include?

#if?defined?(Q_OS_SYMBIAN)
#include?“sym_iap_util.h“
#include?
#include?
#include?
#include?
#endif

#define?PAGE_COUNT?5

class?NaviBar?:?public?Qobject?public?QGraphicsRectItem
{
????Q_object

public:
????NaviBar();

????void?setPageOffset(qreal?ofs);

signals:
????void?pageSelected(int?page);

protected:
????void?mousePressEvent(QGraphicsSceneMouseEvent?*event);
????void?paint(QPainter?*painter?const?QstyleOptionGraphicsItem?*option?QWidget?*widget?=?0);

private:
????QList?m_icons;
????QGraphicsRectItem?*m_cursor;
};

#define?ICON_SIZE?50
#define?ICON_PAD?4

NaviBar::NaviBar()
????????:?QGraphicsRectItem()
{
????setRect(0?0?5?*?ICON_SIZE?ICON_SIZE);
????setPen(Qt::NoPen);

????QStringList?names;
????names?<????for?(int?i?=?0;?i?????????QString?fname?=?names[i];
????????fname.prepend(“:/icons/“);
????????fname.append(“-page.svg“);
????????QGraphicsSvgItem?*icon?=?new?QGraphicsSvgItem(fname);
????????icon->setParentItem(this);
????????const?int?dim?=?ICON_SIZE?-?ICON_PAD?*?2;
????????qreal?sw?=?dim?/?icon->boundingRect().width();
????????qreal?sh?=?dim?/?icon->boundingRect().height();
????????icon->setTransform(QTransform().scale(sw?sh));
????????icon->setZValue(2);
????????m_icons?<????}

????m_cursor?=?new?QGraphicsRectItem;
????m_cursor->setParentItem(this);
????m_cursor->setRect(0?0?ICON_SIZE?ICON_SIZE);
????m_cursor->setZValue(1);
????m_cursor->setPen(Qt::NoPen);
????m_cursor->setBrush(QColor(Qt::white));
????m_cursor->setOpacity(0.6);
}

void?NaviBar::setPageOffset(qreal?ofs)
{
????m_cursor->setPos(ofs?*?ICON_SIZE?0);
????for?(int?i?=?0;?i?????????int?y?=?(i?==?static_cast(ofs?+?0.5))???ICON_PAD?:?ICON_PAD?*?2;
????????m_icons[i]->setPos(i?*?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2010-07-24?12:15??parallaxhome\
?????目錄???????????0??2010-07-24?12:14??parallaxhome\icons\
?????文件???????28205??2009-11-29?09:37??parallaxhome\icons\contacts-page.svg
?????文件????????1200??2009-11-29?09:37??parallaxhome\icons\go-back.png
?????文件????????1219??2009-11-29?09:37??parallaxhome\icons\go-forward.png
?????文件???????21437??2009-11-29?09:37??parallaxhome\icons\home-page.svg
?????文件???????19750??2009-11-29?09:37??parallaxhome\icons\image-page.svg
?????文件???????20393??2009-11-29?09:37??parallaxhome\icons\map-page.svg
?????文件????????1628??2009-11-29?09:37??parallaxhome\icons\options-menu.png
?????文件??????????79??2009-11-29?09:37??parallaxhome\icons\README.txt
?????文件???????38120??2009-11-29?09:37??parallaxhome\icons\surfacing.jpg
?????文件??????502912??2009-11-29?09:37??parallaxhome\icons\surfacing.png
?????文件???????44607??2009-11-29?09:37??parallaxhome\icons\weather-page.svg
?????文件???????31559??2009-11-29?09:37??parallaxhome\icons\web-page.svg
?????目錄???????????0??2010-07-24?12:14??parallaxhome\images\
?????文件???????10920??2009-11-29?09:37??parallaxhome\images\brownies.jpg
?????文件????????6537??2009-11-29?09:37??parallaxhome\images\chocolate.jpg
?????文件???????12103??2009-11-29?09:37??parallaxhome\images\cookies.jpg
?????文件???????12227??2009-11-29?09:37??parallaxhome\images\fish.jpg
?????文件????????7342??2009-11-29?09:37??parallaxhome\images\mussels.jpg
?????文件????????9670??2009-11-29?09:37??parallaxhome\images\pasta.jpg
?????文件???????10769??2009-11-29?09:37??parallaxhome\images\pizza.jpg
?????文件????????8676??2009-11-29?09:37??parallaxhome\images\puding.jpg
?????文件????????9431??2009-11-29?09:37??parallaxhome\images\sushi.jpg
?????文件???????12022??2009-11-29?09:37??parallaxhome\images\trouts.jpg
?????文件????????8496??2009-11-29?09:37??parallaxhome\parallaxhome.cpp
?????文件??????????81??2009-11-29?09:37??parallaxhome\parallaxhome.pro
?????文件?????????701??2009-11-29?09:37??parallaxhome\parallaxhome.qrc

評(píng)論

共有 條評(píng)論

相關(guān)資源