最近对qt-creator的源代码进行了分析研究,包括编译、静态分析、动态调试,用source insight感觉看不太清,于是用qt-creator调试qt-creator,(以前用vs2013调试过qt-creator,但现在忘了当时有什么研究成果,没有记录下来),做下记录备忘。
qt-creator采用plugin机制,连主界面都是plugin,(叫做coreplugin),这次想研究qt-creator的编辑器,于是跟踪到texteditor创建过程:
1 TextEditor::TextEditorFactory::createEditor texteditor.cpp 7796 0x7fffd9f9b877
2 Core::Internal::EditorManagerPrivate::createEditor editormanager.cpp 1128 0x7fffdb106898
3 Core::Internal::EditorManagerPrivate::openEditor editormanager.cpp 620 0x7fffdb103045
4 Core::EditorManager::openEditor editormanager.cpp 2567 0x7fffdb10eec7
5 ProjectExplorer::Internal::ProjectTreeWidget::openItem projecttreewidget.cpp 544 0x7fffd94c972a
6 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QModelIndex const&>, void, void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&)>::call qobjectdefs_impl.h 501 0x7fffd94d039c
7 QtPrivate::FunctionPointer<void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&)>::call<QtPrivate::List<QModelIndex const&>, void> qobjectdefs_impl.h 520 0x7fffd94cfc65
8 QtPrivate::QSlotObject<void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&), QtPrivate::List<QModelIndex const&>, void>::impl qobject_impl.h 143 0x7fffd94cee23
9 QMetaObject::activate(QObject *, int, int, void * *) 0x7ffff5ed70ce
10 QAbstractItemView::activated(QModelIndex const&) 0x7ffff7251cc5
11 QTreeView::mouseDoubleClickEvent(QMouseEvent *) 0x7ffff729ab27
12 QWidget::event(QEvent *) 0x7ffff7045b21
13 QFrame::event(QEvent *) 0x7ffff7142b9e
14 QAbstractItemView::viewportEvent(QEvent *) 0x7ffff725f06b
15 QTreeView::viewportEvent(QEvent *) 0x7ffff729ca10
16 QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *, QEvent *) 0x7ffff5ead8f3
17 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7ffff7002b75
18 QApplication::notify(QObject *, QEvent *) 0x7ffff7007820
19 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7ffff5eadb80
20 QApplicationPrivate::sendMouseEvent(QWidget *, QMouseEvent *, QWidget *, QWidget *, QWidget * *, QPointer<QWidget>&, bool) 0x7ffff700649f
21 ?? 0x7ffff70614c6
22 ?? 0x7ffff7063aa3
23 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7ffff7002b9c
24 QApplication::notify(QObject *, QEvent *) 0x7ffff7006f00
25 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7ffff5eadb80
26 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *) 0x7ffff67ae3a3
27 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *) 0x7ffff67af5c5
28 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x7ffff6790b23
29 ?? 0x7fffedd99550
30 g_main_context_dispatch 0x7ffff3cdfc5d
31 ?? 0x7ffff3cdff48
32 g_main_context_iteration 0x7ffff3cdfffc
33 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x7ffff5efd177
34 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x7ffff5eabbca
35 QCoreApplication::exec() 0x7ffff5eb3a5d
36 main main.cpp 527 0x40ee8a
这是从coreplugin跟过来的,下面进入TextEditor的分析。(先保存,待续)
本文详细分析了Qt Creator编辑器的创建过程,从核心插件开始,逐步跟踪到TextEditor的创建流程,涉及多个关键函数及文件路径。

810

被折叠的 条评论
为什么被折叠?



