PDA

View Full Version : Toolbar عمودی



ali_72
پنج شنبه 17 دی 1394, 12:36 عصر
سلام دوستان
چطور میشه Toolbar عمودی داشته باشم؟

کد من



Rectangle { Layout.fillHeight: true
Layout.preferredWidth: 0.065*parent.width
color: "red"


ToolBar {
Layout.alignment: Qt.Vertical
style: ToolBarStyle {


background: Rectangle {
color: "transparent"
}
}


RowLayout {
anchors.fill: parent
layoutDirection: Qt.LeftToRight







MyToolButton{


Layout.alignment: Qt.Vertical


id:tbPlay
action: actPlay
MouseArea
{
id: maPlay
anchors.fill: parent
anchors.margins: -10
hoverEnabled:true

cursorShape: Qt.OpenHandCursor
}
iconSource:maPlay.containsMouse ? "images/play2.png":"images/play.png"
}




MyToolButton{
Layout.alignment: Qt.Vertical
id:tbSettingCompany
action: actCompany
MouseArea
{
id: maSettingCompany
anchors.fill: parent
anchors.margins: -10
hoverEnabled:true

cursorShape: Qt.OpenHandCursor
}
iconSource:maSettingCompany.containsMouse ? "images/company2.png":"images/company.png"
}

}
}




}

arashz4
پنج شنبه 17 دی 1394, 12:48 عصر
عمودی سمت راست

addToolBar(Qt::RightToolBarArea, ui->toolBar);
عمودی سمت چپ

addToolBar(Qt::LeftToolBarArea, ui->toolBar);

ali_72
پنج شنبه 17 دی 1394, 14:59 عصر
ممنون دوست عزیز

معادل این کد در qml:


ToolBar {
Layout.alignment: Qt.LeftToolBarArea