Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDesktopServices::open - kf.windowsystem: Could not find any platform plugin
Forum Updated to NodeBB v4.3 + New Features

QDesktopServices::open - kf.windowsystem: Could not find any platform plugin

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 2.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    r3d9u11
    wrote on last edited by r3d9u11
    #1

    Hello.
    I've faced the trouble, I can't run any local file within QDesktopServices::open or QProcess::startDetached.

    Text of the exception:

    kf.windowsystem: Could not find any platform plugin
    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    Available platform plugins are: xcb.
    
    Reinstalling the application may fix this problem.
    
    

    I've tried:

    #include <QApplication>
    #include <QUrl>
    #include <QDesktopServices>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv); // just this line
        QDesktopServices::openUrl(QUrl::fromLocalFile("/home/user/myfile.pdf"));
        return app.exec();
    }
    

    or

    QProcess::startDetached("xdg-open", QStringList() << "/home/user/myfile.pdf");
    

    in all cases I have the same exception.

    I have already installed all needed packages:

    sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
    

    Tested on Ubuntu (KDE) 20.04, Qt 5.15.2

    What is wrong?
    Thanks!

    1 Reply Last reply
    0
    • R Offline
      R Offline
      r3d9u11
      wrote on last edited by r3d9u11
      #3

      the touble is in option

      Project -> Run -> [x] Add build library search path to LD_LIBRARY_PATH
      

      if uncheck it, all works fine under QtCreator,
      and problem is gone

      1 Reply Last reply
      0
      • R Offline
        R Offline
        r3d9u11
        wrote on last edited by
        #2

        The problem rises only when try to launch application from QtCreator (Run/Debug). If try to launch compiled binary file, so it works fine.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          r3d9u11
          wrote on last edited by r3d9u11
          #3

          the touble is in option

          Project -> Run -> [x] Add build library search path to LD_LIBRARY_PATH
          

          if uncheck it, all works fine under QtCreator,
          and problem is gone

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved