Questions tagged [qurl]

Class for handling URLs from Qt. Handles storage and encoding.

65 questions
2
votes
1 answer

PyQT | QDesktopServices.openUrl Doesn't work if path has spaces

I am trying to use QDesktopServices to have system open the files or folders specified. The code below works perfect for paths which doesn't have spaces in them but fails to execute if otherwise def openFile(self): print self.oVidPath print…
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
2
votes
1 answer

How to get the "query string" from a QUrl?

I have a QUrl and I need to extract the path+file+params. Basically everything but the hostname - what would be requested via HTTP. I looked through the Qt 4.6 docs but I couldn't find anything that looked like it would do this. What method(s) would…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
2
votes
0 answers

QDesktopServices backend on linux?

What is used to open urls with QDesktopServices::openUrl(...)? xdg-open, kopen, selmademachanism or a mix of them? I ask because it fails on a scheme where xdg-open does not. Edit: okay its getting even more curious: The missing scheme works in…
ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
2
votes
1 answer

Qt5 - How to make qurl detect wether the given url is local or not and add "http://" if not?

QUrl class can be used to open both local or online file. I used QLineEdit to take URL as QString and give it to QUrl. The program can access both local and online file. My point question is: is there any official way to automatically detect if the…
Mas Bagol
  • 4,377
  • 10
  • 44
  • 72
2
votes
3 answers

QUrl parsing in QT 5

I have a QUrl as this: https://www.example.com/index.html#token=SomeToken&user=guest and I want to obtain the value of the token i.e. SomeToken. I know about method QUrl::queryItemValue,so this code must work: void MainWindow::get_token(QUrl…
2
votes
1 answer

QUrl, right coding for paths

I have a problem with coding. I'm using drag and drom inside my application but some text files I can not open, after some searching I find that the path is with wrong coding. The real file is 'Some_file - 01.txt' but when I try print this path…
Lodhart
  • 205
  • 1
  • 6
  • 14
2
votes
0 answers

QUrl: Protocol "sftp" is unknown

I am trying to LIST my sftp server, but I’ve got a problem when sending my request: if I print my QNetworkReply::errorString(), this is what I get: Protocol “sftp” is unknown This is what my QUrl looks…
lagarkane
  • 915
  • 2
  • 9
  • 22
1
vote
1 answer

QTextEdit not working

Why doesn't drag and drop pictures work on this QTextEdit? I have tried everything. here is the class TextEdit: //textedit class TextEdit : public QTextEdit { Q_OBJECT public: TextEdit(QWidget*parent) : QTextEdit(parent) { …
Geore Shg
  • 1,299
  • 5
  • 23
  • 38
1
vote
0 answers

ERR_TOO_MANY_RETRIES error when loading a local webpage PySide2, QUrl, and QtWebEngineWidgets.QWebEngineView

I am receiving a ERR_TOO_MANY_RETRIES while trying to load a local SQL website into a PySide2 application. Any solution to this? I have tried using https and http, as well as using reports = QUrl.fromUserInput("") with replaced with the URL to try…
1
vote
2 answers

Convert QString or QUrl to Unicode

I want to convert a part of QUrl to Unicode. I have a given URL, www.ÄSDF.de and want to convert it to www.%C4SDF.de. How can I do that in Qt? When I use the method QUrl::toEncoded() I always get the converted URL in UTF-8 hex:…
Garrz
  • 19
  • 1
  • 2
1
vote
1 answer

Convert Windows UNC path to QUrl for Mac

Background: I've got a database where paths to video files are stored as Windows UNC path strings, for example "\\11.22.33.44\path\movie.mp4". (The Windows format is a legacy thing and I can't fundamentally change how these are stored). I'm now…
1
vote
1 answer

How to keep current URL updated in QWebKit browser

I am making a very simple browser with a search box using PyQt5 WebKit. This is the code I'm using: import sys from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QAction, QLineEdit, QMessageBox,…
Sid
  • 2,174
  • 1
  • 13
  • 29
1
vote
0 answers

QUrl, get a string url with location that contains "//"

I create a URL using QUrl. void MainWindow::on_btnExecute_clicked() { QUrl url; url.setScheme("https"); url.setPath("myPath"); QUrlQuery query; query.addQueryItem("myQuery", "query1"); url.setQuery(query); const auto…
marco
  • 1,686
  • 1
  • 25
  • 33
1
vote
1 answer

Playing Audio with QtMultimedia?

Part of a PyQt5 program I'm writing is to take in an audio stream and play it back. I've searched around and this is the code I have found that is said to work: url = QtCore.QUrl.fromLocalFile('office theme.mp3') content =…
Eamonn
  • 658
  • 1
  • 7
  • 22
1
vote
1 answer

Open local HTML file from code in Qt on Mac OSx

Hello i am facing a small issue with Qt on the Mac OSX. So in my program i am trying to open a local .html file located in the same path as the application. Given that Qt is cross-platform , my attempt worked for both Windows and Ubuntu and i…
Noopty
  • 167
  • 2
  • 12