/*******************************************************************************
This file is part of mDictionary.
mDictionary is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mDictionary is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mDictionary. If not, see .
Copyright 2010 Comarch S.A.
*******************************************************************************/
/*!
author: Marcin Kaźmierczak
*/
import Qt 4.7
Rectangle {
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
// signal selectedRow(int nr)
id: rectangle1
color: myPalette.base
anchors.fill: parent
ElementsListView{
id: dictList
width: rectangle1.width
// height: rectangle1.height
anchors.top: parent.top
highlightResizeSpeed: 1000
delegate: Component{
id: dictListDelegate
Item {
width: rectangle1.width
height: {
if (nameText.height + 10 > logo.height)
return nameText.height + 10;
else
return logo.height;
}
MouseArea{
anchors.fill: parent
onClicked: {
dictList.currentIndex = number
}
onDoubleClicked: {
selectedRow(number)
}
}
Row {
//image zaznacz/odznacz
anchors.fill: parent
Image {
id: checkbox
// source: "qrc:/button/checkbox.png"
height: {
var aspectRatio = sourceSize.height / sourceSize.width
return logo.width * aspectRatio
}
anchors.verticalCenter: parent.verticalCenter
width: nameText.height + 10
states: [
State {
name: "checked";
when: (isSelected == true);
PropertyChanges { target: checkbox; source: "qrc:/button/checkboxChecked.png" }
},
State {
name: "unchecked";
when: (isSelected == false);
PropertyChanges { target: checkbox; source: "qrc:/button/checkbox.png" }
}
]
}
Image {
id: logo
source: iconPath
height: {
var aspectRatio = sourceSize.height / sourceSize.width
return logo.width * aspectRatio
}
anchors.verticalCenter: parent.verticalCenter
width: nameText.height + 10
}
Text {
id: nameText
text: name
anchors.left: logo.right
anchors.leftMargin: 5
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
model: dictModel
}
//buttonki
}