C++ and Qt problems!

J

Jenny

Hi,

I'm developing a C++ plugin for an existing app that requires a prompt
to pop up. I have to use Qt and I've only just started to learn it so
sorry if this is a dumb question. I'm trying to create a QApplication
within the plugin, but as I have no command line args (argc and argv),
I can't initialise the QApplication. How would one normally integrate
Qt with existing C++ code without a main()? All examples I've seen so
far of Qt have used a main().

Thanks for any help you can give!

Cheers,
Jennifer
 
T

Thomas Matthews

Jenny said:
Hi,

I'm developing a C++ plugin for an existing app that requires a prompt
to pop up. I have to use Qt and I've only just started to learn it so
sorry if this is a dumb question. I'm trying to create a QApplication
within the plugin, but as I have no command line args (argc and argv),
I can't initialise the QApplication. How would one normally integrate
Qt with existing C++ code without a main()? All examples I've seen so
far of Qt have used a main().

Thanks for any help you can give!

Cheers,
Jennifer

Your best source of information would be a Qt newsgroup.
Search their site or the web for "QT Plugin".

This newsgroup deals with _standard_ C++, which has no
facilities for pop-ups or windows. Read the FAQ and
welcome.txt below.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
D

Duane Hebert

Jenny said:
Hi,

I'm developing a C++ plugin for an existing app that requires a prompt
to pop up. I have to use Qt and I've only just started to learn it so
sorry if this is a dumb question. I'm trying to create a QApplication
within the plugin, but as I have no command line args (argc and argv),
I can't initialise the QApplication. How would one normally integrate
Qt with existing C++ code without a main()? All examples I've seen so
far of Qt have used a main().

nntp.trolltech.com
 
M

msalters

Jenny said:
Hi,

I'm developing a C++ plugin for an existing app that requires a prompt
to pop up. I have to use Qt and I've only just started to learn it so
sorry if this is a dumb question. I'm trying to create a QApplication
within the plugin, but as I have no command line args (argc and argv),
I can't initialise the QApplication. How would one normally integrate
Qt with existing C++ code without a main()? All examples I've seen so
far of Qt have used a main().

Easy: if you don't have any arguments, create the correct argc/argv
yourself. They're not magic. You don't have any, so int argc=0;
and char* argv[]= { "" };
( Using Qt in this way may cause other problems, this group deals
only with the standard C++ stuff. )

Regards,
Michiel Salters
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,978
Members
47,578
Latest member
LC_06

Latest Threads

Top