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");