qt-creator源码研究2

在TextEditor里下断点,得到如下堆栈:

1  TextEditor::TextDocument::plainText                                                                                                                                                                       
2  CppEditor::Internal::CppEditorDocument::contentsText                                                                                                                                                      
3  CppEditor::Internal::CppEditorDocumentHandleImpl::contents                                                                                                                                                
4  CppTools::CppModelManager::buildWorkingCopyList                                                                                                                                                           
5  CppTools::CppModelManager::workingCopy                                                                                                                                                                    
6  CppTools::BuiltinEditorDocumentProcessor::run                                                                                                                                                             
7  CppEditor::Internal::CppEditorDocument::processDocument                                                                                                                                                   
8  CppEditor::Internal::CppEditorDocument::onFilePathChanged                                                                                                                                                 
9  QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<Utils::FileName const&, Utils::FileName const&>, void, void (CppEditor::Internal::CppEditorDocument:: *)(Utils::FileName const&, Util
10 QtPrivate::FunctionPointer<void (CppEditor::Internal::CppEditorDocument:: *)(Utils::FileName const&, Utils::FileName const&)>::call<QtPrivate::List<Utils::FileName const&, Utils::FileName const&>, void>
11 QtPrivate::QSlotObject<void (CppEditor::Internal::CppEditorDocument:: *)(Utils::FileName const&, Utils::FileName const&), QtPrivate::List<Utils::FileName const&, Utils::FileName const&>, void>::impl    
12 QMetaObject::activate(QObject *, int, int, void * *)                                                                                                                                                      
13 Core::IDocument::filePathChanged                                                                                                                                                                          
14 Core::IDocument::setFilePath                                                                                                                                                                              
15 TextEditor::TextDocument::setFilePath                                                                                                                                                                     
16 TextEditor::TextDocument::openImpl                                                                                                                                                                        
17 TextEditor::TextDocument::open                                                                                                                                                                            
18 Core::Internal::EditorManagerPrivate::openEditor                                                                                                                                                          
19 Core::EditorManager::openEditor                                                                                                                                                                           
20 ProjectExplorer::Internal::ProjectTreeWidget::openItem                                                                                                                                                    
21 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QModelIndex const&>, void, void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&)>::call                           
22 QtPrivate::FunctionPointer<void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&)>::call<QtPrivate::List<QModelIndex const&>, void>                                                  
23 QtPrivate::QSlotObject<void (ProjectExplorer::Internal::ProjectTreeWidget:: *)(QModelIndex const&), QtPrivate::List<QModelIndex const&>, void>::impl                                                      
24 QMetaObject::activate(QObject *, int, int, void * *)                                                                                                                                                      
25 QAbstractItemView::activated(QModelIndex const&)                                                                                                                                                          
26 QTreeView::mouseDoubleClickEvent(QMouseEvent *)                                                                                                                                                           
27 QWidget::event(QEvent *)                                                                                                                                                                                  
28 QFrame::event(QEvent *)                                                                                                                                                                                   
29 QAbstractItemView::viewportEvent(QEvent *)                                                                                                                                                                
30 QTreeView::viewportEvent(QEvent *)                                                                                                                                                                        
31 QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *, QEvent *)                                                                                                                               
32 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                                                   
33 QApplication::notify(QObject *, QEvent *)                                                                                                                                                                 
34 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                                                    
35 QApplicationPrivate::sendMouseEvent(QWidget *, QMouseEvent *, QWidget *, QWidget *, QWidget * *, QPointer<QWidget>&, bool)                                                                                
36 ??                                                                                                                                                                                                        
37 ??                                                                                                                                                                                                        
38 QApplicationPrivate::notify_helper(QObject *, QEvent *)                                                                                                                                                   
39 QApplication::notify(QObject *, QEvent *)                                                                                                                                                                 
40 QCoreApplication::notifyInternal2(QObject *, QEvent *)                                                                                                                                                    
41 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *)                                                                                                                    
42 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *)                                                                                                      
43 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                     
44 ??                                                                                                                                                                                                        
45 g_main_context_dispatch                                                                                                                                                                                   
46 ??                                                                                                                                                                                                        
47 g_main_context_iteration                                                                                                                                                                                  
48 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                                
49 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                                                                                                                                                   
50 QCoreApplication::exec()                                                                                                                                                                                  
51 main 

51级堆栈才到达我们的断点。可以看到调用轨迹,TextEditor会调用CppEditor,后者又会回调前者。我感觉qt-creator模块设计得不错,以后可扩充至任何语言。                                                                                                                                                                                                     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值