Skip to content

Commit 88f4462

Browse files
authored
Merge pull request #3018 from lilyinstarlight/misc-qt-fixes
GUI - miscellaneous Qt Tau/PhX widget fixes
2 parents c781155 + 7811a2b commit 88f4462

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

app/gui/qt/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ if(Qt6_FOUND AND WITH_QT_GUI_WEBENGINE)
4444
add_compile_definitions(WITH_WEBENGINE)
4545
elseif(Qt6_FOUND)
4646
find_package(Qt6 COMPONENTS Core Widgets Gui Concurrent Network OpenGLWidgets PrintSupport Xml Svg REQUIRED)
47+
elseif(WITH_QT_GUI_WEBENGINE)
48+
find_package(Qt5 COMPONENTS Core Widgets Gui Concurrent Network OpenGL PrintSupport Xml Svg WebEngineWidgets REQUIRED)
49+
add_compile_definitions(WITH_WEBENGINE)
4750
else()
4851
find_package(Qt5 COMPONENTS Core Widgets Gui Concurrent Network OpenGL PrintSupport Xml Svg REQUIRED)
4952
endif()
@@ -97,7 +100,7 @@ set(SOURCES
97100
${QTAPP_ROOT}/model/settings.h
98101
)
99102

100-
if(Qt6_FOUND AND WITH_QT_GUI_WEBENGINE)
103+
if(WITH_QT_GUI_WEBENGINE)
101104
set(SOURCES
102105
${SOURCES}
103106
${QTAPP_ROOT}/widgets/phxwebview.h

app/gui/qt/widgets/phxwebview.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
PhxWebView::PhxWebView(QWidget *parent)
1818
: QWebEngineView(parent)
1919
{
20-
phxProfile = new QWebEngineProfile(this);
21-
phxPage = new QWebEnginePage(phxProfile, this);
20+
phxProfile = new QWebEngineProfile();
21+
phxPage = new QWebEnginePage(phxProfile);
22+
phxPage->setParent(this);
23+
phxProfile->setParent(this);
2224
setPage(phxPage);
2325
setContextMenuPolicy(Qt::NoContextMenu);
2426
setZoomFactor(2.0);

app/gui/qt/widgets/phxwidget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PhxWidget::PhxWidget(QWidget *parent)
3232
phxView->setSizePolicy(sp_retain);
3333
phxView->hide();
3434
mainLayout = new QHBoxLayout(this);
35-
topRowSubLayout = new QVBoxLayout(this);
35+
topRowSubLayout = new QVBoxLayout();
3636
sizeDownButton = new QPushButton("-");
3737
sizeUpButton = new QPushButton("+");
3838
openExternalBrowserButton = new QPushButton(" E ");
@@ -51,7 +51,6 @@ PhxWidget::PhxWidget(QWidget *parent)
5151
mainLayout->addWidget(phxView, 1);
5252
mainLayout->addLayout(topRowSubLayout);
5353

54-
5554
connect(sizeDownButton, &QPushButton::released, this, &PhxWidget::handleSizeDown);
5655
connect(sizeUpButton, &QPushButton::released, this, &PhxWidget::handleSizeUp);
5756
connect(openExternalBrowserButton, &QPushButton::released, this, &PhxWidget::handleOpenExternalBrowser);

0 commit comments

Comments
 (0)