Remove ViewWrapper*h from public API
This commit is contained in:
@@ -392,7 +392,6 @@ if(KDDockWidgets_TESTS)
|
||||
add_test(NAME tst_docks21 COMMAND tests_launcher 20 5) # one more for rounding leftovers
|
||||
|
||||
add_test(NAME tst_view COMMAND tst_view)
|
||||
add_test(NAME tst_viewwrapper COMMAND tst_viewwrapper)
|
||||
add_test(NAME tst_viewguard COMMAND tst_viewguard)
|
||||
add_test(NAME tst_group COMMAND tst_group)
|
||||
add_test(NAME tst_titlebar COMMAND tst_titlebar)
|
||||
|
||||
@@ -91,7 +91,6 @@ set(KDDW_BACKEND_SRCS
|
||||
ViewGuard.cpp
|
||||
ViewGuard.h
|
||||
ViewWrapper.cpp
|
||||
ViewWrapper.h
|
||||
Controller.cpp
|
||||
Controller.h
|
||||
Platform.cpp
|
||||
@@ -219,7 +218,6 @@ set(KDDW_PUBLIC_HEADERS
|
||||
Action.h
|
||||
Controller.h
|
||||
View.h
|
||||
ViewWrapper.h
|
||||
Window.h
|
||||
ViewFactory.h
|
||||
Qt5Qt6Compat_p.h
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "Controller.h"
|
||||
#include "View.h"
|
||||
#include "ViewWrapper.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ QT_END_NAMESPACE
|
||||
namespace KDDockWidgets {
|
||||
|
||||
class View;
|
||||
class ViewWrapper;
|
||||
|
||||
enum class Type
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "kddockwidgets/docks_export.h"
|
||||
#include "ViewWrapper.h"
|
||||
#include "View.h"
|
||||
#include "kddockwidgets/KDDockWidgets.h"
|
||||
|
||||
#include <QEvent>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "controllers/MDILayout.h"
|
||||
|
||||
#include "Platform.h"
|
||||
#include "ViewWrapper.h"
|
||||
#include "Window.h"
|
||||
|
||||
#include <QScreen>
|
||||
|
||||
@@ -33,7 +33,6 @@ class QPainter;
|
||||
|
||||
namespace KDDockWidgets {
|
||||
|
||||
class ViewWrapper;
|
||||
class Controller;
|
||||
class Window;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "DockWidget.h"
|
||||
#include "DockRegistry.h"
|
||||
#include "private/Position_p.h"
|
||||
#include "ViewWrapper.h"
|
||||
#include "Action.h"
|
||||
#include "private/View_p.h"
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "private/Logging_p.h"
|
||||
|
||||
#include "views/TitleBarViewInterface.h"
|
||||
#include "ViewWrapper.h"
|
||||
#include "controllers/DockWidget_p.h"
|
||||
#include "controllers/FloatingWindow.h"
|
||||
#include "controllers/TabBar.h"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sergio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../../ViewWrapper.h"
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../../../../qtquick/views/ViewWrapper_qtquick.h"
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../../../../qtwidgets/views/ViewWrapper_qtwidgets.h"
|
||||
@@ -867,8 +867,8 @@ static std::shared_ptr<View> qtTopLevelForHWND(HWND hwnd)
|
||||
|
||||
#endif
|
||||
|
||||
static ViewWrapper::Ptr qtTopLevelUnderCursor_impl(QPoint globalPos, const Window::List &windows,
|
||||
View *rootViewBeingDragged)
|
||||
static std::shared_ptr<View> qtTopLevelUnderCursor_impl(QPoint globalPos, const Window::List &windows,
|
||||
View *rootViewBeingDragged)
|
||||
{
|
||||
for (auto i = windows.size() - 1; i >= 0; --i) {
|
||||
Window::Ptr window = windows.at(i);
|
||||
@@ -889,7 +889,7 @@ static ViewWrapper::Ptr qtTopLevelUnderCursor_impl(QPoint globalPos, const Windo
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ViewWrapper::Ptr DragController::qtTopLevelUnderCursor() const
|
||||
std::shared_ptr<View> DragController::qtTopLevelUnderCursor() const
|
||||
{
|
||||
QPoint globalPos = QCursor::pos();
|
||||
|
||||
@@ -970,7 +970,7 @@ ViewWrapper::Ptr DragController::qtTopLevelUnderCursor() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static DropArea *deepestDropAreaInTopLevel(ViewWrapper::Ptr topLevel, QPoint globalPos,
|
||||
static DropArea *deepestDropAreaInTopLevel(std::shared_ptr<View> topLevel, QPoint globalPos,
|
||||
const QStringList &affinities)
|
||||
{
|
||||
const auto localPos = topLevel->mapFromGlobal(globalPos);
|
||||
@@ -989,7 +989,7 @@ static DropArea *deepestDropAreaInTopLevel(ViewWrapper::Ptr topLevel, QPoint glo
|
||||
|
||||
DropArea *DragController::dropAreaUnderCursor() const
|
||||
{
|
||||
ViewWrapper::Ptr topLevel = qtTopLevelUnderCursor();
|
||||
std::shared_ptr<View> topLevel = qtTopLevelUnderCursor();
|
||||
if (!topLevel)
|
||||
return nullptr;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define KD_DRAGCONTROLLER_P_H
|
||||
|
||||
#include "kddockwidgets/docks_export.h"
|
||||
#include "ViewWrapper.h"
|
||||
|
||||
#include "WindowBeingDragged_p.h"
|
||||
|
||||
@@ -130,7 +129,7 @@ private:
|
||||
|
||||
DragController(QObject * = nullptr);
|
||||
StateBase *activeState() const;
|
||||
ViewWrapper::Ptr qtTopLevelUnderCursor() const;
|
||||
std::shared_ptr<View> qtTopLevelUnderCursor() const;
|
||||
Draggable *draggableForQObject(QObject *o) const;
|
||||
QPoint m_pressPos;
|
||||
QPoint m_offset;
|
||||
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
QMetaObject::Connection m_connection;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void DockWidgetInstantiator::componentComplete()
|
||||
|
||||
|
||||
if (m_sourceFilename.isEmpty()) {
|
||||
m_dockWidget->setGuestView(Views::asQQuickWrapper(childItems.constFirst()));
|
||||
m_dockWidget->setGuestView(Views::View_qtquick::asQQuickWrapper(childItems.constFirst()));
|
||||
} else {
|
||||
auto view = this->dockWidget();
|
||||
view->setGuestItem(m_sourceFilename);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "private/DragController_p.h"
|
||||
#include "private/Platform_p.h"
|
||||
#include "ViewFactory_qtquick.h"
|
||||
#include "views/ViewWrapper_qtquick.h"
|
||||
|
||||
#include "views/DockWidget_qtquick.h"
|
||||
#include "DockWidgetInstantiator.h"
|
||||
|
||||
@@ -52,7 +52,7 @@ std::shared_ptr<View> Window_qtquick::rootView() const
|
||||
const auto children = contentItem->childItems();
|
||||
Q_ASSERT(!children.isEmpty());
|
||||
|
||||
return Views::asQQuickWrapper(contentItem->childItems().first());
|
||||
return Views::View_qtquick::asQQuickWrapper(contentItem->childItems().first());
|
||||
}
|
||||
} else {
|
||||
qWarning() << Q_FUNC_INFO << "Expected QQuickView";
|
||||
|
||||
@@ -150,7 +150,7 @@ void ViewWrapper_qtquick::setGeometry(QRect rect)
|
||||
std::shared_ptr<View> ViewWrapper_qtquick::childViewAt(QPoint p) const
|
||||
{
|
||||
auto child = m_item->childAt(p.x(), p.y());
|
||||
return child ? asQQuickWrapper(child) : nullptr;
|
||||
return child ? View_qtquick::asQQuickWrapper(child) : nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Window> ViewWrapper_qtquick::window() const
|
||||
@@ -413,7 +413,7 @@ QVector<std::shared_ptr<View>> ViewWrapper_qtquick::childViews() const
|
||||
QVector<std::shared_ptr<View>> result;
|
||||
const auto childItems = m_item->childItems();
|
||||
for (QQuickItem *child : childItems) {
|
||||
result << asQQuickWrapper(child);
|
||||
result << View_qtquick::asQQuickWrapper(child);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "kddockwidgets/ViewWrapper.h"
|
||||
#include "../../ViewWrapper.h"
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QPointer>
|
||||
|
||||
@@ -711,6 +711,13 @@ std::shared_ptr<View> View_qtquick::parentViewFor(const QQuickItem *item)
|
||||
return p ? asQQuickWrapper(p) : nullptr;
|
||||
}
|
||||
|
||||
/* static */
|
||||
std::shared_ptr<View> View_qtquick::asQQuickWrapper(QQuickItem *item)
|
||||
{
|
||||
auto wrapper = new ViewWrapper_qtquick(item);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
std::shared_ptr<View> View_qtquick::parentView() const
|
||||
{
|
||||
return parentViewFor(this);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "kddockwidgets/Controller.h"
|
||||
#include "kddockwidgets/View.h"
|
||||
#include "ViewWrapper_qtquick.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QEvent>
|
||||
@@ -46,14 +45,6 @@ inline QQuickItem *asQQuickItem(Controller *controller)
|
||||
return asQQuickItem(controller->view());
|
||||
}
|
||||
|
||||
inline std::shared_ptr<View> asQQuickWrapper(QQuickItem *item)
|
||||
{
|
||||
auto wrapper = new ViewWrapper_qtquick(item);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
class DOCKS_EXPORT View_qtquick : public QQuickItem,
|
||||
public View
|
||||
{
|
||||
@@ -166,6 +157,7 @@ public:
|
||||
/// @brief Convenience to create a QQuickItem
|
||||
static QQuickItem *createItem(QQmlEngine *engine, const QString &filename);
|
||||
static std::shared_ptr<View> parentViewFor(const QQuickItem *);
|
||||
static std::shared_ptr<View> asQQuickWrapper(QQuickItem *item);
|
||||
|
||||
Q_SIGNALS:
|
||||
void geometryUpdated(); // similar to QLayout stuff, when size constraints change
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "DockWidget_qtwidgets.h"
|
||||
#include "controllers/DockWidget.h"
|
||||
#include "ViewWrapper_qtwidgets.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "MainWindow_qtwidgets.h"
|
||||
#include "Config.h"
|
||||
#include "kddockwidgets/ViewFactory.h"
|
||||
|
||||
#include "ViewWrapper_qtwidgets.h"
|
||||
#include "kddockwidgets/controllers/DropArea.h"
|
||||
#include "kddockwidgets/controllers/MainWindow.h"
|
||||
#include "kddockwidgets/controllers/Group.h"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "kddockwidgets/ViewWrapper.h"
|
||||
#include "../../ViewWrapper.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPointer>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "View_qtwidgets.h"
|
||||
#include "../Window_qtwidgets.h"
|
||||
#include "private/View_p.h"
|
||||
#include "ViewWrapper_qtwidgets.h"
|
||||
|
||||
#include <QTabBar>
|
||||
#include <QTabWidget>
|
||||
@@ -109,6 +110,62 @@ void View_qtwidgets<T>::setMinimumSize(QSize sz)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
std::shared_ptr<View> View_qtwidgets<T>::childViewAt(QPoint localPos) const
|
||||
{
|
||||
if (QWidget *child = QWidget::childAt(localPos))
|
||||
return std::shared_ptr<View>(new ViewWrapper_qtwidgets(child));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
template<class T>
|
||||
std::shared_ptr<View> View_qtwidgets<T>::rootView() const
|
||||
{
|
||||
if (auto w = QWidget::window()) {
|
||||
View *wrapper = new ViewWrapper_qtwidgets(w);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
template<class T>
|
||||
std::shared_ptr<View> View_qtwidgets<T>::parentView() const
|
||||
{
|
||||
if (QWidget *p = QWidget::parentWidget()) {
|
||||
View *wrapper = new ViewWrapper_qtwidgets(p);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
template<class T>
|
||||
std::shared_ptr<View> View_qtwidgets<T>::asWrapper()
|
||||
{
|
||||
View *wrapper = new ViewWrapper_qtwidgets(this);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
/* static */
|
||||
template<class T>
|
||||
QVector<std::shared_ptr<View>> View_qtwidgets<T>::childViewsFor(const QWidget *parent)
|
||||
{
|
||||
QVector<std::shared_ptr<View>> result;
|
||||
const QObjectList children = parent->children();
|
||||
result.reserve(children.size());
|
||||
for (QObject *child : children) {
|
||||
if (auto widget = qobject_cast<QWidget *>(child)) {
|
||||
View *wrapper = new ViewWrapper_qtwidgets(widget);
|
||||
result.push_back(std::shared_ptr<View>(wrapper));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace KDDockWidgets::Views {
|
||||
template class View_qtwidgets<QWidget>;
|
||||
template class View_qtwidgets<QMainWindow>;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "kddockwidgets/Controller.h"
|
||||
#include "kddockwidgets/View.h"
|
||||
#include "kddockwidgets/views/ViewWrapper_qtwidgets.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QEvent>
|
||||
@@ -345,41 +344,15 @@ public:
|
||||
return QWidget::hasFocus();
|
||||
}
|
||||
|
||||
std::shared_ptr<View> childViewAt(QPoint localPos) const override
|
||||
{
|
||||
if (QWidget *child = QWidget::childAt(localPos))
|
||||
return std::shared_ptr<View>(new ViewWrapper_qtwidgets(child));
|
||||
|
||||
return {};
|
||||
}
|
||||
std::shared_ptr<View> childViewAt(QPoint localPos) const override;
|
||||
|
||||
std::shared_ptr<Window> window() const override;
|
||||
|
||||
std::shared_ptr<View> rootView() const override
|
||||
{
|
||||
if (auto w = QWidget::window()) {
|
||||
ViewWrapper *wrapper = new ViewWrapper_qtwidgets(w);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
std::shared_ptr<View> rootView() const override;
|
||||
|
||||
return {};
|
||||
}
|
||||
std::shared_ptr<View> parentView() const override;
|
||||
|
||||
std::shared_ptr<View> parentView() const override
|
||||
{
|
||||
if (QWidget *p = QWidget::parentWidget()) {
|
||||
ViewWrapper *wrapper = new ViewWrapper_qtwidgets(p);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::shared_ptr<View> asWrapper() override
|
||||
{
|
||||
ViewWrapper *wrapper = new ViewWrapper_qtwidgets(this);
|
||||
return std::shared_ptr<View>(wrapper);
|
||||
}
|
||||
std::shared_ptr<View> asWrapper() override;
|
||||
|
||||
void setObjectName(const QString &name) override
|
||||
{
|
||||
@@ -436,20 +409,7 @@ public:
|
||||
return asQWidget(controller->view());
|
||||
}
|
||||
|
||||
static QVector<std::shared_ptr<View>> childViewsFor(const QWidget *parent)
|
||||
{
|
||||
QVector<std::shared_ptr<View>> result;
|
||||
const QObjectList children = parent->children();
|
||||
result.reserve(children.size());
|
||||
for (QObject *child : children) {
|
||||
if (auto widget = qobject_cast<QWidget *>(child)) {
|
||||
ViewWrapper *wrapper = new ViewWrapper_qtwidgets(widget);
|
||||
result.push_back(ViewWrapper::Ptr(wrapper));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
static QVector<std::shared_ptr<View>> childViewsFor(const QWidget *parent);
|
||||
|
||||
QVector<std::shared_ptr<View>> childViews() const override
|
||||
{
|
||||
|
||||
@@ -61,9 +61,6 @@ target_link_libraries(tst_viewguard kddockwidgets kdbindings)
|
||||
add_executable(tst_view tst_view.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_view kddockwidgets kdbindings)
|
||||
|
||||
add_executable(tst_viewwrapper tst_viewwrapper.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_viewwrapper kddockwidgets kdbindings)
|
||||
|
||||
add_executable(tst_group controllers/tst_group.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_group kddockwidgets kdbindings)
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
TEST_CASE("ViewWrapper::setParent")
|
||||
{
|
||||
auto r = createViewAndWindow({});
|
||||
auto rootView = r->asWrapper();
|
||||
REQUIRE(rootView);
|
||||
REQUIRE(!rootView->isNull());
|
||||
CHECK(rootView->childViews().isEmpty());
|
||||
|
||||
auto c = createViewAndWindow({}, r);
|
||||
auto childView = c->asWrapper();
|
||||
|
||||
CHECK(!rootView->parentView());
|
||||
REQUIRE(childView->parentView());
|
||||
CHECK(childView->parentView()->equals(rootView));
|
||||
const auto children = rootView->childViews();
|
||||
|
||||
REQUIRE_EQ(children.size(), 1);
|
||||
CHECK(children[0]->equals(childView));
|
||||
|
||||
auto r2 = createViewAndWindow({});
|
||||
auto rootView2 = r2->asWrapper();
|
||||
childView->setParent(r2);
|
||||
CHECK(childView->parentView()->equals(rootView2));
|
||||
CHECK(rootView->childViews().isEmpty());
|
||||
CHECK_EQ(rootView2->childViews().size(), 1);
|
||||
|
||||
// Deleting a view will remove it from its parent
|
||||
delete c;
|
||||
CHECK(rootView2->childViews().isEmpty());
|
||||
|
||||
delete r;
|
||||
delete r2;
|
||||
}
|
||||
|
||||
TEST_CASE("ViewWrapper::windowHandle,rootView,Window::rootView")
|
||||
{
|
||||
auto r = createViewAndWindow({});
|
||||
auto rootView = r->asWrapper();
|
||||
auto childView = createViewAndWindow({ true }, r)->asWrapper();
|
||||
|
||||
auto window = rootView->window();
|
||||
REQUIRE(window);
|
||||
CHECK_EQ(window->handle(), childView->window()->handle());
|
||||
CHECK(rootView->rootView()->equals(rootView));
|
||||
CHECK(childView->rootView()->equals(rootView));
|
||||
|
||||
REQUIRE(window->rootView());
|
||||
CHECK(window->rootView()->equals(rootView));
|
||||
}
|
||||
|
||||
TEST_CASE("ViewWrapper::minSize")
|
||||
{
|
||||
const QSize sizeHint = {};
|
||||
const QSize minSize = { 201, 202 };
|
||||
auto rootView = createViewAndWindow({ true, sizeHint, minSize })->asWrapper();
|
||||
CHECK_EQ(rootView->minSize(), minSize);
|
||||
}
|
||||
|
||||
TEST_CASE("ViewWrapper::objectName")
|
||||
{
|
||||
auto rootView = createViewAndWindow({})->asWrapper();
|
||||
|
||||
CHECK_EQ(rootView->objectName(), QString());
|
||||
const QString newName = QStringLiteral("name1");
|
||||
rootView->setObjectName(newName);
|
||||
CHECK_EQ(rootView->objectName(), newName);
|
||||
}
|
||||
|
||||
TEST_CASE("ViewWrapper::focusPolicy")
|
||||
{
|
||||
auto rootView = createViewAndWindow({});
|
||||
CHECK_EQ(rootView->asWrapper()->focusPolicy(), Qt::NoFocus);
|
||||
}
|
||||
|
||||
TEST_CASE("ViewWrapper::sizePolicy")
|
||||
{
|
||||
auto rootView = createViewAndWindow({});
|
||||
CHECK_EQ(rootView->asWrapper()->horizontalSizePolicy(), SizePolicy::Preferred);
|
||||
CHECK_EQ(rootView->asWrapper()->verticalSizePolicy(), SizePolicy::Preferred);
|
||||
}
|
||||
Reference in New Issue
Block a user