2013-03-09 84 views
0

我有一個C++類constuctor格式初始化列表中列出

Status::Status(QObject *parent) : QObject(parent) 
    , m_currentPage(Status::UndefinedPage) 
    , m_lastPage(Status::UndefinedPage) , 
    m_currentSubPage(Status::UndefinedSubPage), m_lastSubPage(Status::UndefinedSubPage) 
    , m_ptr(0) 
{ 
} 

,並希望看到像這樣

Status::Status(QObject *parent) 
    : QObject(parent) 
    , m_currentPage(Status::UndefinedPage) 
    , m_lastPage(Status::UndefinedPage) 
    , m_currentSubPage(Status::UndefinedSubPage) 
    , m_lastSubPage(Status::UndefinedSubPage) 
    , m_ptr(0) 
{ 
} 

我已經找到了相關的選項:

nl_class_colon       = remove 
nl_class_init_args      = remove 
pos_comma        = lead_force 
pos_class_comma       = lead_force 
pos_class_colon       = lead_force 

但這也影響了我不想要的正常功能參數。只要我改變pos_comma,我的所有成員初始化列表就會變得擁擠。

如何定義與函數參數列表不同的構造函數初始化列表?

謝謝。

編輯:我想在函數參數列表看起來像

int r = myFuntion("a", "b", 
        "c"); 

回答

0

不,Uncrustify 0.60,這是不可能的。你必須堅持不同的風格或尋找另一個格式化程序。您也可以提交功能請求。