Ask Your Question
1

Qt 5.6 qDebug and qLog no longer work

asked 2016-05-09 10:15:06 -0500

atemple03 gravatar image

updated 2016-06-14 09:58:15 -0500

I posted it as a Qt bug report at https://bugreports.qt.io/browse/QTBUG... , and another user reported the issue at http://stackoverflow.com/questions/36... . I do believe this is not a Qt issue, but how the RPM got built and packaged for the latest Qt, since this USED to work in Qt 5.5 (and 5.4), and no longer works for the Qt 5.6 package.

Both Fedora and CentOS 7 pull the same RPM.

Here's a copy/paste of my bug report (including the exact RPM package name).

import QtQuick 2.6
import QtQuick.Window 2.2
Window {
    visible: true

    Text {
        text: qsTr("Hello World")
        anchors.centerIn: parent
        Component.onCompleted: {
            console.warn("warn completed")
            console.log("log completed")
            console.error("error completed")
            console.debug("debug completed")
            console.exception("exception completed")
            console.info("info completed")
        }
    }
}

main.cpp

#include <QGuiApplication>
#include <QQmlApplicationEngine>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}

This used to work in Qt 5.5 (I'm currently on 5.4 due to dbus being broken in 5.5). As reported originally from the user in stackoverflow, debug and log are broken, but the other outputs still work. Same affect with qDebug() in C++ being broken. It simply outputs nothing. I've also noticed if I put a qDebug() before the initialization of QGuiApplication (or QCoreApplication), it will work. It will NOT work if I attempt to qDebug() immediately after it. note I just noticed one other thing. So if I use the prebuilt Qt from the Qt maintenancetool installer, logging DOES work. Therefore this may be less an issue with Qt specifically, and more an issue with how EPEL Release repository packages and compiles Qt?

qt5-qtbase.x86_64 5.6.0-7.el7 @epel

edit I did an rpm -qi on the qt5 package, and Fedora Project are the ones responsible for the packaging of these binaries (build date says April, which indicates broken for over a month and a half). It's been a while, and can really use an answer from Fedora Project at this point.

Name        : qt5-qtbase
Version     : 5.6.0
Release     : 13.el7
Architecture: x86_64
Install Date: Mon 13 Jun 2016 03:48:09 PM MDT
Group       : Unspecified
Size        : 8851726
License     : LGPLv2 with exceptions or GPLv3 with exceptions
Signature   : RSA/SHA256, Sun 01 May 2016 01:19:03 PM MDT, Key ID 6a2faea2352c64e5
Source RPM  : qt5-qtbase-5.6.0-13.el7.src.rpm
Build Date  : Sat 30 Apr 2016 12:50:35 PM MDT
Build Host  : buildvm-22.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://qt-project.org/
Summary     : Qt5 - QtBase components
Description :
Qt is a software toolkit for developing applications.

This package contains base tools, like string, xml, and network
handling.
edit retag flag offensive close merge delete

Comments

If you believe it's a packaging problem, I would encourage you to file a bug against qt5-qtbase.x86_64 5.6.0-7.el7 here

florian gravatar imageflorian ( 2016-06-14 10:40:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-10-13 10:40:49 -0500

fredyn gravatar image

updated 2016-10-17 05:20:20 -0500

Have a look at Comment 32 in

https://bugzilla.redhat.com/show_bug.... "no qDebug output"

Correctly configuring ~/.config/QtProject/qtlogging.ini can be tricky if you have both general (wildcarded) rules and module-specific rules for the same module/severity, because rules loaded later (typically the more specific ones) will replace rules loaded earlier.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-05-09 10:15:06 -0500

Seen: 2,331 times

Last updated: Oct 17 '16