aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-29 14:39:41 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-29 13:59:10 +0000
commit68e45b4852c2fa3a7722619470d35fb506d44a54 (patch)
tree8eea6bde30fb4dd67fd5bcd5ab25c1df630886c9
parentbe1f6327428ff746d2a4e903c1223d2664f16759 (diff)
Calendar: "soft" content item references
Cleanup the hard-coded references to the built-in content item, to let applications replace the content item with a custom one. Change-Id: I08659170fd7c586517faa473c68fb6b3b2daa7f7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/imports/calendar/CalendarView.qml7
-rw-r--r--src/imports/calendar/DayOfWeekRow.qml6
-rw-r--r--src/imports/calendar/WeekNumberColumn.qml6
3 files changed, 6 insertions, 13 deletions
diff --git a/src/imports/calendar/CalendarView.qml b/src/imports/calendar/CalendarView.qml
index 42d8e76f..2d77c6f4 100644
--- a/src/imports/calendar/CalendarView.qml
+++ b/src/imports/calendar/CalendarView.qml
@@ -50,8 +50,8 @@ AbstractCalendarView {
//! [delegate]
delegate: Text {
- width: grid.width ? grid.width / 7 : implicitWidth * 3
- height: grid.height ? grid.height / 6 : implicitHeight * 3
+ width: contentItem.width ? contentItem.width / 7 : implicitWidth * 3
+ height: contentItem.height ? contentItem.height / 6 : implicitHeight * 3
minimumPointSize: 8
fontSizeMode: Text.Fit
horizontalAlignment: Text.AlignHCenter
@@ -65,13 +65,10 @@ AbstractCalendarView {
//! [contentItem]
contentItem: Grid {
- id: grid
-
rows: 6
columns: 7
Repeater {
- id: repeater
model: control.source
delegate: control.delegate
}
diff --git a/src/imports/calendar/DayOfWeekRow.qml b/src/imports/calendar/DayOfWeekRow.qml
index 8f88def4..50c1cb46 100644
--- a/src/imports/calendar/DayOfWeekRow.qml
+++ b/src/imports/calendar/DayOfWeekRow.qml
@@ -54,8 +54,8 @@ AbstractDayOfWeekRow {
text: model.shortName
font.bold: true
color: control.Theme.textColor
- width: row.width ? row.width / 7 : implicitWidth
- height: row.height ? row.height : implicitHeight
+ width: contentItem.width ? contentItem.width / 7 : implicitWidth
+ height: contentItem.height ? contentItem.height : implicitHeight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
@@ -63,8 +63,6 @@ AbstractDayOfWeekRow {
//! [contentItem]
contentItem: Row {
- id: row
-
Repeater {
model: control.source
delegate: control.delegate
diff --git a/src/imports/calendar/WeekNumberColumn.qml b/src/imports/calendar/WeekNumberColumn.qml
index 0fb8a87b..7235262b 100644
--- a/src/imports/calendar/WeekNumberColumn.qml
+++ b/src/imports/calendar/WeekNumberColumn.qml
@@ -54,8 +54,8 @@ AbstractWeekNumberColumn {
text: model.weekNumber
font.bold: true
color: control.Theme.textColor
- width: column.width ? column.width : implicitWidth
- height: column.height ? column.height / 6 : implicitHeight
+ width: contentItem.width ? contentItem.width : implicitWidth
+ height: contentItem.height ? contentItem.height / 6 : implicitHeight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
@@ -63,8 +63,6 @@ AbstractWeekNumberColumn {
//! [contentItem]
contentItem: Column {
- id: column
-
Repeater {
model: control.source
delegate: control.delegate