How to set the background color for gridLaout?
Unsolved
QML and Qt Quick
-
I have a grid layout and i want to fix the background to black. But, I am not able to fix the color. Bcz gridLayout have no method "setStyleSheet".
-
@LeLev i will use this one code still not working for me
import QtQuick 2.5 import QtQuick.Layouts 1.1 Rectangle{ color:black GridLayout{} }
-
@LeLev Still not working . I am taking a grid and inside grid i will take 4 pushbutton . i will try to fix the backgroung color black.
but still background color not updatedimport QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.2 Window { visible: true width: 800 height: 600 Rectangle{ id:backGround color: "black" height: 200 width: 400 GridLayout{ anchors.fill: parent rows:2 columns:2 rowSpacing: 25 columnSpacing: 25 Repeater{ model : 4 Button { text: "btn " + index Layout.fillHeight: true Layout.fillWidth: true } } } } }
-
import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.2 Window { visible: true width: 800 height: 600 Rectangle{ id:backGround color: "black" height: 200 width: 400 GridLayout{ anchors.fill: parent rows:2 columns:2 rowSpacing: 25 columnSpacing: 25 Repeater{ model : 4 Button { text: "btn " + index Layout.fillHeight: true Layout.fillWidth: true } } } } }
-
@amarism what is your project type ? QtQuick Application or Widget Application ? Or are you trying to combine both ?
-