Now ,I get a solution.
int screenWidth = QApplication::desktop()->width();
int screenHeight = QApplication::desktop()->height();
And then ,I pass these data to the qml
view.rootContext()->setContextProperty("screenWidth",screenWidth);
view.rootContext()->setContextProperty("screenHeight",screenHeight);
And luckily,It work.
On Oct 19, 1:38 pm, Adam Pigg <
pig...@gmail.com> wrote:
> how about using the size of the root element, so long as it is set to resize
> to the view, eg
>
> viewer->setResizeMode(QDeclarativeView::SizeRootObjectToView);
>
> On Wed, Oct 19, 2011 at 4:14 AM, Sinitsin Igor <
igor.m.sinit...@gmail.com>wrote:
>
>
>
>
>
>
>
> > How I can see, you must have different qml for different screen sizes (this
> > I see in qml examples)
>
> > 19.10.2011 7:58 пользователь "剑鹏 李" <
limoonb...@gmail.com> написал: