Results 1 to 8 of 8

Thread: Porting Qt3 linux app to windows qt4

  1. #1
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Porting Qt3 linux app to windows qt4

    I'm programming on linux fedora core 1 with qt 3.1.2 the program works fine on linux and I need now to try it on windows... I'm using a VMWARE with windows 98 and qt 4.1.2 with mingw 3.4.2 special. the one that cames with the qt installer...
    I ported my app to qt4 as the doc sais
    inserted line Qt += qt3support on the pro file
    qt3to 4 the cpps and the pro
    uic3 -convert the ui
    then when doing the qmake -win32
    It tells me..

    QMAKESPEC has not been set, so configuration cannot be deduced.
    Error procesing the.... my .pro file
    so I know I have to configure it... but...

    How?
    Battle Programmer Ph1L
    Philip_Anselmo
    Greetings From Osorno - Chile

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt3 linux app to windows qt4

    Quote Originally Posted by Philip_Anselmo
    QMAKESPEC has not been set, so configuration cannot be deduced.
    There should be something like "Qt Command prompt" in the Start -> Applications -> Qt (or whatever it's called) menu --- it should set all required environment variables when it starts.

  3. The following user says thank you to jacek for this useful post:

    Philip_Anselmo (11th May 2006)

  4. #3
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Porting Qt3 linux app to windows qt4

    thanks JaCeK
    the qmake passes, but now when comiling it shows me a lot of errors like invalid database connection and errors with the pointer typo of the qdatabase

    I've compiled the sqltable example from qt 3.1.2 .. on a windows xp wich I haven't anymore

    and were the same errors so I just changed from pointer to simple objects removing the * and changing the -> for . and then it worked.. but now on the 98 it keeps showing me errors

    the code if you want to see it is on:
    http://philipsoft.dajoob.com/downs/usr/pro1.zip

    on linux it compiles without any errors or warnings but on windows it just won't compile...
    Battle Programmer Ph1L
    Philip_Anselmo
    Greetings From Osorno - Chile

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Porting Qt3 linux app to windows qt4

    Steps I did to get it compile on WinXP + Qt 4.1.2:
    - converted form.ui to qt4
    - sql1.pro, added line "QT += qt3support sql"
    - main.cpp, fixed include:
    Qt Code:
    1. #include "ui_form.h" // note "ui_" prefix
    To copy to clipboard, switch view to plain text mode 
    - main.cpp, fixed ui loading (direct approach):
    Qt Code:
    1. Q3MainWindow w;
    2. Ui_Form ui;
    3. ui.setupUi(&w);
    4. w.show();
    To copy to clipboard, switch view to plain text mode 
    - conexion.cpp, fixed includes:
    Qt Code:
    1. #include <q3datatable.h> // qt3support
    2. #include <q3sqlcursor.h> // qt3support
    3. #include "ui_form.h" // note "ui_" prefix
    4. #include <qsqlerror.h> // added
    To copy to clipboard, switch view to plain text mode 
    - conexion.cpp, fixed defaultDB variable:
    either:
    Qt Code:
    1. QSqlDatabase defaultDB; // remove '*'
    2. // and replace occurrences of "defaultDB->" to "defaultDB."
    To copy to clipboard, switch view to plain text mode 

    Edit: Not that it'd be fully working, but at least it compiles.
    Last edited by jpn; 11th May 2006 at 21:34. Reason: A side note
    J-P Nurmi

  6. #5
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: Porting Qt3 linux app to windows qt4

    I didn't quit understood the ui changes

    [QUOTE=jpn]
    - main.cpp, fixed include:
    Qt Code:
    1. #include "ui_form.h" // note "ui_" prefix
    To copy to clipboard, switch view to plain text mode 
    - main.cpp, fixed ui loading (direct approach):
    Qt Code:
    1. Q3MainWindow w;
    2. Ui_Form ui;
    3. ui.setupUi(&w);
    4. w.show();
    To copy to clipboard, switch view to plain text mode 

    I mean why? is that a change made on qt?
    the ui_form.h is the new ui made by:

    uic3 -convert form.ui > ui_form.ui?



    if isn't too much trouble would you explain that to me? please
    Battle Programmer Ph1L
    Philip_Anselmo
    Greetings From Osorno - Chile

  7. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Porting Qt3 linux app to windows qt4

    Quote Originally Posted by Philip_Anselmo
    I mean why? is that a change made on qt?
    the ui_form.h is the new ui made by:

    uic3 -convert form.ui > ui_form.ui?
    I saved the newly converted "form.ui" as the same name. (I actually just opened it in the Qt Designer which is able to convert the .ui file automatically. You may aswell convert it with uic3.)

    The user interface compiler (uic) generates a header file of the form named in this way:
    %.ui -> ui_%.h ("form.ui" -> "ui_form.h")
    Which is the file we must include in order to be able to use the form.
    There are basically 3 different ways of using a form designed in the designer. The direct approach is a quick and simple way to use forms, but is very inflexible. You surely want to use one of the 2 other ways. Read more about these by following the link below.

    Further documentation: Using a component in Your Application
    J-P Nurmi

  8. The following user says thank you to jpn for this useful post:

    Philip_Anselmo (12th May 2006)

  9. #7
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: Porting Qt3 linux app to windows qt4

    I tryied that too but no results


    it sais that Q3MainWindow is an undefined function and
    ';' expected before w

    and some errors on qsqldatabase.h:208 and so on and so on..

    I'm now installing a windows xp SP2 on a virtual machine to try to compile on that...

    I hope it works
    Battle Programmer Ph1L
    Philip_Anselmo
    Greetings From Osorno - Chile

  10. #8
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt3 linux app to windows qt4

    Quote Originally Posted by Philip_Anselmo
    QMAKESPEC has not been set, so configuration cannot be deduced.
    There is another way to solve this. You have to set environment variable.
    Start command prompt, write
    set QMAKESPEC=win32-g++
    For mingw. You have 2 do this everytime when start a command prompt.

    In win xp. u can set a new enviroment variable by Contrl panel->system-> Advance -> environment variable.
    here define a new variable. QMAKESPEC and set its value as win32-g++

Similar Threads

  1. Porting Qt application from linux to Windows
    By ankit17.ag in forum Qt Programming
    Replies: 5
    Last Post: 12th February 2009, 21:18
  2. Replies: 5
    Last Post: 15th January 2009, 09:03
  3. linux to windows porting issues
    By qtprogrammer12345 in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 06:45
  4. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 10:25
  5. problem of porting from windows to linux
    By jyoti kumar in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2006, 08:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.