Coder Social home page Coder Social logo

packtpublishing / qt5-cpp-gui-programming-cookbook-second-edition Goto Github PK

View Code? Open in Web Editor NEW
118.0 13.0 60.0 1.98 MB

Qt5-C++-GUI-Programming-Cookbook-Second-Edition, published by Packt

License: MIT License

QMake 2.95% C++ 10.66% QML 2.36% CSS 0.50% JavaScript 82.97% HTML 0.57%

qt5-cpp-gui-programming-cookbook-second-edition's Issues

Coordinate_Transformation: connect timer with MainWindow fails

The connect call in the MainWindow constructor:
connect(timer, QTimer::timeout, this, MainWindow::update);
fails to compile with:
call to non-static member function without an object argument

I can only make it work using the old syntax:
connect(timer, SIGNAL(timeout()), this, SLOT(update()));

issue over windows

on trying the example over windows, mainWindow.cpp throws this issue

// Update buttons style
ui->button1->style()->polish(ui->button1);

error: invalid use of incomplete type 'class QStyle'

PD: using Qt Creator 5.0.2 Based on Qt 5.15.2 (MSVC 2019, 64 bit)

Setup OpenGL: triangle not shown on middle of screen

When running the "Setup OpenGL" project, the triangle doesn't appear on the centre of the window as shown in the book. I'm using MacOS with the latest version of Qt installed. Any help would be appreciated!
Screenshot 2019-11-04 at 16 31 47

Signals_Slots: no matching function for call to information

Chapter02/Signals_Slots fails to compile with the error:
no matching function for call to 'information'
QMessageBox::information(this, "Hello", "Button has been clicked!");
^~~~~~~~~~~~~~~~~~~~~~~~

I believe the reason for this is the fact that MyClass (the this pointer in the above error) inherits from QObject but the information method expects a QWidget, hence the error.

variable has incomplete type when using qt6.5

I got this error when i tried the sample code in QT6.5

image

After some time I found that some libraries needed to be added in the 'mainWindow.h' file

The completed list was this
image

Just thought others may need to know if they got the same error

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.