I have a problem in which I need my application to have in the same window the system API controls and some elements I have found only to be available in QML (a hybrid one could say). So I have read here: http://www.qtforum.org/index.php?pag...qtbinding.html
But it is creating a new window instance instead of showing the element into the normal C++ window instance. In other words, its creating 2 windows when I use QDeclarativeView.
Here is my rectangle.qml
import Qt 4.7
Rectangle {
width: 100
height: 62
radius: 13
gradient: Gradient {
GradientStop {
position: 0
color: "#95eac2"
}
GradientStop {
position: 0.5
color: "#4bb0ee"
}
GradientStop {
position: 0.97
color: "#7ce0d5"
}
GradientStop {
position: 1
color: "#ffffff"
}
}
}
import Qt 4.7
Rectangle {
width: 100
height: 62
radius: 13
gradient: Gradient {
GradientStop {
position: 0
color: "#95eac2"
}
GradientStop {
position: 0.5
color: "#4bb0ee"
}
GradientStop {
position: 0.97
color: "#7ce0d5"
}
GradientStop {
position: 1
color: "#ffffff"
}
}
}
To copy to clipboard, switch view to plain text mode
and the code I added to the main.cpp code to display the rectangle:
QDeclarativeView view;
view.
setSource(QUrl::fromLocalFile("qrc:/rectangle.qml"));
view.show();
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("qrc:/rectangle.qml"));
view.show();
To copy to clipboard, switch view to plain text mode
I was wondering if it was possible to insert some sort of frame inside the .ui design that allowed me to later display the qml element inside the .ui interface. In the attached image is the idea of what I want to do. Does anyone know?
Bookmarks