[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Qt-only KDE applications
From: Falk Brettschneider <gigafalk () yahoo ! com>
Date: 2002-01-22 13:25:51
[Download RAW message or body]
Matthias Ettrich wrote:
>
> Opinions? Do you think that would be useful at all?
I solved that issue in my own way. Take a look at
QextMDI/KDockWidget which can be configured as Qt-only
respectively as KDE-based using or not using the
-DNO_KDE flag for compiling.
It works very well for our company's commercial
application that we provide as KDE and Qt-only binary
depending on what the customer wants with that minimal
implementation effort (see below). :-)
This code-snippy shows is the principle (see
attachment):
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
["qtorkde.cpp" (text/plain)]
---------------dummykmainwindow.h (in Qt-only version only)-----------------
class DLL_IMP_EXP_QEXTMDICLASS KMainWindow : public QMainWindow
{
Q_OBJECT
public:
KMainWindow( QWidget* parentWidget = 0L, const char* name = "", WFlags flags = \
WType_TopLevel) : QMainWindow( parentWidget, name, flags) {}; ~KMainWindow() {};
};
-----------------kdockwidget.h----------------------------------------------
#ifndef NO_KDE2
# include <kmainwindow.h>
# undef EXPORT_DOCKCLASS
# define EXPORT_DOCKCLASS
#else
# include <qmainwindow.h>
# include "dummykmainwindow.h"
# include "exportdockclass.h"
#endif
class EXPORT_DOCKCLASS KDockMainWindow : public KMainWindow
{
...
#ifdef NO_KDE2
QMenuBar *m_pMainMenuBar;
#else
KMenuBar *m_pMainMenuBar;
#endif
...
};
----------------main.cpp------------------------------------------------
#ifndef NO_KDE2
#include <kapp.h>
KApplication* theApp;
#else
#include <qapplication.h>
QApplication* theApp;
#endif
int main( int argc, char **argv )
{
#ifndef NO_KDE2
KApplication a(argc,argv,"KFourChildren");
#else
QApplication a(argc,argv);
#endif
theApp = &a;
KDockMainWindow* mainWdg = new.....
a.setMainWidget( mainWdg );
mainWdg->show();
return a.exec();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic