Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QQmlApplicationEngine failed to load component #3

Closed
mottosso opened this issue Sep 29, 2014 · 5 comments
Closed

QQmlApplicationEngine failed to load component #3

mottosso opened this issue Sep 29, 2014 · 5 comments

Comments

@mottosso
Copy link
Member

QML isn't being picked up.

The issue is resolved by creating a qt.conf file at c:\Python27 with this content:

[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt5

I'd ideally keep everything within the PyQt5 package, but at least there is a simple solution available. Is there an environment variable available for Prefix?

@madoodia
Copy link

I remember that i used this before for interact with qml folder and plugin
folder, in qt.conf

[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt5
Binaries = C:/Python27/Lib/site-packages/PyQt5
Plugins = C:/Python27/Lib/site-packages/PyQt5/plugins

On Mon, Sep 29, 2014 at 8:32 PM, Marcus Ottosson notifications@github.com
wrote:

QML isn't being picked up.

The issue is resolved by creating a qt.conf file at c:\Python27 with this
content:

[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt5

I'd ideally keep everything within the PyQt5 package, but at least there
is a simple solution available. Is there an environment variable available
for Prefix?


Reply to this email directly or view it on GitHub
#3.

Bests,
madoodia

@mottosso
Copy link
Member Author

Here it's working fine with just the Prefix variable. Can you try removing the others and see if it works for you?

@madoodia
Copy link

it works for me for the following example with just prefix

main.qml

import QtQuick 2.0
import QtQuick.Controls 1.0

ApplicationWindow {
id: root
width: 350
height: 450
title: "Pyblish"
Rectangle {
id: window
width: parent.width
height: parent.height
color: "#00aa00"
}
}

launcher.py

import sysimport os
from PyQt5.QtWidgets import QApplicationfrom PyQt5.QtQml import
QQmlApplicationEngine
if name == 'main':
full_directory = os.path.dirname(os.path.abspath(file))
app = QApplication(sys.argv)
engine = QQmlApplicationEngine()
qml_file = os.path.join(full_directory, "main.qml")
engine.load(str(qml_file))

window = engine.rootObjects()[0]
window.show()
sys.exit(app.exec_())

but i mention it when we need to use plugins

btw, it works fine for me

i’m testing it with pyblish-qml

On Mon, Sep 29, 2014 at 9:05 PM, Marcus Ottosson notifications@github.com
wrote:

Here it's working fine with just the Prefix variable. Can you try
removing the others and see if it works for you?


Reply to this email directly or view it on GitHub
#3 (comment).

Bests,
madoodia

@madoodia
Copy link

Very nice
pyblish-qml works fine and show me the window without any error in a VM
that just have python, VCredist2013 and python-qt5 installed as PyQt5
package.

thanks

On Mon, Sep 29, 2014 at 9:10 PM, Mahmoodreza Aarabi madoodia@gmail.com
wrote:

it works for me for the following example with just prefix

main.qml

import QtQuick 2.0
import QtQuick.Controls 1.0

ApplicationWindow {
id: root
width: 350
height: 450
title: "Pyblish"
Rectangle {
id: window
width: parent.width
height: parent.height
color: "#00aa00"
}
}

launcher.py

import sysimport os
from PyQt5.QtWidgets import QApplicationfrom PyQt5.QtQml import QQmlApplicationEngine
if name == 'main':
full_directory = os.path.dirname(os.path.abspath(file))
app = QApplication(sys.argv)
engine = QQmlApplicationEngine()
qml_file = os.path.join(full_directory, "main.qml")
engine.load(str(qml_file))

window = engine.rootObjects()[0]
window.show()
sys.exit(app.exec_())

but i mention it when we need to use plugins

btw, it works fine for me

i’m testing it with pyblish-qml

On Mon, Sep 29, 2014 at 9:05 PM, Marcus Ottosson <notifications@github.com

wrote:

Here it's working fine with just the Prefix variable. Can you try
removing the others and see if it works for you?


Reply to this email directly or view it on GitHub
#3 (comment).

Bests,
madoodia

Bests,
madoodia

@mottosso
Copy link
Member Author

Solved with 0.1.6

QML and inner binaries - e.g. qmlscene.exe - works fine too.

alon added a commit to alon/emolog that referenced this issue Oct 22, 2016
Remove usage of "Qt.labs.controls 1.0", no need for lab controls yet,
and under fedora python 3.5 venv they are not supported yet.

Use QQmlApplicationEngine as root window
 - pyqt/python-qt5#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants