mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
Ladybird/Qt: Do not "share" ownership of Qt objects
When a QObject subclass (widgets, etc.) are provided a parent, then ownership of that object is passed to the parent. Similarly, objects added to a QLayout are owned by the layout. Thus, do not store these objects in an OwnPtr.
This commit is contained in:
parent
a21998003c
commit
4653733a0d
Notes:
sideshowbarker
2024-07-16 22:14:49 +09:00
Author: https://github.com/trflynn89
Commit: 4653733a0d
Pull-request: https://github.com/SerenityOS/serenity/pull/22161
Reviewed-by: https://github.com/ADKaster ✅
9 changed files with 103 additions and 92 deletions
|
|
@ -15,7 +15,7 @@ extern bool is_using_dark_system_theme(QWidget&);
|
|||
|
||||
InspectorWidget::InspectorWidget(WebContentView& content_view)
|
||||
{
|
||||
m_inspector_view = make<WebContentView>(WebContentOptions {}, StringView {});
|
||||
m_inspector_view = new WebContentView({}, {});
|
||||
|
||||
if (is_using_dark_system_theme(*this))
|
||||
m_inspector_view->update_palette(WebContentView::PaletteMode::Dark);
|
||||
|
|
@ -23,7 +23,7 @@ InspectorWidget::InspectorWidget(WebContentView& content_view)
|
|||
m_inspector_client = make<WebView::InspectorClient>(content_view, *m_inspector_view);
|
||||
|
||||
setLayout(new QVBoxLayout);
|
||||
layout()->addWidget(m_inspector_view.ptr());
|
||||
layout()->addWidget(m_inspector_view);
|
||||
|
||||
setWindowTitle("Inspector");
|
||||
resize(875, 825);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue