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. QWidget crash on Qt5-alpha
Forum Updated to NodeBB v4.3 + New Features

QWidget crash on Qt5-alpha

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.6k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sudanix
    wrote on last edited by
    #1

    Hi,

    I've successfully build Qt5 on my ubuntu 11.10 machine by clone Qt5 from the repos and follow the build instruction on the wiki.
    But when I tried to run my hello world widget application it crashed with this message:

    No platform plugin argument was specified, defaulting to "xcb".
    QWidget: Cannot create a QWidget when no GUI is being used

    any suggestion to solve this?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      d2uriel
      wrote on last edited by
      #2

      Can you post the code (should be short if it's a "hello world" app)?

      "Do not judge, and you will never be mistaken." - Jean-Jacques Rousseau

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sudanix
        wrote on last edited by
        #3

        Ok, I found the problem. its from my code.
        I thought that I should use QGuiApplication instead of QApplication for gui app, and after debugging it appears that the crash happened when QWidget try to get QApplication instance to know the type of the application.

        Here is my first Qt5 app :)

        @#include <QtWidgets/QApplication>
        #include <QtWidgets/QWidget>

        int main(int argc, char *argv[])
        {
        QApplication a(argc, argv);
        QWidget w;
        w.show();
        return a.exec();
        }@

        Thanks.

        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