diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-10-11 01:49:45 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-10-11 01:49:45 +0000 |
commit | 49d9a811a4f39337fa6b23353cc6379d36cff410 (patch) | |
tree | 339c89cc1bf0801e7c36815f08e6ed7d29bf6aee | |
parent | layout (diff) | |
download | gpg4usb-49d9a811a4f39337fa6b23353cc6379d36cff410.tar.gz gpg4usb-49d9a811a4f39337fa6b23353cc6379d36cff410.zip |
layout
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1047 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | qml/keydetails.qml | 57 | ||||
-rw-r--r-- | qmlpage.cpp | 6 |
2 files changed, 44 insertions, 19 deletions
diff --git a/qml/keydetails.qml b/qml/keydetails.qml index 7eeda02..81229df 100644 --- a/qml/keydetails.qml +++ b/qml/keydetails.qml @@ -1,68 +1,89 @@ import QtQuick 1.1 Rectangle { - width: 400 //these are the only explicit sizes set + width: 600 //these are the only explicit sizes set height: 400 //all others are relative anchors.fill: parent //color: "red" - Text { + Rectangle { + id: rectangle2 + x: 120 + y: 0 + width: 480 + height: 47 + color: "#3779d5" + } + + Rectangle { + id: rectangle1 + x: 0 + y: 0 + width: 120 + height: 400 + color: "#827968" + } + + Text { // qsTr() for internationalisation, like tr() - x: 118 - y: 37 + x: 136 + y: 54 text: qsTr("id:") } Text { - x: 172 - y: 37 + x: 190 + y: 54 text: id } Text { id: text1 - x: 118 - y: 58 + x: 136 + y: 75 text: qsTr("email:") } Text { id: text2 - x: 172 - y: 58 + x: 190 + y: 75 text: email } Text { id: text3 - x: 119 - y: 79 + x: 137 + y: 96 text: qsTr("name:") } Text { id: text4 - x: 172 - y: 79 + x: 190 + y: 96 text: name } + Image { id: image1 x: 0 y: 0 - width: 100 - height: 400 + width: 120 + height: 273 source: "qrc:/wizard_keys.png" } Text { id: text5 - x: 119 - y: 0 + x: 136 + y: 7 width: 20 height: 15 text: qsTr("Keydetails") font.pixelSize:22 } + + } diff --git a/qmlpage.cpp b/qmlpage.cpp index eb40fca..0063f08 100644 --- a/qmlpage.cpp +++ b/qmlpage.cpp @@ -1,6 +1,7 @@ #include "qmlpage.h" #include <QtDeclarative/QDeclarativeView> #include <QVBoxLayout> +#include <QGridLayout> #include <QDebug> #include <QDeclarativeContext> @@ -12,6 +13,7 @@ QMLPage::QMLPage(KgpgCore::KgpgKey key, QWidget *parent) : // http://harmattan-dev.nokia.com/docs/library/html/qt4/qml-integration.html // http://qt-project.org/doc/qt-4.8/qtbinding.html QDeclarativeView *qmlView = new QDeclarativeView; + qmlView->setResizeMode(QDeclarativeView::SizeRootObjectToView); qmlView->setSource(QUrl("qrc:/qml/keydetails.qml")); QDeclarativeContext *context = qmlView->rootContext(); @@ -23,6 +25,8 @@ QMLPage::QMLPage(KgpgCore::KgpgKey key, QWidget *parent) : //QWidget *widget = myExistingWidget(); - QVBoxLayout *layout = new QVBoxLayout(this); + //QVBoxLayout *layout = new QVBoxLayout(this); + QGridLayout *layout = new QGridLayout(this); + layout->setOriginCorner(Qt::TopLeftCorner); layout->addWidget(qmlView); } |