Merge pull request #3 from huffman/feat/avatarTools/avatarPackager

Fix AvatarPackager QML size
This commit is contained in:
Thijs Wenker 2018-12-14 00:35:23 +01:00 committed by GitHub
commit ceb3b6385d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 26 deletions

View file

@ -21,9 +21,11 @@ Windows.ScrollingWindow {
implicitWidth: 384; implicitHeight: 640
minSize: Qt.vector2d(200, 300)
//HifiConstants { id: hifi }
Rectangle {
anchors.fill: parent
Item {
height: pane.height
width: pane.width
AvatarProject {
id: avatarProject
@ -32,7 +34,7 @@ Windows.ScrollingWindow {
anchors.fill: parent
}
Rectangle {
Item {
id: avatarPackagerMain
anchors.left: parent.left
anchors.right: parent.right

View file

@ -6,18 +6,17 @@ import QtGraphicalEffects 1.0
import "../../controlsUit" 1.0 as HifiControls
import "../../stylesUit" 1.0
Rectangle {
Item {
id: root
HifiConstants { id: hifi }
property int colorScheme;
color: "blue"
visible: true
anchors.fill: parent
anchors.margins: 10
RalewaySemiBold {
id: avatarProjectLabel
@ -26,11 +25,13 @@ Rectangle {
anchors.topMargin: 25
anchors.bottomMargin: 25
text: 'Avatar Project'
color: "white"
}
HifiControls.Button {
id: openFolderButton
width: parent.width
anchors.top: avatarProjectLabel.bottom
anchors.topMargin: 10
text: qsTr("Open Project Folder")
colorScheme: root.colorScheme
height: 30
@ -38,28 +39,15 @@ Rectangle {
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
}
}
HifiControls.Button {
id: uploadButton
width: parent.width
anchors.top: openFolderButton.bottom
text: qsTr("Upload")
color: hifi.buttons.blue
colorScheme: root.colorScheme
height: 30
onClicked: function() {
}
}
Text {
id: modelText
anchors.top: uploadButton.bottom
height: 30
text: parent.height
}
Rectangle {
color: 'white'
visible: AvatarPackagerCore.currentAvatarProject !== null
width: parent.width
anchors.top: modelText.bottom
anchors.top: openFolderButton.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: uploadButton.top
anchors.topMargin: 10
anchors.bottomMargin: 10
height: 1000
ListView {
@ -68,4 +56,15 @@ Rectangle {
delegate: Text { text: '<b>File:</b> ' + modelData }
}
}
HifiControls.Button {
id: uploadButton
width: parent.width
anchors.bottom: parent.bottom
text: qsTr("Upload")
color: hifi.buttons.blue
colorScheme: root.colorScheme
height: 30
onClicked: function() {
}
}
}

View file

@ -17,6 +17,7 @@
#include <QFileInfo>
#include <QUrl>
#include <QDebug>
#include <QQmlEngine>
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
const auto pathToLower = path.toLower();
@ -25,7 +26,9 @@ AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
if (!file.open(QIODevice::ReadOnly)) {
return nullptr;
}
return new AvatarProject(path, file.readAll());
auto project = new AvatarProject(path, file.readAll());
QQmlEngine::setObjectOwnership(project, QQmlEngine::CppOwnership);
return project;
}
if (pathToLower.endsWith(".fbx")) {