Questions tagged [qdesktopservices]

QDesktopServices is a class from the Qt Toolkit which provides methods for accessing common desktop services.

Documentation can be found here (Qt4) and here (Qt5).

14 questions
4
votes
1 answer

Whitelist my desktop application in user's machine

I have a desktop application built by InstallJammer. The application is not a problem but when it is installed on user's machine, the anti-virus on user's machine stops the services created by my application and so it stops communicating with my…
Parth
  • 568
  • 2
  • 6
  • 23
4
votes
3 answers

Qt QDesktopServices::openUrl - launch browser with post values

I'm trying to write a simple application that will launch a browser and send it to a URL based on a user's input. QDesktopServices::openUrl(QUrl(url)); However, I'd like to pass variables along with whatever URL they submit using POST. For GET, all…
William Northern
  • 403
  • 2
  • 5
  • 12
3
votes
1 answer

How to get a system's default browser?

Is there a Qt interface to get the system's default browser? I want to open a file:// url explicitly in a browser instead of the system's default application, so QDesktopServices::openUrl is not the way because of If the URL is a reference to a…
Simon Warta
  • 10,850
  • 5
  • 40
  • 78
3
votes
2 answers

How do I use QDesktopServices::openUrl with 'file:' URL containing '#'?

In my application, I generate a HTML file that I want to open by clicking on a button. So my file is named, for example: QString file = "F:/the_path/to_the_/generated_html_file.html"; On Windows I change it to: file =…
SteveTJS
  • 635
  • 17
  • 32
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
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
1
vote
0 answers

Is there a way to open local files on Android with Qt 5.12.x?

I try top open a pdf on Android, which I have downloaded to: QStandardPaths::writableLocation(QStandardPaths::TempLocation) Code to open the PDF: QUrl url; if (filePath.startsWith("\\\\") || filePath.startsWith("//")) { …
BKnows
  • 117
  • 1
  • 9
1
vote
1 answer

Show a local html file using QDesktopService

I would like to show a local html file when a user clicks on a help icon. The method shown below is connected to the triggered signal from the icon. In my method shown below, the html file is not being opened in my default browser and the except…
Philip Whitten
  • 293
  • 2
  • 16
1
vote
1 answer

QDesktopServices::openUrl() not working Qt

This is my code: QPixmap map(":/Medal.jpg"); QIcon ico(map); ico.addPixmap(map); QPushButton *p = new QPushButton; p->setIcon(ico); QString link = "http://www.google.com"; QObject::connect(p,…
user8753545
1
vote
1 answer

How can I write unit tests against code that uses QDesktopServices openUrl?

I'm working on a python (3.5) program that use a PyQt5 GUI. In the GUI, I need to add some help links to the documentation on a website. I manage to make it work with: QDesktopServices.openUrl(QUrl("my_url")) It works fine but I want to be sure…
pierre bonneel
  • 665
  • 1
  • 5
  • 8
1
vote
1 answer

PyQt5 | How to open a folder with a file preselected?

Currently I can open a folder by using dirPath = os.path.dirname(os.path.abspath(self.oVidPath)) QDesktopServices.openUrl(QUrl.fromLocalFile(dirPath)) I want to know if there is anyway I can open folder with a file preselected? I am okay if it only…
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
1
vote
1 answer

How do I open a file on server using the default program in Qt?

Everything I read indicates that QDesktopServices::openUrl is the platform-agnostic way to open a document using the default program, and it works great, almost all of the time. I say almost, because it always seems to fail if I pass it a network…
Phlucious
  • 3,704
  • 28
  • 61
1
vote
0 answers

QT QDesktopServices: how to view in childwindow?

I have QT Creator 5.2.1 . I am using QDesktopServices to open a PDF file through Ubuntu's PDF viewer using the following line: QDesktopServices::openUrl(QUrl("File Path", QUrl::TolerantMode)); The above line is written in my .cpp file. The PDF is…
0
votes
1 answer

How can i open HTML file on a specific header in QT?

I use help button (from QDialog) to open an HTML file, but i want it to open on specific header (

,

, etc.), depending on from which window i use help button. This is how i open…

a1rltt
  • 3
  • 3