97色伦色在线综合视频,无玛专区,18videosex性欧美黑色,日韩黄色电影免费在线观看,国产精品伦理一区二区三区,在线视频欧美日韩,亚洲欧美在线中文字幕不卡

國家城鄉(xiāng)住房建設(shè)廳網(wǎng)站制作網(wǎng)站怎么做

鶴壁市浩天電氣有限公司 2026/01/24 14:05:12
國家城鄉(xiāng)住房建設(shè)廳網(wǎng)站,制作網(wǎng)站怎么做,個人網(wǎng)站asp源碼,一鍵配置wordpress在項目中為了便于對組合后的圖元進行管理#xff0c;一般會繼承 QGraphicsItemGroup 實現(xiàn)自己的 group 類#xff0c;這樣可以方便的借用 QGraphicsItemGroup 對內(nèi)部圖元進行管理#xff0c;但同時也受到了 QGraphicsItemGroup 實現(xiàn)的約束。例如#xff1a;QGraphicsItemGr…在項目中為了便于對組合后的圖元進行管理一般會繼承 QGraphicsItemGroup 實現(xiàn)自己的 group 類這樣可以方便的借用 QGraphicsItemGroup 對內(nèi)部圖元進行管理但同時也受到了 QGraphicsItemGroup 實現(xiàn)的約束。例如QGraphicsItemGroup 對象的默認原點坐標(biāo)為{00}對鼠標(biāo)鍵盤的消息默認由 QGraphicsItemGroup 處理內(nèi)部圖元控件不會處理等。這里主要討論使用 addToGroup() 或 removeFromGroup() 時 group 的 bound 會發(fā)生變化此時需要調(diào)整 group 的坐標(biāo)及尺寸。因為我們可能一次向 group 添加/移除一個控件也可能添加、移除多個group 的坐標(biāo)及尺寸最好在添加/移除后進行調(diào)整。但是為了提高代碼的內(nèi)聚性我們更希望在 group 內(nèi)部圖元發(fā)生變化后由 group 自動調(diào)整位置及大小。繼承 QGraphicsItemGroup 后重載 itemChange() 方法當(dāng)內(nèi)部圖元發(fā)生變化時可以通過 change QGraphicsItem::ItemChildAddedChange 監(jiān)聽添加圖元的信號、change QGraphicsItem::ItemChildRemovedChange 監(jiān)聽移除圖元的信號。如果在 itemChange() 方法中處理 group 的坐標(biāo)及尺寸就會發(fā)生不可思議的問題明明位置與尺寸都計算正確但是內(nèi)部圖元的位置卻發(fā)生莫名的偏移。通過監(jiān)控內(nèi)部圖元的坐標(biāo)發(fā)現(xiàn)計算的坐標(biāo)完全正確但是顯示位置就是不對。如下圖圖一是組合前的位置圖二是組合后的位置組合后顯示的選擇框就是重新調(diào)整后的 group 的位置及大小內(nèi)部的矩形與圓形已經(jīng)偏離了原位置。image圖一 組合前的位置image圖二 組合后的位置發(fā)生這個問題的原因是不能在 itemChange() 方法內(nèi)處理 group 的位置及坐標(biāo)因為此時addToGroup() 或 removeFromGroup() 的代碼還未執(zhí)行完畢??匆幌?addToGroup() 的源碼// 文件位置 qt-everywhere-src-6.7.3qtbasesrcwidgetsgraphicsviewqgraphicsitem.cppvoid QGraphicsItemGroup::addToGroup(QGraphicsItem *item){Q_D(QGraphicsItemGroup);if (!item) {qWarning(QGraphicsItemGroup::addToGroup: cannot add null item);return;}if (item this) {qWarning(QGraphicsItemGroup::addToGroup: cannot add a group to itself);return;}// COMBINEbool ok;QTransform itemTransform item-itemTransform(this, ok);if (!ok) {qWarning(QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates);return;}QTransform newItemTransform(itemTransform);item-setPos(mapFromItem(item, 0, 0));// 設(shè)置父項目時會觸發(fā) itemChange() 方法item-setParentItem(this);// removing position from translation component of the new transformif (!item-pos().isNull())newItemTransform * QTransform::fromTranslate(-item-x(), -item-y());// removing additional transformations properties applied with itemTransform()QPointF origin item-transformOriginPoint();QMatrix4x4 m;QListQGraphicsTransform* transformList item-transformations();for (int i 0; i transformList.size(); i)transformList.at(i)-applyTo(m);newItemTransform * m.toTransform().inverted();newItemTransform.translate(origin.x(), origin.y());newItemTransform.rotate(-item-rotation());newItemTransform.scale(1/item-scale(), 1/item-scale());newItemTransform.translate(-origin.x(), -origin.y());// ### Expensive, we could maybe use dirtySceneTransform bit for optimizationitem-setTransform(newItemTransform);item-d_func()-setIsMemberOfGroup(true);prepareGeometryChange();d-itemsBoundingRect | itemTransform.mapRect(item-boundingRect() | item-childrenBoundingRect());update();}void QGraphicsItem::setParentItem(QGraphicsItem *newParent){if (newParent this) {qWarning(QGraphicsItem::setParentItem: cannot assign %p as a parent of itself, this);return;}if (newParent d_ptr-parent)return;const QVariant newParentVariant(itemChange(QGraphicsItem::ItemParentChange,QVariant::fromValueQGraphicsItem *(newParent)));newParent qvariant_castQGraphicsItem *(newParentVariant);if (newParent d_ptr-parent)return;const QVariant thisPointerVariant(QVariant::fromValueQGraphicsItem *(this));// setParentItemHelper 內(nèi)部觸發(fā) itemChange() 方法d_ptr-setParentItemHelper(newParent, newParentVariant, thisPointerVariant);}void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const QVariant *newParentVariant, const QVariant *thisPointerVariant){Q_Q(QGraphicsItem);if (newParent parent)return;...if (parent) {// Remove from current parentparent-d_ptr-removeChild(q);if (thisPointerVariant)parent-itemChange(QGraphicsItem::ItemChildRemovedChange, thisPointerVariant);}...// Deliver post-change notificationif (newParentVariant)q-itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant);if (isObject)emit static_castQGraphicsObject *(q)-parentChanged();}通過源碼可以發(fā)現(xiàn)如果在 itemChange() 內(nèi)部處理 group 的坐標(biāo)及尺寸確實會出現(xiàn)很多問題因為此時 addToGroup() 還未執(zhí)行 transform 變換。要解決此問題就必須等待addToGroup() 執(zhí)行完成再去計算坐標(biāo)及尺寸??梢栽?itemChange() 發(fā)射一個信號采用異步處理該信號將處理過程推遲到下一個事件循環(huán)。這樣就能夠完美解決問題。具體代碼可以參考項目 Compelling Data Designer 中 dashboard/BIDesigner/graphicsitemgroup.cpp 的處理過程。該項目用于數(shù)據(jù)的可視化設(shè)計軟件采用可擴展架構(gòu)支持擴展圖形插件、數(shù)據(jù)接口。項目仍在開發(fā)中目前已設(shè)計完成基本圖形、多屬性配置、動畫等功能。image
版權(quán)聲明: 本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請聯(lián)系我們進行投訴反饋,一經(jīng)查實,立即刪除!

html網(wǎng)站正在建設(shè)源碼國外服務(wù)器需要備案嗎

html網(wǎng)站正在建設(shè)源碼,國外服務(wù)器需要備案嗎,海安網(wǎng)頁設(shè)計,網(wǎng)頁建設(shè)數(shù)字化轉(zhuǎn)型浪潮下#xff0c;企業(yè)IT架構(gòu)日趨復(fù)雜#xff0c;海量數(shù)據(jù)爆發(fā)式增長、多系統(tǒng)協(xié)同需求激增#xff0c;疊加業(yè)務(wù)對服務(wù)

2026/01/22 21:59:01

培訓(xùn)網(wǎng)站html在下列軟件中

培訓(xùn)網(wǎng)站html,在下列軟件中,百度app官方下載,汽車之家app下載寫在前面車門焊死#xff0c;考研將至#xff0c;準備沖刺#xff01;我將持續(xù)為大家更新25最新真題解析#xff01;學(xué)得快的

2026/01/23 16:20:01

國外設(shè)計網(wǎng)站 綠色的馬鞍山做網(wǎng)站的公司

國外設(shè)計網(wǎng)站 綠色的,馬鞍山做網(wǎng)站的公司,網(wǎng)站建設(shè)客戶常見問題集錦,asp網(wǎng)站制作設(shè)計教程Excalidraw撤銷深度設(shè)置調(diào)整方法 在現(xiàn)代遠程協(xié)作日益頻繁的背景下#xff0c;可視化工具已經(jīng)成為產(chǎn)品

2026/01/23 16:58:01

南寧cms建站影視網(wǎng)站建設(shè)

南寧cms建站,影視網(wǎng)站建設(shè),wordpress windows主題,企業(yè)網(wǎng)站托管方案Halcon實戰(zhàn)#xff1a;基于surface_fusion的多相機3D表面重建技術(shù)詳解 一、引言 在工業(yè)機器視

2026/01/23 02:56:01