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. Qt Project freezes at start and does not show window

Qt Project freezes at start and does not show window

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 449 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.
  • J Offline
    J Offline
    jlo_
    wrote on last edited by
    #1

    I created a Qt project for a university class 3 years ago and recently wanted to check it out again. Trying this I noticed, that the project does not work anymore. When trying to build and run the project in Qt Creator, the application freezes and needs to be force quitted. The debug mode tells me, that the program freezes in the main.ccp file at "return a.exec();". The "StartMenue" is a class inheriting from QMessageBox and should be displayed (which it is not).

    I have not touched the project in the past 3 years and am also still using the same Qt version: Qt Creator 4.12.0
    Based on Qt 5.14.2 (Clang 10.0 (Apple), 64 bit)
    Built on Apr 22 2020 01:15:50
    I also have not worked with Qt in that time either and am really rusty about pretty much everything.
    I also do not get any error messages.
    I would really love to get this working again, so any ideas and help would be greatly appreciated. If any additional information is necessary, I am also happy to show the actual code, I just did not want this post to get too long.

    I tried rebuilding the project multiple times.

    But as I said, I am really lost here, as it worked 3 years ago and I did not change anything.

    Shown here is a more minimal implementation where I get the same problem.

    #include <QApplication>
    #include <QtWidgets>
    
    class StartMenue: public QMessageBox
    {
    
    public:
        QGraphicsView * view;
        QGraphicsScene * scene;
        StartMenue()
        {
            scene = new QGraphicsScene();
            scene->setBackgroundBrush(Qt::lightGray);
            scene->setSceneRect(1200, 1200, 0, 0);
            QGraphicsProxyWidget *proxy = scene->addWidget(this);
            view = new QGraphicsView(scene);
            view->show();
        }
    };
    
    int main(int argc, char* argv[])
    {
        QApplication a(argc, argv);
    
        StartMenue * sm = new StartMenue();
    
        return a.exec();
    }
    

    I also tried using newer OpenSource Versions of Qt like 7.0.2 and 5.0.3 but there it says that I do not have any suitable Kits, and I also have no clue how to solve that. I think that was provided back then by the University or something. I want to create a .app file that I can run on both Intel and Silicon Macs. I also do not necessarily need the project to work and build in Qt, if there is any other way to create the .app file. If anybody has any idea on how to solve that, that would be amazing, as I would really love to be able to open my project again. Thanks in advance!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I don't want to sound blunt but that code has so many issues that it screams for a proper refactoring.

      That said, I can start it on macOS with Qt 6.5 but it will crash at the end.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      JoeCFDJ J 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        I don't want to sound blunt but that code has so many issues that it screams for a proper refactoring.

        That said, I can start it on macOS with Qt 6.5 but it will crash at the end.

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        @SGaist It starts and ends well with 5.15.3 on Ubuntu 22.04.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          I don't want to sound blunt but that code has so many issues that it screams for a proper refactoring.

          That said, I can start it on macOS with Qt 6.5 but it will crash at the end.

          J Offline
          J Offline
          jlo_
          wrote on last edited by
          #4

          @SGaist I wrote that code during my first college year and learned qt on the go, so I can understand if it's not up to your standards. You do not want to see the rest of it...
          However, do you know a possible cause of the issue? I tried downloading the mentioned Qt versions, but the problem persists. Still no errors, it just does not work. Any help would be welcome.

          SGaistS 1 Reply Last reply
          0
          • J jlo_

            @SGaist I wrote that code during my first college year and learned qt on the go, so I can understand if it's not up to your standards. You do not want to see the rest of it...
            However, do you know a possible cause of the issue? I tried downloading the mentioned Qt versions, but the problem persists. Still no errors, it just does not work. Any help would be welcome.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Did you already start your application with the QT_DEBUG_PLUGINS environment set to one ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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