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. Problem with QMessageBox and Windows 7
Forum Updated to NodeBB v4.3 + New Features

Problem with QMessageBox and Windows 7

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 3 Posters 3.8k Views 2 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.
  • F Offline
    F Offline
    fermatqt
    wrote on last edited by
    #1

    hi!

    i have a problem with QMessageBox and Windows 7:

    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(onActionAbout()));
    
    void MainWindow::onActionAbout() {
        QMessageBox::about(this, "About", qApp->applicationName() +
                           ": Test.<br><br>"
                           "Autore: " + QString(qApp->organizationName()).replace("_"," ") +
                           "<br><br>"
                           "Web site: <a href='" + qApp->organizationDomain() +
                           "'>................it</a><br><br>"
                           "Licenza: <a href='................'>Creative Commons</a><br><br>"
                           "Linguaggio: C++/Qt<br><br>"
                           "Versione: " + qApp->applicationVersion() +
                           "<br><br>"
                           "Versione Qt: " + QT_VERSION_STR);
    }
    

    this code works on Linux and Windows 10, but not in Windows 7.
    when I run this code in Windows 7, the program crashes.
    do you know why?

    jsulmJ 1 Reply Last reply
    0
    • F fermatqt

      hi!

      i have a problem with QMessageBox and Windows 7:

      connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(onActionAbout()));
      
      void MainWindow::onActionAbout() {
          QMessageBox::about(this, "About", qApp->applicationName() +
                             ": Test.<br><br>"
                             "Autore: " + QString(qApp->organizationName()).replace("_"," ") +
                             "<br><br>"
                             "Web site: <a href='" + qApp->organizationDomain() +
                             "'>................it</a><br><br>"
                             "Licenza: <a href='................'>Creative Commons</a><br><br>"
                             "Linguaggio: C++/Qt<br><br>"
                             "Versione: " + qApp->applicationVersion() +
                             "<br><br>"
                             "Versione Qt: " + QT_VERSION_STR);
      }
      

      this code works on Linux and Windows 10, but not in Windows 7.
      when I run this code in Windows 7, the program crashes.
      do you know why?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @fermatqt Did you try to debug your app on Windows 7? To see where exactly it is crashing and to get stack trace.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      2
      • jsulmJ jsulm

        @fermatqt Did you try to debug your app on Windows 7? To see where exactly it is crashing and to get stack trace.

        F Offline
        F Offline
        fermatqt
        wrote on last edited by
        #3

        @jsulm said in Problem with QMessageBox and Windows 7:

        @fermatqt Did you try to debug your app on Windows 7? To see where exactly it is crashing and to get stack trace.

        unfortunately I do not have a car with which to install Windows 7 on QtCreator.
        is there a way to debug without installing QtCreator?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fermatqt
          wrote on last edited by
          #4

          however this works without problems:

          void MainWindow::onActionAboutQt() {
              QMessageBox::aboutQt(this, "About Qt");
          }
          
          1 Reply Last reply
          0
          • F Offline
            F Offline
            fermatqt
            wrote on last edited by
            #5

            210/5000
            ok, I installed QtCreator on a machine with Windows 7 64bit.
            I run the program from QtCreator, and everything worked.
            so the problem is that when I use a compiled binary for Windows 10?
            possible?

            jsulmJ 1 Reply Last reply
            0
            • F fermatqt

              210/5000
              ok, I installed QtCreator on a machine with Windows 7 64bit.
              I run the program from QtCreator, and everything worked.
              so the problem is that when I use a compiled binary for Windows 10?
              possible?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @fermatqt It should work fine on Windows 7.
              "when I run this code in Windows 7, the program crashes" - what exactly happens? Any error message?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              F 1 Reply Last reply
              0
              • jsulmJ jsulm

                @fermatqt It should work fine on Windows 7.
                "when I run this code in Windows 7, the program crashes" - what exactly happens? Any error message?

                F Offline
                F Offline
                fermatqt
                wrote on last edited by
                #7

                @jsulm said in Problem with QMessageBox and Windows 7:

                @fermatqt It should work fine on Windows 7.
                "when I run this code in Windows 7, the program crashes" - what exactly happens? Any error message?

                the program closes, and it appears the windows error "Programs Has Stopped Working".

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

                  Hi,

                  How did you deploy the application ?

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

                  F 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    How did you deploy the application ?

                    F Offline
                    F Offline
                    fermatqt
                    wrote on last edited by
                    #9

                    @SGaist said in Problem with QMessageBox and Windows 7:

                    Hi,

                    How did you deploy the application ?

                    i used windpeplyqt!!

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

                      Which version of Qt ?

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

                      F 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Which version of Qt ?

                        F Offline
                        F Offline
                        fermatqt
                        wrote on last edited by
                        #11

                        @SGaist

                        5.8 and QtCreator 4.2.2-2

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

                          What compiler are you using ?

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

                          F 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            What compiler are you using ?

                            F Offline
                            F Offline
                            fermatqt
                            wrote on last edited by
                            #13

                            @SGaist
                            i'm using msvc2015

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

                              Since the 5.9 betas are available, can you check them to see if you still encounter that problem ?

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

                              F 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                Since the 5.9 betas are available, can you check them to see if you still encounter that problem ?

                                F Offline
                                F Offline
                                fermatqt
                                wrote on last edited by fermatqt
                                #15

                                @SGaist said in Problem with QMessageBox and Windows 7:

                                Since the 5.9 betas are available, can you check them to see if you still encounter that problem ?

                                hi!
                                I also tried with Qt 5.9, but I have the same problem.
                                Even this code does not work:

                                #ifndef SAVEDIALOG_H
                                #define SAVEDIALOG_H
                                
                                #include <QObject>
                                #include <QStringList>
                                #include <QFileDialog>
                                
                                inline QString saveDialog() {
                                    QString fileName;
                                    QStringList filters;
                                    filters << "CSV(*.csv)" << "XLS(*.xls)" << "PDF(*.pdf)" << "All files(*.*)";
                                    QFileDialog fd(0, QObject::tr("Salva"), QDir::homePath());
                                    fd.setAcceptMode(QFileDialog::AcceptSave);
                                    fd.setNameFilters(filters);
                                    if (fd.exec() == QDialog::Accepted) {
                                        fileName = fd.selectedFiles()[0];
                                    }
                                    return fileName;
                                }
                                
                                1 Reply Last reply
                                0
                                • F Offline
                                  F Offline
                                  fermatqt
                                  wrote on last edited by
                                  #16

                                  instead, this line works:

                                  QMessageBox::aboutQt(this);
                                  
                                  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