Fit Grid elements in Item

Luiz Romário Santana Rios luizromario at gmail.com
Mon Sep 24 03:05:45 UTC 2012


Hello.

I'm trying to port the Calculator plasmoid to QML, but I'm stuck
trying to make the buttons fit their parent item. I'm doing this:

Item {
    anchors {
        top: resultArea.bottom
        bottom: parent.bottom
        left: parent.left
        right: parent.right
    }

    Grid {
        columns: 4
        spacing: 2

        anchors.fill: parent

        Repeater {
            model: ["C", "÷", "×", "AC",
                    "7", "8", "9", "-",
                    "4", "5", "6", "+"]

            PlasmaComponents.Button {
                id: buttonC
                text: modelData
            }
        }
    }
}

But I get this:

http://i47.tinypic.com/1z33z3o.png

Trying to anchor the buttons doesn't work either.

What should I do?

-- 
Luiz Romário Santana Rios


More information about the Plasma-devel mailing list