PDA

View Full Version : Question about GUI and Qt




Soulstorm
Mar 20, 2006, 04:52 PM
I know how to program in C++. And I had decided to proceed to GUI programming. At first, I started learning Carbon. But then, I learnt about Qt (http://www.trolltech.com/). I saw there that I will be able to have cross-platform portability with my GUI, which will be great.

My question is:

What exactly is Qt? Is it worth it to learn how to program with Qt instead of Carbon? What are the pros and cons?



csubear
Mar 20, 2006, 05:30 PM
I know how to program in C++. And I had decided to proceed to GUI programming. At first, I started learning Carbon. But then, I learnt about Qt (http://www.trolltech.com/). I saw there that I will be able to have cross-platform portability with my GUI, which will be great.

My question is:

What exactly is Qt? Is it worth it to learn how to program with Qt instead of Carbon? What are the pros and cons?


Qt is a great cross platform framework, but has one major problem.

If you are developing non-GPL software with it you need to pay a licensing fee up front. ~1-2k per dev station... i think..

Soulstorm
Mar 21, 2006, 01:53 AM
Can someone guide me through compiling Qt for my machine? I downloaded the OpenSource version (since I won't be making commercial programs).

I open the "configure" file, and it configures the Qt installation into my machine. Then, type "make" and after an hour, the programs seem to be ready for use, but when I go to the "bin" folder in the folder from which I made the installation, I find some applications (Assistant, Designer, linguist, qtdemo) among other things, which crash at the instant I open them!

Here is what console tells me: Library not loaded: /usr/local/Trolltech/Qt-4.1.1/lib/QtXml.framework/Versions/4.0/QtXml
Referenced from: /Users/soulstorm/Desktop/qt-mac-opensource-src-4.1.1/bin/qtdemo.app/Contents/MacOS/qtdemo
Reason: image not found

I go to "usr/local" and no trolltech folder is there... What did I do wrong?

Probably I shouldn't be asking this here, but since I opened the thread... If anyone knows please guide me though this!

caveman_uk
Mar 21, 2006, 02:48 AM
The usual trinity of unix build commands is

./configure
make
make install

Have you done 'make install' - you'll probs need admin rights (maybe even sudo)

You need to do these commands whilst your current directory is the one where the makefiles are.

Soulstorm
Mar 21, 2006, 03:46 AM
The usual trinity of unix build commands is

./configure
make
make install

Have you done 'make install' - you'll probs need admin rights (maybe even sudo)

You need to do these commands whilst your current directory is the one where the makefiles are.
yes, but while running make, I end up in this:
QT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG_PLUGIN_CHECK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../Desktop/qt-mac-opensource-src-4.1.1/mkspecs/macx-g++ -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I../../include -I../../include -I../../include/QtCore -Iglobal -I../../Desktop/qt-mac-opensource-src-4.1.1/src/3rdparty/dlcompat -I.moc/debug-shared -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I. -o .obj/debug-shared/qvector.o ../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib/tools/qvector.cpp
c++ -c -pipe -fconstant-cfstrings -g -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG_PLUGIN_CHECK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../Desktop/qt-mac-opensource-src-4.1.1/mkspecs/macx-g++ -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I../../include -I../../include -I../../include/QtCore -Iglobal -I../../Desktop/qt-mac-opensource-src-4.1.1/src/3rdparty/dlcompat -I.moc/debug-shared -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I. -o .obj/debug-shared/qvsnprintf.o ../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib/tools/qvsnprintf.cpp
c++ -c -pipe -fconstant-cfstrings -g -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG_PLUGIN_CHECK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../Desktop/qt-mac-opensource-src-4.1.1/mkspecs/macx-g++ -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I../../include -I../../include -I../../include/QtCore -Iglobal -I../../Desktop/qt-mac-opensource-src-4.1.1/src/3rdparty/dlcompat -I.moc/debug-shared -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I. -o .obj/debug-shared/qabstractfileengine.o ../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib/io/qabstractfileengine.cpp
c++ -c -pipe -fconstant-cfstrings -g -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG_PLUGIN_CHECK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../Desktop/qt-mac-opensource-src-4.1.1/mkspecs/macx-g++ -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I../../include -I../../include -I../../include/QtCore -Iglobal -I../../Desktop/qt-mac-opensource-src-4.1.1/src/3rdparty/dlcompat -I.moc/debug-shared -I../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib -I. -o .obj/debug-shared/qbuffer.o ../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib/io/qbuffer.cpp
../../Desktop/qt-mac-opensource-src-4.1.1/src/corelib/io/qbuffer.cpp:448:28: error: moc_qbuffer.cpp: No such file or directory
make[3]: *** [.obj/debug-shared/qbuffer.o] Error 1
make[2]: *** [debug-all] Error 2
make[1]: *** [sub-corelib-make_default-ordered] Error 2
make: *** [sub-src-make_default-ordered] Error 2
ppp57-adsl-246:~ soulstorm$
Seems it always can't find the file "moc_buffer.cpp"

any ideas?

caveman_uk
Mar 21, 2006, 03:58 AM
Is the file actually there or is it somewhere else?

Soulstorm
Mar 21, 2006, 05:03 AM
Is the file actually there or is it somewhere else?
there is no such file on my computer. However, the file is mentioned in "qbuffer.cpp" in this line:
#ifndef QT_NO_QOBJECT
# include "moc_qbuffer.cpp"
#endif
I don't know what is wrong.....

It seems I should mention that the first time I ran make in this program in my system, it worked. But I forgot to "make install". So, I threw all the qt-mac-opensource-src-4.1.1 directory into the trash (which was 1.5 gbytes) and tried again. I also removed the directories that the configuration had put into my home folder. Namely those:

bin
config.status
config.tests
demos
doc
examples
include
lib
makefile
mkspecs
plugins
qmake
src
tools

I sent an e-mail to the company, but it seems it is unlikely that I get a decent answer, so, I am asking you, guys, in case you have installed it.
Any ideas?

caveman_uk
Mar 21, 2006, 06:08 AM
Have you tried redownloading the source?

I've googled on installing Qt but didn't find much recent other than what's on Trolltechs website (which I guess you've checked). They don't mention problems like this.

I'll repeat what someone else said - if you ever intend releasing anything you write either as closed source or commercial software you must buy a license for Qt now...not when you release...even if you release them for free. All development must be done under the commercial license...the license terms do not allow you to use the free version then buy the commercial license when you release your program. All software written using the free version of Qt must be GPL'd even if it is only for internal corporate use... Of course if you never release it at all no-one will ever know you did it.;)

I realise what you said about your intentions above but I just wanted to make sure you fully understand the license terms before you spend ages trying to get the damn thing to compile.

Would compiling it on fink help????

Wince99
Mar 21, 2006, 07:30 AM
try downloading Fink here (http://fink.sourceforge.net/download/index.php?phpLang=en) (there's even a GUI (http://finkcommander.sourceforge.net/#download) for it)

it's a package manager and will install Qt for you (or anything that's on the list)

Hope that helps,

Soulstorm
Mar 21, 2006, 04:18 PM
I'll repeat what someone else said - if you ever intend releasing anything you write either as closed source or commercial software you must buy a license for Qt now...not when you release...even if you release them for free. All development must be done under the commercial license...the license terms do not allow you to use the free version then buy the commercial license when you release your program. All software written using the free version of Qt must be GPL'd even if it is only for internal corporate use... Of course if you never release it at all no-one will ever know you did it.
I know all these things. I want to use it for educational purposes. I won't break any law. So far, the only think I have lost is my patience while trying to get this to work. I am downloading fink now.

Soulstorm
Mar 21, 2006, 05:33 PM
I give up. I don't know how to use fink, or how that may help me. And I tried to create another account in my computer and try to install the program through that account (in case my Library folder was the problem). No effect.

So, I guess I won' tbe needing Qt after all. Back to that damned Carbon framework again!

Soulstorm
Mar 23, 2006, 01:18 AM
Sorry for the triple post!

Problem solved. The "stupid" solution was to use "sudo make" and not just "make". How the hell was I supposed to fiigure that out since it wasn't mentioned in the manual? I typed that accidentally.

And then, I can't find the .profile it says (my shell is bash) to set my environment variables. Where can I find this file? The manual doesn't mention where.

caveman_uk
Mar 23, 2006, 03:00 AM
You might not have a .profile file you can make one though and it will be read. It's in the your ~ directory.

Try

cd ~
touch .profile

Soulstorm
Mar 23, 2006, 04:46 AM
didn't have permissions at first, but I solved the problem. Thanks a lot for your help. :rolleyes: