<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # QTouchEvent Class Reference ## [[QtGui](index.htm) module] 該QTouchEvent類包含描述一個觸摸事件的參數。[More...](#details) 繼承[QInputEvent](qinputevent.html)。 ### Types * `enum DeviceType { TouchScreen, TouchPad }` * `class **[TouchPoint](index.htm)**` ### Methods * `__init__ (self, QEvent.Type?eventType, DeviceType?deviceType?=?QTouchEvent.TouchScreen, Qt.KeyboardModifiers?modifiers?=?Qt.NoModifier, Qt.TouchPointStates?touchPointStates?=?0, list-of-QTouchEvent.TouchPoint?touchPoints?=?QList&lt;QTouchEvent.TouchPoint&gt;())` * `__init__ (self, QTouchEvent)` * `DeviceType deviceType (self)` * `list-of-QTouchEvent.TouchPoint touchPoints (self)` * `Qt.TouchPointStates touchPointStates (self)` * `QWidget widget (self)` * * * ## Detailed Description 該QTouchEvent類包含描述一個觸摸事件的參數。 ### Enabling Touch Events 觸壓時,釋放,或移動觸摸設備上的一個或多個觸摸點(如觸摸屏或軌道墊)事件發生。要接收觸摸事件,小部件必須有[Qt.WA_AcceptTouchEvents](qt.html#WidgetAttribute-enum)屬性設置和圖形項目需要有[acceptTouchEvents](qgraphicsitem.html#setAcceptTouchEvents)屬性設置為True。 當使用[QAbstractScrollArea](qabstractscrollarea.html)基于小部件,您應該啟用[Qt.WA_AcceptTouchEvents](qt.html#WidgetAttribute-enum)屬性上的滾動區域的[viewport](qabstractscrollarea.html#viewport)。 同樣以[QMouseEvent](qmouseevent.html), Qt的自動抓取上的小工具里面的第一次記者每個接觸點,以及部件將接收所有的更新為觸摸點,直到它被釋放。需要注意的是它有可能為一個部件來接收事件為眾多的接觸點,并且多個部件可以在同一時間接收到觸摸事件。 ### Event Handling 所有的觸摸事件的類型為[QEvent.TouchBegin](qevent.html#Type-enum),[QEvent.TouchUpdate](qevent.html#Type-enum)或[QEvent.TouchEnd](qevent.html#Type-enum)。重新實現[QWidget.event](qwidget.html#event)()或[QAbstractScrollArea.viewportEvent](qabstractscrollarea.html#viewportEvent)( )的部件和[QGraphicsItem.sceneEvent](qgraphicsitem.html#sceneEvent)()在圖形視圖中的項目,以接收觸摸事件。 該[QEvent.TouchUpdate](qevent.html#Type-enum)和[QEvent.TouchEnd](qevent.html#Type-enum)事件發送給窗口小部件或產品所接受的[QEvent.TouchBegin](qevent.html#Type-enum)事件。如果[QEvent.TouchBegin](qevent.html#Type-enum)事件是不能接受的,而不是由一個事件過濾器過濾,再沒有進一步的觸摸事件被發送,直到下一個[QEvent.TouchBegin](qevent.html#Type-enum)。 該[touchPoints](qtouchevent.html#touchPoints)( )函數返回包含在該事件的所有接觸點的列表。關于每個觸摸點信息可使用檢索到的[QTouchEvent.TouchPoint](index.htm)類。該[Qt.TouchPointState](qt.html#TouchPointState-enum)枚舉描述了不同的狀態,一個觸摸點可能有。 ### Event Delivery and Propagation 默認情況下,[QWidget.event](qwidget.html#event)()平移所述第一非主觸摸點在QTouchEvent成[QMouseEvent](qmouseevent.html)。這使得它可以使在現有的小部件通常不處理QTouchEvent觸摸事件。看看下面的這樣做時需要一些特殊的注意事項的信息。 [QEvent.TouchBegin](qevent.html#Type-enum)是發送到插件的第一觸摸事件。該[QEvent.TouchBegin](qevent.html#Type-enum)事件包含一個特殊的接受標志,指示接收者是否愿意事件。默認情況下,事件被接受。你應該調用[ignore](qevent.html#ignore)( )如果觸摸事件不是由您的Widget處理。該[QEvent.TouchBegin](qevent.html#Type-enum)事件被傳播到父控件鏈,直到一個小部件接受它[accept](qevent.html#accept)( ) ,或者一個事件過濾器會消耗它。對于QGraphicsItems的[QEvent.TouchBegin](qevent.html#Type-enum)事件被傳播到下鼠標(類似于用于QGraphicsItems鼠標事件傳播)項目。 ### Touch Point Grouping 如上面所提到的,有可能是幾個部件可以接收QTouchEvents在同一時間。然而, Qt后,一定要永不重復發送[QEvent.TouchBegin](qevent.html#Type-enum)事件以相同的部件,它可以在傳播過程中理論上發生,如果,例如,在用戶觸摸的2個獨立的小部件在一個[QGroupBox](qgroupbox.html)和兩個小部件忽略[QEvent.TouchBegin](qevent.html#Type-enum)事件。 為了避免這種情況, Qt會組新的接觸點一起使用以下規則: * When the first touch point is detected, the destination widget is determined firstly by the location on screen and secondly by the propagation rules. * When additional touch points are detected, Qt first looks to see if there are any active touch points on any ancestor or descendent of the widget under the new touch point. If there are, the new touch point is grouped with the first, and the new touch point will be sent in a single QTouchEvent to the widget that handled the first touch point. (The widget under the new touch point will not receive an event). 這使得它可以為同級部件獨立處理觸摸事件,同時確保QTouchEvents的順序永遠是正確的。 ### Mouse Events and the Primary Touch Point QTouchEvent交付是獨立于中[QMouseEvent](qmouseevent.html)。在一些窗口系統,鼠標事件也發送了[primary touch point](index.htm#isPrimary)。這意味著它有可能為你的widget能夠同時接收QTouchEvent和[QMouseEvent](qmouseevent.html)對于相同的用戶交互點。您可以使用[QTouchEvent.TouchPoint.isPrimary](index.htm#isPrimary)( )函數來確定的主要接觸點。 請注意,在某些系統上,它可以接收觸摸事件沒有主觸摸點。這一切都意味著,將有在QTouchEvent觸摸點不產生鼠標事件。 ### Caveats * As mentioned above, enabling touch events means multiple widgets can be receiving touch events simultaneously. Combined with the default [QWidget.event](qwidget.html#event)() handling for QTouchEvents, this gives you great flexibility in designing touch user interfaces. Be aware of the implications. For example, it is possible that the user is moving a [QSlider](qslider.html) with one finger and pressing a [QPushButton](qpushbutton.html) with another. The signals emitted by these widgets will be interleaved. * Recursion into the event loop using one of the exec() methods (e.g., [QDialog.exec](qdialog.html#exec)() or [QMenu.exec](qmenu.html#exec)()) in a QTouchEvent event handler is not supported. Since there are multiple event recipients, recursion may cause problems, including but not limited to lost events and unexpected infinite recursion. * QTouchEvents are not affected by a [mouse grab](qwidget.html#grabMouse) or an [active pop-up widget](qapplication.html#activePopupWidget). The behavior of QTouchEvents is undefined when opening a pop-up or grabbing the mouse while there are more than one active touch points. * * * ## Type Documentation ``` QTouchEvent.DeviceType ``` 該枚舉表示所產生的一裝置的類型[QTouchEvent](qtouchevent.html)。 | Constant | Value | Description | | --- | --- | --- | | `QTouchEvent.TouchScreen` | `0` | 在這種類型的設備中,觸摸表面和顯示器被集成。這意味著在表面和顯示器通常具有相同的尺寸,使得在所述觸摸點“物理位置和坐標報告之間的直接關系[QTouchEvent.TouchPoint](index.htm)。其結果是, Qt的允許用戶直接與多個QWidgets和QGraphicsItems在同一時間進行交互。 | | `QTouchEvent.TouchPad` | `1` | 在這種類型的設備,所述觸摸表面是分開的顯示。沒有物理接觸位置和屏幕上的坐標之間的直接關系。相反,它們被計算相對于當前鼠標位置,而用戶必須使用觸摸板移動至該參考點。不像觸摸屏, Qt的允許用戶只與一個單一的交互[QWidget](qwidget.html) or [QGraphicsItem](qgraphicsitem.html)在一個時間。 | * * * ## Method Documentation ``` QTouchEvent.__init__ (self, QEvent.Type?eventType, DeviceType?deviceType?=?QTouchEvent.TouchScreen, Qt.KeyboardModifiers?modifiers?=?Qt.NoModifier, Qt.TouchPointStates?touchPointStates?=?0, list-of-QTouchEvent.TouchPoint?touchPoints?=?QList<QTouchEvent.TouchPoint>()) ``` 構造一個[QTouchEvent](qtouchevent.html)用給定的_eventType_,_deviceType_和_touchPoints_。該_touchPointStates_和_modifiers_是當前觸摸點的狀態和鍵盤功能鍵在事件發生的時間。 ``` QTouchEvent.__init__ (self, QTouchEvent) ``` ``` DeviceType QTouchEvent.deviceType (self) ``` [](qtouchevent.html#DeviceType-enum) [返回觸摸設備類型,它的類型是](qtouchevent.html#DeviceType-enum)[DeviceType](qtouchevent.html#DeviceType-enum)。 ``` list-of-QTouchEvent.TouchPoint QTouchEvent.touchPoints (self) ``` 返回包含在該觸摸事件的觸摸點的列表。 ``` Qt.TouchPointStates QTouchEvent.touchPointStates (self) ``` [ 返回此事件的一個位的所有接觸點或國家。 ](index.htm) ``` QWidget QTouchEvent.widget (self) ``` [ 返回上發生事件的小部件。 ](qwidget.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看