你'使用setLayoutDirection的錯誤枚舉:
// Don't use this. You need to use a different method
// if you want it placed against the left side.
enum ToolBarArea {
LeftToolBarArea = 0x1,
RightToolBarArea = 0x2,
TopToolBarArea = 0x4,
BottomToolBarArea = 0x8,
ToolBarArea_Mask = 0xf,
AllToolBarAreas = ToolBarArea_Mask,
NoToolBarArea = 0
};
您需要用的東西從Qt的::的layoutDirection:
enum LayoutDirection {
LeftToRight,
RightToLeft,
LayoutDirectionAuto
};
ui->_toolbar->setLayoutDirection(Qt::LeftToRight);
來源
2013-06-26 18:36:21
Huy
@Cpp和Qt初學者:Pssst,如果它幫助你 – Huy
還沒有機會嘗試它,你應該將回答標記爲答案。是不是我upvote = /。如果它有效,我一定會標記爲已回答。 – throwaway2013
addToolBar(Qt :: LeftToolBarArea,ui-> myToolbar); 創造了奇蹟 – throwaway2013