[Qt-interest] KDE parts in QT project.
Prashanth Udupa
prashanthudupa at yahoo.com
Sun Aug 16 19:06:23 CEST 2009
Hi,
Have you tried linking to the libkparts?
There should be "LIBS += -L/usr/lib/kde4 -lkparts" line in your project's .pro file (assuming ofcourse that the libs are in /usr/lib/kde4 directory).
Thanks,
Prashanth
________________________________
From: Roman Averkin <romanaverkin at gmail.com>
To: qt-interest at trolltech.com
Sent: Sunday, August 16, 2009 9:13:52 PM
Subject: [Qt-interest] KDE parts in QT project.
Hello,
I need to add kate part to my project.
I tried to used next instruction : http://kate-editor.org/article/embedding_katepart_in_your_application
But when I write next code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <editor.h>
#include <kde4/kmainwindow.h> // KMainWindow
#include <kde4/kparts/factory.h> // KPart Factory
#include <kde4/klibloader.h> // LibLoader, contains factories
#include <kde4/ktexteditor/document.h> // Katepart document
#include <kde4/ktexteditor/view.h> // Katepart view
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow()throw(QString);
};
#endif
MainWindow::MainWindow()throw(QString)
{
KParts::Factory* factory = (KParts::Factory *) KLibLoader::self()->factory("libkatepart");
}
I get next errors:
mainwindow.o: In function `MainWindow':
/home/roman/Qt projects/SDCCGUILIN/mainwindow.cpp:67: undefined reference to `KLibLoader::self()'
/home/roman/Qt projects/SDCCGUILIN/mainwindow.cpp:67: undefined reference to `KLibLoader::factory(QString const&, QFlags<QLibrary::LoadHint>)'
/home/roman/Qt projects/SDCCGUILIN/mainwindow.cpp:67: undefined reference to `KLibLoader::self()'
/home/roman/Qt projects/SDCCGUILIN/mainwindow.cpp:67: undefined reference to `KLibLoader::factory(QString const&, QFlags<QLibrary::LoadHint>)'
collect2: ld returned 1 exit status
I understand that I need to add some command to compiler, but I don't know what exactly I should to do.
Can anybody help me?
Roman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090816/59feafc8/attachment.html
More information about the Qt-interest-old
mailing list