From 2cf02525ca73eeb3bb7e919553583df3a2725ad9 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 4 Jan 2025 12:23:03 +1300 Subject: [PATCH] examples/modelview_color6: update syntax --- examples/modelview_color6/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/modelview_color6/main.go b/examples/modelview_color6/main.go index 035692d1..da48f246 100644 --- a/examples/modelview_color6/main.go +++ b/examples/modelview_color6/main.go @@ -23,16 +23,16 @@ func main() { switch qt.ItemDataRole(role) { case qt.ForegroundRole: - if idx.Row() % 2 == 0 { - return qt.NewQVariant4099(qt.NewQColor3(0, 0, 0)) + if idx.Row()%2 == 0 { + return qt.NewQColor3(0, 0, 0).ToQVariant() } else { - return qt.NewQVariant4099(qt.NewQColor3(255, 0, 0)) + return qt.NewQColor3(255, 0, 0).ToQVariant() } case qt.BackgroundRole: - if idx.Row() % 2 == 0 { - return qt.NewQVariant4099(qt.NewQColor3(255, 255, 255)) + if idx.Row()%2 == 0 { + return qt.NewQColor3(255, 255, 255).ToQVariant() } else { - return qt.NewQVariant4099(qt.NewQColor3(80, 80, 80)) + return qt.NewQColor3(80, 80, 80).ToQVariant() } case qt.DisplayRole: return qt.NewQVariant14(fmt.Sprintf("this is row %d", idx.Row()))