QT or KDE ?What's my problem?I'm newbie

Luis Cano shreig at gmail.com
Fri Jan 21 07:22:46 GMT 2005


On Thursday 20 January 2005 16:48, Mohsen Pahlevanzadeh wrote:
> It mean that i must derive a class from KTMainwindow?

Yes, if you want to add functionality, but you can still create the window 
with this:
/**************** CUT HERE *******************/
#include <kmainwindow.h>
#include <qstring.h>
#include <kapp.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>

static const char description[] =
    I18N_NOOP("A KDE Application");

static const char version[] = "0.1";

int main(int argc,char **argv)
{
        KAboutData about("prueba", I18N_NOOP("prueba"), version, description,
        KAboutData::License_GPL, "(C) %{YEAR} Luis Cano", 0, 0, 
"shreig at gmail.co
m");
    about.addAuthor( "Luis Cano", 0, "shreig at gmail.com" );
        KCmdLineArgs::init(argc, argv, &about);
        KApplication myapp(argc,argv);
        KMainWindow *x= new KMainWindow();
        x->setGeometry(100,100,200,100);
        x->show();
	myapp.exec();
}
/******************** CUT HERE **********************/
part of this example is taken from kdevelop's KDE Application Framework 
Template, you can derive KMainWindow, and add Functionality, then create like 
above, I in particular recommend using KDevelop for KDE applications coding, 
check for version 3.1+.

You can compile the previous example with:
g++ -L/usr/lib/qt3/lib -L/opt/kde3/lib -I/opt/kde3/include 
-I/usr/lib/qt3/include -lqt-mt -lkbase_common -lkbase_app main.cpp

with: 
KDE at /opt/kde3
and
QT at /usr/lib/qt3

BTW, i dont know if -lkbase_common and -lkbase_app are both needed. :P, too 
lazy to check right now.
>
> > On Thursday 20 January 2005 21:58, Mohsen Pahlevanzadeh wrote:
> >> Dears,following is my program:
> >> #include <ktmainwindow.h>
> >> #include <qstring.h>
> >> #include <kapp.h>
> >> int main(int argc,char **argv)
> >> {
> >>  KApplication myapp(argc,argv);
> >>   KTMainWindow x= KTMainWindow();
> >
> > You can't copy KTMainWindow (or any QWidget, for that matter).
> >
> >
> > --
> > regards. Esben
> > ___________________________________________________
> > This message is from the kde mailing list.
> > Account management:  https://mail.kde.org/mailman/listinfo/kde.
> > Archives: http://lists.kde.org/.
> > More info: http://www.kde.org/faq.html.
>
> ___________________________________________________
> This message is from the kde mailing list.
> Account management:  https://mail.kde.org/mailman/listinfo/kde.
> Archives: http://lists.kde.org/.
> More info: http://www.kde.org/faq.html.
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list