GithubHelp home page GithubHelp logo

getting-started-with-qt-5's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

getting-started-with-qt-5's Issues

Not required includes in files of folder chapter 5 Drag and drop

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter05/dragAndDrop/dragTextEdit.h

#include <QDateTime>
#include <QMimeDatabase>
#include <QMimeType>

are not required, please remove them , it is not good to clutter the file with not needed includes.

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter05/dragAndDrop/mainwindow.h
#include <QMainWindow> is repeated 2 times in the #include
and the next

#include <QLabel>
#include <QDateTime>
#include <QStatusBar>

are not used and not required. Please do not confuse the reader/learner of the book, and remove them.

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter05/dragAndDrop/main.cpp
#include <Qt>
not used, not required, and you have typed the same include many times in chapter 5 and chapter 4, without explaining what it is and why it is needed (because it is NOT needed until now!). So better remove this include.
NOTE: I use Qt 5.13

Wrong text in openAction

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter04/centralWidget/mainwindow.cpp
The line 118 now is :
openAction = new QAction(openIcon, "&New", this);
but it should be
openAction = new QAction(openIcon, "&Open", this);

The same error appears in the code of the book text, but I know you cannot correct it in the book, so at least fix it here in github.
Also the same error is on line 99 of file
https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter04/dialogs/mainwindow.cpp

Unnecessary includes in chapter 4 files

In the .h files I notice the

#include <QtGui>
#include <Qt>

but I can build the project without them. Why are they typed? It is not good to have things that are not required.
Also many times the
#include <QAction>
is typed 2 times. This looks so unprofessional, it makes the book suspicious. It appears in the text of the book, but at least eliminate those redundant lines from the code here in github!
NOTE: I use Qt 5.13

not required includes in files of chapter 5 , custom signals and slots

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter05/customSignalsAndSlots/mainwindow.h

#include <QMoveEvent>
#include <QMouseEvent>

but only one of them is required, I suggest to leave only the QMouseEvent

#include <QDebug>
#include <QDateTime>

not required, not used anywhere, please remove both of them.

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter05/customSignalsAndSlots/main.cpp
#include <Qt>
not required, not used.

And as usual , may empty lines, that is annoying to read.
NOTE: I use Qt 5.13

Redundant-unused QAction members in class

https://github.com/PacktPublishing/Getting-Started-with-Qt-5/blob/master/Chapter04/menuBars/mainwindow.h
There are the following private members (lines 33,34):
QAction *saveAction;
QAction *cancelAction;
but they are never used in the .cpp file. Either eliminate them from the .h file, or implement them in the .cpp file to produce a richer result in the GUI. I suggest to remove them from the menuBars project, because it is the first to appear in the book, but keep them (and implement them in the .cpp ) for the toolBars project which appears 2nd in the book, so it is logical to make the 2nd project a little longer/harder.
NOTE: I use Qt 5.13

Too many empty lines

Almost all of the .cpp files have many empty lines at the end of the functions, just before the closing brace }
This is annoying, a waste of space, and requires more scrolling.
And inside the functions body, oftentimes there are 2 empty lines to separate different logical chunks of code, but it is better to have only 1 empty line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.