[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#963544: qtcreator: testing: The wizard for a Qt Widgets Application project make errors.



Package: qtcreator
Version: 4.11.0-2
Severity: normal

Dear Maintainer,

I have installed with apt-get install build-essential qtcreator qt5-default
qt5-doc qtbase5-examples qtbase5-doc-html

Then I try to build a first application.

* What exactly did you do (or not do) that was effective (or ineffective)?
I started Qt Creator. Select File > New File or Project > Application > QT
Widgets Application > Choose and
followed the instruction of the wizard. I entered in the Class Information
dialog, type Notepad as the class name and
select QMainWindow as the base class.

The Qt Widgets Application wizard creates a project that contains a main source
file and a set of files that specify
a user interface (Notepad widget).

My main.cpp looks like this:

#include "notepad.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv); //line 6
    Notepad w;                  //line7
    w.show();
    return a.exec();
}

I have nothing programmed, all you can see is from the wizard. And I have
errors!
In line 6: variable has incomplete type 'QApplication'
In line 7: unknown type name 'Notepad'
-------------------------------------------------------------------------------
My notepad.h looks like this:

#ifndef NOTEPAD_H
#define NOTEPAD_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class Notepad; }
QT_END_NAMESPACE

class Notepad : public QMainWindow      //line 10
{
    Q_OBJECT    //line 12

public:
    Notepad(QWidget *parent = nullptr);
    ~Notepad();

private:
    Ui::Notepad *ui;
};
#endif // NOTEPAD_H

Error, line 10: expected class name
Error, line 12: incomplete result type 'QString' in function definition
----------------------------------------------------------------------------
My notepad.cpp looks like this:
#include "notepad.h"
#include "ui_notepad.h"

Notepad::Notepad(QWidget *parent) //line 4
    : QMainWindow(parent)
    , ui(new Ui::Notepad)
{
    ui->setupUi(this);
}

Notepad::~Notepad()     //line 11
{
    delete ui;
}

Error, line 4: use of undeclared identifier 'Notepad'
Error, line 11: use of undeclared identifier 'Notepad'
----------------------------------------------------------------------------
My Datei.pro look like this:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version
of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs
deprecated before Qt 6.0.0

SOURCES += \
    main.cpp \
    notepad.cpp

HEADERS += \
    notepad.h

FORMS += \
    notepad.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

-----------------------------------------------------------------------------------------------
I compile the project and get two Problems.
If I push the run button, the window appears!

* What outcome did you expect instead?
This files are generated from the wizard and there should not be any mistakes
or error messages there.
I don't know what to do, that this errors go away.

Yours sincerely
paul345




-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.6.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages qtcreator depends on:
ii  libc6                                  2.30-8
ii  libclang1-8                            1:8.0.1-9
ii  libgcc-s1 [libgcc1]                    10.1.0-3
ii  libkf5syntaxhighlighting5              5.70.0-1
ii  libllvm8                               1:8.0.1-9
ii  libqbscore1.13                         1.13.1-2
ii  libqt5concurrent5                      5.12.5+dfsg-10+b1
ii  libqt5core5a [qtbase-abi-5-12-5]       5.12.5+dfsg-10+b1
ii  libqt5designer5                        5.12.5-2+b2
ii  libqt5designercomponents5              5.12.5-2+b2
ii  libqt5gui5                             5.12.5+dfsg-10+b1
ii  libqt5help5                            5.12.5-2+b2
ii  libqt5network5                         5.12.5+dfsg-10+b1
ii  libqt5printsupport5                    5.12.5+dfsg-10+b1
ii  libqt5qml5 [qtdeclarative-abi-5-12-5]  5.12.5-5
ii  libqt5quick5                           5.12.5-5
ii  libqt5quickwidgets5                    5.12.5-5
ii  libqt5script5                          5.12.5+dfsg-2
ii  libqt5serialport5                      5.12.5-1
ii  libqt5sql5                             5.12.5+dfsg-10+b1
ii  libqt5sql5-sqlite                      5.12.5+dfsg-10+b1
ii  libqt5widgets5                         5.12.5+dfsg-10+b1
ii  libqt5xml5                             5.12.5+dfsg-10+b1
ii  libstdc++6                             10.1.0-3
ii  qml-module-qtqml-models2               5.12.5-5
ii  qml-module-qtquick-controls            5.12.5-1+b1
ii  qml-module-qtquick2                    5.12.5-5
ii  qtchooser                              66-2
ii  qtcreator-data                         4.11.0-2

Versions of packages qtcreator recommends:
ii  clang                            1:9.0-49.1
ii  clang-tidy                       1:9.0-49.1
ii  gdb                              9.2-1
ii  konsole [x-terminal-emulator]    4:20.04.2-1
ii  make                             4.2.1-2+b1
ii  qmlscene                         5.12.5-5
ii  qt5-doc                          5.12.5-1
ii  qt5-qmltooling-plugins           5.12.5-5
ii  qtbase5-dev-tools                5.12.5+dfsg-10+b1
ii  qtcreator-doc                    4.11.0-2
ii  qtdeclarative5-dev-tools         5.12.5-5
ii  qterminal [x-terminal-emulator]  0.14.1-1+b1
ii  qttools5-dev-tools               5.12.5-2+b2
ii  qttranslations5-l10n             5.12.5-1
ii  qtxmlpatterns5-dev-tools         5.12.5-1
ii  xterm [x-terminal-emulator]      356-1

Versions of packages qtcreator suggests:
pn  clazy       <none>
ii  cmake       3.16.3-3
ii  g++         4:9.2.1-3.1
ii  git         1:2.27.0-1
pn  kate-data   <none>
pn  subversion  <none>
pn  valgrind    <none>

-- no debconf information


Reply to: