LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2006, 03:13 PM   #31
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148

Hi,

Okay you have just reminded me that QT was not free on Windows prior to release 4. However you can use QT4 on Kdevelop, I think what you need to do is to change the QPATH variable in you bash_profile file. I think that's what I did for Fedora but I'm working on windows today so I can't check ...

graeme.
 
Old 01-10-2006, 03:36 PM   #32
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally Posted by eantoranz
As I found no QT3 for windows, I guess I'll have to move up development on linux to QT4. Fortunately this is just a test and I can tweek as much as needed till I "figure it out".
In fact there is Free QT3 for Windows. It was distributes with Qt book, I don't know how the licence looks now, however (the book is now downloadable).

Quote:
How can I force kdevelop to use qt4? (it's a ubuntu breezy box).
Tricks... If you change PATH in configuration to point first to new executables, you have it done. Also, note that Qt4 has Qt3 compatibility classes (haven't tried them, through).
 
Old 01-11-2006, 07:52 AM   #33
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Here's my path:

Code:
$ echo $PATH
/usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/antoranz/bin
What should it say instead?

and the other possibility: QPATH. That variable is not set in my environment. What should it be?
 
Old 01-11-2006, 08:20 AM   #34
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Okay I didn't quite get it right, the environment variable is QTDIR...

It's set on my system as:

Quote:
$ echo $QTDIR
/usr/local/Trolltech/Qt-4.1.0
$ echo $PATH
/usr/local/Trolltech/Qt-4.1.0/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/phing/bin:/home/graeme/bin
Obviously I've QT version 4.1 installed and this is the default path from a standard configure: make: make install.

hope that helps

graeme.
 
Old 01-11-2006, 08:25 AM   #35
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Good! But it's not set in my environment either. :-)
 
Old 01-11-2006, 08:26 AM   #36
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Perhaps this can help you help me:

Code:
$ dpkg -l qt'*'
Desired=Unknown/Install/Remove/Purge/Hold
| Estado=No/Instalado/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: mayúsc.=malo)
||/ Nombre                   Versión                 Descripción
+++-========================-========================-================================================================
un  qt-designer              <ninguna>                (no hay ninguna descripción disponible)
un  qt-designer-doc          <ninguna>                (no hay ninguna descripción disponible)
un  qt-doc                   <ninguna>                (no hay ninguna descripción disponible)
un  qt3-assistant            <ninguna>                (no hay ninguna descripción disponible)
ii  qt3-designer             3.3.4-8ubuntu5           Qt3 Designer
ii  qt3-dev-tools            3.3.4-8ubuntu5           Qt3 development tools
ii  qt3-doc                  3.3.4-8ubuntu5           Qt3 API documentation
un  qt3-linguist             <ninguna>                (no hay ninguna descripción disponible)
un  qt3-qtconfig             <ninguna>                (no hay ninguna descripción disponible)
un  qt3-tools                <ninguna>                (no hay ninguna descripción disponible)
ii  qt4-dev-tools            4.0.0-3ubuntu1           Qt 4 development tools
ii  qt4-doc                  4.0.0-3ubuntu1           Qt 4 API documentation
 
Old 01-11-2006, 08:59 AM   #37
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I don't know where the package will put qt but try a slocate

Code:
$ slocate include/QtCore/QString
hopefully that will help.

graeme.
 
Old 01-11-2006, 12:36 PM   #38
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I have /usr/include/qt[34]

inside /usr/include/qt4/ there's QtCore and QtCore/QString

so
Code:
QDIR=/usr/include/qt4/
PATH=$QDIR/bin:$PATH
should do the trick? :-)

Last edited by eantoranz; 01-11-2006 at 12:37 PM.
 
Old 01-11-2006, 12:43 PM   #39
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
and about the other problem: I finally made the "String" show up:

Code:
QString("Hay ").append(QString::number(consulta.size())).append(" registros en la consulta. Desea verlos?")
Is there a more elegant way to make it? Or that's the way to go? I'm willing to learn the QT style guide, so to speak. ;-)
 
Old 01-11-2006, 12:58 PM   #40
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
and bad news (for me, of course). I don't have a bin inside qt4:

Code:
/usr/include/qt4$ find ./ -iname bin'*'
/usr/include/qt4$
That's gonna be a problem, right?

I digged a little further:
Code:
$ dpkg -L qt4-dev-tools
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/qt4-dev-tools
/usr/share/doc/qt4-dev-tools/README
/usr/share/doc/qt4-dev-tools/copyright
/usr/share/doc/qt4-dev-tools/changelog.Debian.gz
/usr/share/menu
/usr/share/menu/qt4-dev-tools
/usr/share/qt4
/usr/share/qt4/phrasebooks
/usr/share/qt4/phrasebooks/danish.qph
/usr/share/qt4/phrasebooks/dutch.qph
/usr/share/qt4/phrasebooks/finnish.qph
/usr/share/qt4/phrasebooks/french.qph
/usr/share/qt4/phrasebooks/german.qph
/usr/share/qt4/phrasebooks/italian.qph
/usr/share/qt4/phrasebooks/norwegian.qph
/usr/share/qt4/phrasebooks/russian.qph
/usr/share/qt4/phrasebooks/spanish.qph
/usr/share/qt4/phrasebooks/swedish.qph
/usr/bin
/usr/bin/assistant-qt4
/usr/bin/designer-qt4
/usr/bin/linguist-qt4
If I use update-alternatives I can make assitant-qt4, designer-qt4 and linguist-qt4 the "prefered" qt applications. You think that will be enough to use QT4 by default when using kdevelop?
 
Old 01-11-2006, 04:14 PM   #41
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
The set is quite short. What you really need (apart from assistant and designer): uic, moc, qmake.
 
Old 01-12-2006, 08:25 AM   #42
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
after a little 'update-alternatives', I have this:

Code:
$ qmake -v
QMake version: 2.00a
Using Qt version 4.0.0 in /usr/lib
$ moc -v
Qt Meta Object Compiler version 58 (Qt 4.0.0)
$ uic -v
Qt user interface compiler 4.0.0.
What's next? simply call kdevelop3? or there's more tweeking to do?

PS
I just ran kdevelop, my old project, and asked to compile and it says:
QDIR=/usr/share/qt3
and it compiled successfully. I expected it to fail big time.
 
Old 01-12-2006, 01:36 PM   #43
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Lightbulb qt3 to qt4

I thought it was gonna be an easy thing to change from qt3 to qt4, but it seems it isn't just a matter or running the new verion of qmake. I'll have to remake my very first project to see how qt4 works, cause there are many changes.

Will keep you posted. :-) Thanks for your help so far.

PS I'll be working without kdevelop till I figure the whole thing out.

Last edited by eantoranz; 01-12-2006 at 01:37 PM.
 
Old 01-13-2006, 09:08 AM   #44
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Question some progress on QT4

I'm starting to make some progress on QT4, though not working on kdevelop, but kate, designer, konsole and so on. :'(

I have noticed two problems:

When I try to make my project, it doesn't do the uic of the form I'm working on, though I included it in the src.pro file.

Code:
SOURCES += main.cpp
FORMS += formas/principal/principalbase_qt4.ui
TEMPLATE = app
CONFIG += release \
warn_on \
thread \
qt
TARGET = ../bin/squidcalc
Code:
$ qmake src.pro; qmake; make
g++ -c -pipe -O2 -D_REENTRANT -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I. -o main.o main.cpp
main.cpp:25:51: error: formas/principal/ui_principalbase_qt4.h: No existe el fichero o el directorio
main.cpp: In function ‘int main(int, char**)’:
main.cpp:35: error: invalid use of undefined type ‘struct QDialog’
/usr/include/qt4/QtGui/qwindowdefs.h:39: error: forward declaration of ‘struct QDialog’
main.cpp:36: error: ‘Ui’ no se puede declarar
main.cpp:36: error: ‘PrincipalBase’ no se declaró en este ámbito
main.cpp:36: error: expected `;' before ‘ui’
main.cpp:37: error: ‘ui’ no se declaró en este ámbito
main.cpp:38: error: invalid use of undefined type ‘struct QDialog’
/usr/include/qt4/QtGui/qwindowdefs.h:39: error: forward declaration of ‘struct QDialog’
make: *** [main.o] Error 1
(by the way, when do I have to run "qmake .profile" or "qmake standalone" or both? )

If I uic it myself, going to that directory, then it works:
Code:
$ cd formas/principal/
$ uic principalbase_qt4.ui -o ui_principalbase_qt4.h
$ cd -
$ make
g++ -c -pipe -O2 -D_REENTRANT -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++  -o ../bin/squidcalc main.o   -L/usr/lib -L/build/buildd/qt4-x11-4.0.0/lib -lQtGui -L/usr/X11R6/lib -laudio -lXt -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXcursor -lXinerama -lfreetype -lXext -lX11 -lm -lQtCore -lfontconfig -lz -ldl -lpthread
$
then I can run the application.

Finally, the second problem: when I run the application, it fails to stop when I close the main form. I have to ctrl+c it.

Here's the main code:
Code:
	QApplication a( argc, argv );
	QDialog *window = new QDialog;
	Ui::PrincipalBase ui;
	ui.setupUi(window);
	window->show();
	a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
	return a.exec();
I added the a.connect() as an attempt to make the application close, but it failed too. What am I missing?
 
Old 01-13-2006, 09:16 AM   #45
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
There is a conversion program from QT3 to QT4. Not certain how accurate it is but worth running your program through that first.

graeme.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kdevelop/IDE Question stealth0707 Programming 10 02-21-2005 07:53 AM
simple kdevelop question laclac01 Linux - Software 0 07-23-2004 10:44 AM
Kdevelop question nny0000 Slackware 3 01-11-2004 12:46 AM
Kdevelop Question BajaNick Programming 1 10-10-2003 12:40 AM
kdevelop question skibud2 Programming 4 09-04-2003 07:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration