JPNaude / Qtilities

Building blocks for Qt applications
http://jpnaude.github.io/Qtilities/
Other
137 stars 39 forks source link

QPrinter: No such file or directory #95

Closed mbnoimi closed 11 years ago

mbnoimi commented 11 years ago

When I tried to use Qtilities with Qt application I got this error message:

QPrinter: No such file or directory

This my .pro file

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = GUI
TEMPLATE = app

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

QTILITIES += coregui
QTILITIES += extension_system
QTILITIES_BASE = ../../Qtilities
include($$QTILITIES_BASE/src/Qtilities.pri)

My main.cpp file

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

#include <QtilitiesExtensionSystem>
using namespace QtilitiesCore;
using namespace QtilitiesCoreGui;
using namespace QtilitiesExtensionSystem;

int main(int argc, char *argv[])
{
    //    QApplication a(argc, argv);

    QtilitiesApplication a(argc, argv);
    // We must specify the following if we want the logger to remember its settings:
    QtilitiesApplication::setOrganizationName("Jaco Naudé");
    QtilitiesApplication::setOrganizationDomain("Qtilities");
    QtilitiesApplication::setApplicationName("Extension System Example");
    QtilitiesApplication::setApplicationVersion("0.1");
    // Initialize the logger:
    QtilitiesApplication::applicationSessionPath();
    LOG_INITIALIZE();
    // Set the Qt message engine active, this will log messages to the Qt debugging system during the plugin loading process:
    Log->toggleQtMsgEngine(true);
    // Load plugins using the extension system:
    EXTENSION_SYSTEM->initialize();
    // Set the Qt message engine inactive once the process loading process is completed:
    Log->toggleQtMsgEngine(false);
    // Register extension system config page:
    OBJECT_MANAGER->registerObject(EXTENSION_SYSTEM->configWidget());
    // Report on the number of config pages found:
    QList<QObject*> registered_config_pages = OBJECT_MANAGER->registeredInterfaces("com.Qtilities.CoreGui.IConfigPage/1.0");
    LOG_INFO(QString("%1 configuration page(s) found in set of loaded plugins.").arg(registered_config_pages.count()));
    // Create a config widget for this example:
    ConfigurationWidget config_widget;
    config_widget.initialize(registered_config_pages);

    MainWindow w;
    w.show();
    //    exampleMainWindow->show();
    int result = a.exec();
    // Finalize all plugins:
    EXTENSION_SYSTEM->finalize();
    // Finalize the logger:
    LOG_FINALIZE();

    return result;
}
JPNaude commented 11 years ago

Response to reported on the Qtilities mailing list on 12 June 2013:

Hi Muhammad

I'm still without a new laptop after we've relocated, so thought that I will quickly respond from my phone.

I think the issue you reported is not related to Qtilities. It looks like you are building against Qt5 (you did not mention) and in that case you probably need to add CONFIG += printsupport to your .pro file.

Can you check if this works please? Also would you mind to log my response to the bug tracker.

Cheers, Jaco