Important: Please read the Qt Code of Conduct -

Windows: C++ does not support default-int

  • void MainWindow::keyPressEvent(QKeyEvent *event)
        qDebug() << event;
        if (event->key() == Qt::Key_Escape) {

    Linux has no error.

    Windows error:

    QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = {
    { &QMainWindow::staticMetaObject,,
          qt_meta_data_MainWindow,  qt_static_metacall, nullptr, nullptr}

    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

  • @sonichy
    In which line is the error raised?
    Typically, some symbol has only been forward-declared, but the corresponding header file has not been included.

  • @sonichy

    You should indicate for which line the error is output.

    I would assume that it is

        qDebug() << event;

    You are simply trying to output an address there. That is probably open to debate if you want to treat as error or not.
    If you are really interested in the address only, than cast it as an integer.

Log in to reply