QWidget::createWindowContainer函数翻译

[static] QWidget *QWidget::createWindowContainer(QWindow *window, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags())

Creates a QWidget that makes it possible to embed window into a QWidget-based application.

译:创建一个QWidget窗口容器,该窗口容器使得基于QWidget的应用内嵌window窗口变为可能。

The window container is created as a child of parent and with window flags flags.

译:该window容器被创建来作为父窗口的子窗口,并并且可以在参数中设置window属性标志。

Once the window has been embedded into the container, the container will control the window's geometry and visibility. Explicit calls to QWindow::setGeometry(), QWindow::show() or QWindow::hide() on an embedded window is not recommended.

译:一旦该window窗口被嵌入到容器中,该容器就会控制该window窗口的尺寸位置和是否可视,不推荐在一个内嵌的window窗口中显性调用 QWindow::setGeometry(), QWindow::show() 或者 QWindow::hide()函数。

The container takes over ownership of window. The window can be removed from the window container with a call to QWindow::setParent().

译:创建好的QWidget容器接管了window窗口的所有权。可以通过调用QWindow::setParent()函数来从容器中移除调用该window 。

The window container is attached as a native child window to the toplevel window it is a child of. When a window container is used as a child of a QAbstractScrollArea or QMdiArea, it will create a native window for every widget in its parent chain to allow for proper stacking and clipping in this use case. Creating a native window for the window container also allows for proper stacking and clipping. This must be done before showing the window container. Applications with many native child windows may suffer from performance issues.

译:window 窗口容器作为原生子窗口附加到其所属的顶层窗口。当一个window 窗口容器被用来作为一个QAbstractScrollArea类或者 QMdiArea类的子窗口时,它会为在其父类中的每个widget 部件创建一个原生window窗口,以便在用例中正确的堆叠和裁剪。

The window container has a number of known limitations: 

译:该window 容器有一些已知的限制。

  • Stacking order; The embedded window will stack on top of the widget hierarchy as an opaque box. The stacking order of multiple overlapping window container instances is undefined.

译:堆叠顺序:内嵌的window 窗口会以一个不透明框的方式堆在widget 部件层次的顶端。如果是多个重叠的window窗口容器实例,它们的堆叠顺序则是未定义的。

  • Rendering Integration; The window container does not interoperate with QGraphicsProxyWidget, QWidget::render() or similar functionality.

译:一体化呈现:该窗口哦容器并没有与 QGraphicsProxyWidget, QWidget::render()或者其他类似功能交互操作。

  • Focus Handling; It is possible to let the window container instance have any focus policy and it will delegate focus to the window via a call to QWindow::requestActivate(). However, returning to the normal focus chain from the QWindow instance will be up to the QWindow instance implementation itself. For instance, when entering a Qt Quick based window with tab focus, it is quite likely that further tab presses will only cycle inside the QML application. Also, whether QWindow::requestActivate() actually gives the window focus, is platform dependent.

译:聚焦处理:可以让window 窗口容器实例拥有任意一个焦点策略,它将通过调用QWindow::requestActivate()将焦点委托给窗口。然而,从QWindow实例返回到正常焦点链将取决于QWindow实例实现本身。例如,当使用tab焦点进入一个Qt Quick的基本窗口时,很有可能再一次按下tab后,只在QML应用里面循环。事实上,QWindow::requestActivate()会不会给予window窗口焦点,与平台独立相关。

  • Using many window container instances in a QWidget-based application can greatly hurt the overall performance of the application.

译:在基于QWidget的应用中使用大量的window窗口容器实例,会在很大程度上影响应用程序的整体性能。

你可能感兴趣的:(C++,Qt5,Qt)