diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 16:06:43 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 16:06:43 +0200 |
commit | efb8f9d538724d5ee7420f055f049498021e7551 (patch) | |
tree | 5cb1c63d9c67597dc697b32757f26a5e82597ca7 | |
parent | e7b55037f48b8fcddbe283598cad4ef7dcf323f5 (diff) | |
download | serenity-efb8f9d538724d5ee7420f055f049498021e7551.zip |
LibGUI: Convert GTreeView to ObjectPtr
-rw-r--r-- | Applications/FileManager/main.cpp | 2 | ||||
-rw-r--r-- | DevTools/Inspector/main.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GTreeView.h | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 53caad0a20..c7530435b3 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -59,7 +59,7 @@ int main(int argc, char** argv) auto location_textbox = GTextEditor::construct(GTextEditor::SingleLine, location_toolbar); auto* splitter = new GSplitter(Orientation::Horizontal, widget); - auto* tree_view = new GTreeView(splitter); + auto tree_view = GTreeView::construct(splitter); auto file_system_model = GFileSystemModel::create("/", GFileSystemModel::Mode::DirectoriesOnly); tree_view->set_model(file_system_model); tree_view->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index d940c1216a..c2d20710e5 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -46,7 +46,7 @@ int main(int argc, char** argv) window->set_title(String::format("Inspector: %s (%d)", remote_process.process_name().characters(), remote_process.pid())); }; - auto* tree_view = new GTreeView(splitter); + auto tree_view = GTreeView::construct(splitter); tree_view->set_model(remote_process.object_graph_model()); tree_view->set_activates_on_selection(true); diff --git a/Libraries/LibGUI/GTreeView.h b/Libraries/LibGUI/GTreeView.h index d08b9931e3..ece094a3a6 100644 --- a/Libraries/LibGUI/GTreeView.h +++ b/Libraries/LibGUI/GTreeView.h @@ -5,12 +5,13 @@ class GTreeView : public GAbstractView { C_OBJECT(GTreeView) public: - explicit GTreeView(GWidget*); virtual ~GTreeView() override; virtual void scroll_into_view(const GModelIndex&, Orientation); protected: + explicit GTreeView(GWidget*); + virtual void paint_event(GPaintEvent&) override; virtual void mousedown_event(GMouseEvent&) override; virtual void doubleclick_event(GMouseEvent&) override; |