forked from Sepanta/console-emulator
4 changed files with 155 additions and 84 deletions
@ -0,0 +1,46 @@ |
|||
import QtQuick 2.0 |
|||
import QtQuick.Layouts 1.13 |
|||
import QtQuick.Controls 2.12 |
|||
import de.skycoder42.QtMvvm.Core 1.0 |
|||
import de.skycoder42.QtMvvm.Quick 1.0 |
|||
import com.example.consoleemulator 1.0 |
|||
|
|||
import "qrc:/emulator/elements" |
|||
import "qrc:/emulator/components" |
|||
import "qrc:/const" |
|||
import "qrc:/qtmvvm/views" |
|||
|
|||
Item { |
|||
id: root |
|||
implicitWidth: width |
|||
implicitHeight: 25 |
|||
property var isDisable: false |
|||
property var viewModelProperty |
|||
property var isProbeEnableProperty |
|||
property alias model: idComobBox.model |
|||
ComboBox { |
|||
id: idComobBox |
|||
visible: isDisable |
|||
model: probeList |
|||
width: parent.width |
|||
implicitWidth: width |
|||
implicitHeight: parent.height |
|||
MvvmBinding { |
|||
viewModel: mainView.viewModel |
|||
viewProperty: "currentIndex" |
|||
viewModelProperty: root.viewModelProperty |
|||
} |
|||
} |
|||
Text { |
|||
visible: !isDisable |
|||
text: idComobBox.currentText |
|||
anchors.fill: parent |
|||
horizontalAlignment: Text.AlignHCenter |
|||
} |
|||
|
|||
MvvmBinding { |
|||
viewModel: mainView.viewModel |
|||
viewProperty: "isDisable" |
|||
viewModelProperty: isProbeEnableProperty |
|||
} |
|||
} |
Loading…
Reference in new issue