Seite 1 von 1

QtLocation wird nicht erkannt

BeitragVerfasst: Nov 15th, '15, 13:28
von schroedingerscat
Hallo miteinander!

Ich wollte mich heute mal ein bisschen mit der Entwicklung von QtQuick UIs beschäftigen, scheitere jedoch bereits an der Installation der benötigten Pakete. Das Ziel ist, einfach ein paar Punkte auf einer Karte zu markieren. Das wollte ich mit mit MapViewer machen (http://doc.qt.io/qt-5/qtlocation-mapviewer-example.html). Das Problem ist nun: Anscheinend habe ich dieses Paket nicht installiert... Ich habe qtlocation5 installiert. Bei folgender QML-Datei bekomme ich dennoch einen Fehler:

Code: Alles auswählen
import QtQuick 1.0
import QtPositioning 5.4
import QtLocation 5.4

 
Map {
    id: map
    zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
    center {
        // The Qt Company in Oslo
        latitude: 59.9485
        longitude: 10.7686
    }
}


Fehlermeldung:
Code: Alles auswählen
view.qml:2:1: module "QtPositioning" is not installed
     import QtPositioning 5.4


Welches Paket muss ich installieren, damit ich das Modul benutzen kann?

Einen schönen Sonntag
schroedingerscat

Re: QtLocation wird nicht erkannt

BeitragVerfasst: Nov 15th, '15, 16:27
von Latte
eventuell das hier?
Code: Alles auswählen
[marc@Laptop ~]$ urpmq -ay qtpositioning
qtpositioning5


Code: Alles auswählen
[marc@Laptop ~]$ urpmq -i qtpositioning5
Name        : qtpositioning5
Version     : 5.4.0
Release     : 1.mga5
Group       : System/Libraries
Size        : 338143                       Architecture: x86_64
Source RPM  : qtlocation5-5.4.0-1.mga5.src.rpm
URL         : http://www.qt-project.org
Summary     : Qt5 Positioning Component Library
Description :
Qt5 Component Library.

The Positioning module provides positioning information via QML and C++ interfaces.

Re: QtLocation wird nicht erkannt

BeitragVerfasst: Nov 15th, '15, 17:26
von schroedingerscat
Hab ich gerade installiert, es funktioniert immer noch nicht. Vielleicht sollte ich noch erwähnen, dass ich meine Anwendung in Python schreibe. Folgendes Script lädt das GUI aus der xml-Datei:

Code: Alles auswählen
#!/usr/bin/env python
# -'''- coding: utf-8 -'''-
 
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtDeclarative import QDeclarativeView
 
# Create Qt application and the QDeclarative view
app = QApplication(sys.argv)
view = QDeclarativeView()
# Create an URL to the QML file
url = QUrl('view.qml')
# Set the QML file and show
view.setSource(url)
view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
view.show()
# Enter Qt main loop
sys.exit(app.exec_())


Aber danke für die Antwort :)

Re: QtLocation wird nicht erkannt

BeitragVerfasst: Nov 15th, '15, 17:47
von alf
Wahrscheinlich brauchst du noch das Paket python-qt5-positioning.

Re: QtLocation wird nicht erkannt

BeitragVerfasst: Nov 15th, '15, 17:52
von schroedingerscat
Nein, das ändert leider auch nichts.