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. The .exe file has stopped working error

The .exe file has stopped working error

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k 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.
  • tomyT Offline
    tomyT Offline
    tomy
    wrote on last edited by tomy
    #1

    Hi all,

    As the book would say, I designed a form like this: alt text

    A .h file like this:

    #ifndef SORTDIALOG_H
    #define SORTDIALOG_H
    
    #include <QDialog>
    #include "ui_sortdialog.h"
    
    class SortDialog : public QDialog, public Ui::SortDialog
    {
        Q_OBJECT
    public:
        SortDialog(QWidget* parent = 0);
        void setColumnRange(QChar first, QChar last);
    };
    
    #endif // SORTDIALOG_H
    

    a .cpp file like this:

    #include <QtWidgets>
    #include "sortdialog.h"
    
    SortDialog::SortDialog(QWidget *parent)
        :QDialog(parent)
    {
        setupUi(this);
    
        secondaryGroupBox -> hide();
        tertiaryGroupBox -> hide();
        layout() -> setSizeConstraint(QLayout::SetFixedSize);
    
        setColumnRange('A', 'Z');
    }
    
    void SortDialog::setColumnRange(QChar first, QChar last)
    {
        primaryColumnCombo -> clear();
        secondaryColumnCombo -> clear();
        tertiaryColumnCombo -> clear();
    
        secondaryColumnCombo -> addItem(tr("None"));
        tertiaryColumnCombo -> addItem(tr("None"));
        primaryColumnCombo -> setMinimumSize(
                    secondaryColumnCombo -> sizeHint());
    
        QChar ch = first;
        while(ch <= last) {
            primaryColumnCombo -> addItem(QString(ch));
            secondaryColumnCombo -> addItem(QString(ch));
            tertiaryColumnCombo -> addItem(QString(ch));
            ch = ch.unicode() + 1;
        }
    }
    

    and the main.cpp this way:

    #include <QApplication>
    #include "sortdialog.h"
    
    int main(int argc, char* argv[])
    {
        QApplication app(argc, argv);
        SortDialog* dialog = new SortDialog;
        dialog -> setColumnRange('C', 'F');
        dialog -> show();
        return app.exec();
    }
    

    After running qmake and adding QT += widgets to the .pro file, I ran the program, but, I got this error! :( alt text

    What is the problem please?
    I did these steps: From Build:
    Clean all
    Run qmake
    Build all

    But no success!

    1 Reply Last reply
    0
    • O Offline
      O Offline
      onek24
      wrote on last edited by
      #2

      Hello,

      have you tried debugging the Application to see where it crashes?

      tomyT 1 Reply Last reply
      1
      • O onek24

        Hello,

        have you tried debugging the Application to see where it crashes?

        tomyT Offline
        tomyT Offline
        tomy
        wrote on last edited by
        #3

        @onek24
        Thanks for the reply.
        I debugged the program by F5 and got this: alt text

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Add a spacer under the more button then right click on the background and select layout->lay out horizontaly

          The sign that shows the problem is the red sign on the sortdialog windows in the top right of your first screenshot. that means that layout() is null

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          2

          • Login

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