Results 1 to 11 of 11

Thread: qt3 to qt4 - uic issue

  1. #1
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default qt3 to qt4 - uic issue

    I am just starting to port my app from qt3 to qt4. I have set up the project file to use the qt3 compatibility libraries as an initial step to get the port up and running. Then I intend to convert the ui files. I am running into a problem with the qmake generated make file only running uic3 against the main dialog ui file and no ohers. That is I only get the header file for one of my ui files and none of the others are processed.

    I think the problem might be related to how I have the directories structured since I have each dialog in it own directory (each of these directories has the ui file along with the .h and .cpp files for the derived classes). All of these are explicitly listed in the project file and the resulting qmake generated make file worked as expected with qt3 (it would uic and moc all of the files that needed this). In addition the the project file has the correct locations for the local include path to pick up all of the header files but the qmake generated make file is missing this information and I had to add this by hand to get far enough to find this issue. What do I need to do to my project file to get qmake to generate a working make file?

    Normally I have been using scons as my build system and I use the qt project file as part of my localization process and I periodically test it to make sure it is in sync with the current project image. But migrating the scons build scripts is another porting issue that I want to hold off on until I get the QT port working. Again I tested qmake generated make file before making any modification for the port and before running qt3to4 against the project.

    Here is my project file:

    Qt Code:
    1. TEMPLATE = app
    2. LANGUAGE = C++
    3.  
    4. CONFIG += qt warn_on debug
    5.  
    6. LIBS += -llcms -ltiff -L/usr/lib -lqassistantclient -lvigraimpex
    7.  
    8. INCLUDEPATH += src/liblprof src/argyll/h src/argyll/numlib src/argyll/rspl src/libqtlcmswidgets src/wwfloatspinbox
    9.  
    10. QT+=qt3support
    11.  
    12. HEADERS += src/liblprof/lcmsprf.h \
    13. src/lprofqt/lprofmain.h \
    14. src/monqt/monitorvalues.h \
    15. src/checkerqt/profilechecker.h \
    16. src/IDqt/profileid.h \
    17. src/parmsqt/profileparms.h \
    18. src/gammaqt/setgamma.h \
    19. src/reference_inst_qt/installreffile.h \
    20. src/argyll/h/sort.h \
    21. src/argyll/numlib/dhsx.h \
    22. src/argyll/numlib/dnsq.h \
    23. src/argyll/numlib/ludecomp.h \
    24. src/argyll/numlib/numlib.h \
    25. src/argyll/numlib/numsup.h \
    26. src/argyll/numlib/powell.h \
    27. src/argyll/numlib/rand.h \
    28. src/argyll/numlib/sobol.h \
    29. src/argyll/numlib/svd.h \
    30. src/argyll/numlib/zbrent.h \
    31. src/argyll/rspl/rev.h \
    32. src/argyll/rspl/rspl.h \
    33. src/argyll/rspl/rspl_imp.h \
    34. src/libqtlcmswidgets/qtlcmswidgets.h \
    35. src/wwfloatspinbox/wwfloatspinbox.h
    36.  
    37. SOURCES += src/liblprof/cmshull.c \
    38. src/liblprof/cmslm.c \
    39. src/liblprof/cmslnr.c \
    40. src/liblprof/cmsmatn.c \
    41. src/liblprof/cmsmkmsh.c \
    42. src/liblprof/cmsmntr.c \
    43. src/liblprof/cmsoutl.c \
    44. src/liblprof/cmspcoll.c \
    45. src/liblprof/cmsprf.c \
    46. src/liblprof/cmsreg.c \
    47. src/liblprof/cmsscn.c \
    48. src/liblprof/cmssheet.c \
    49. src/libqtlcmswidgets/qtlcmswidgets.cpp \
    50. src/lprofqt/lprofmain.cpp \
    51. src/lprofqt/main.cpp \
    52. src/monqt/monitorvalues.cpp \
    53. src/checkerqt/profilechecker.cpp \
    54. src/IDqt/profileid.cpp \
    55. src/parmsqt/profileparms.cpp \
    56. src/checkerqt/qtcietonge.cpp \
    57. src/checkerqt/qtdrawcurve.cpp \
    58. src/gammaqt/setgamma.cpp \
    59. src/reference_inst_qt/installreffile.cpp \
    60. src/argyll/numlib/dhsx.c \
    61. src/argyll/numlib/dnsq.c \
    62. src/argyll/numlib/ludecomp.c \
    63. src/argyll/numlib/numsup.c \
    64. src/argyll/numlib/powell.c \
    65. src/argyll/numlib/rand.c \
    66. src/argyll/numlib/sobol.c \
    67. src/argyll/numlib/svd.c \
    68. src/argyll/numlib/zbrent.c \
    69. src/argyll/rspl/opt.c \
    70. src/argyll/rspl/rev.c \
    71. src/argyll/rspl/rspl.c \
    72. src/argyll/rspl/scat.c \
    73. src/argyll/rspl/spline.c \
    74. src/wwfloatspinbox/wwfloatspinbox.cpp
    75.  
    76. #The following line was changed from FORMS to FORMS3 by qt3to4
    77. FORMS3 = src/lprofqt/lprofmainbase.ui \
    78. src/monqt/monitorvaluesbase.ui \
    79. src/checkerqt/profilecheckerbase.ui \
    80. src/IDqt/profileidbase.ui \
    81. src/parmsqt/profileparmsbase.ui \
    82. src/reference_inst_qt/installreffilebase.ui \
    83. src/gammaqt/setgammabase.ui
    84.  
    85. IMAGES = src/images/Norman_Koren-small.png \
    86. src/images/lcms.png \
    87. src/images/blue-grad.png \
    88. src/images/green-grad.png \
    89. src/images/orange-grad.png \
    90. src/images/yellow-grad.png \
    91. src/images/Norman_Koren-big.png
    92.  
    93. unix {
    94. UI_DIR = .ui
    95. MOC_DIR = .moc
    96. OBJECTS_DIR = .obj
    97. }
    98.  
    99.  
    100. #The following line was inserted by qt3to4
    101. QT += assistant
    102. #The following line was inserted by qt3to4
    103. CONFIG += uic3
    To copy to clipboard, switch view to plain text mode 

    As you can see the FORUMS3 section lists 7 ui files. Only the first one on the list is being processed. I double checked to make sure that I was using the correct qmake (IE. from qt4).

    The next post will have the qmake generated make file:

  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: qt3 to qt4 - uic issue

    Quote Originally Posted by hvengel View Post
    The next post will have the qmake generated make file:
    Please, post it again, but this time as an attachment.

  3. #3
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue

    Here it is:
    Attached Files Attached Files

  4. #4
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue

    Also I figured out what I needed to do to get qmake to generate the right include list in the Makefile. So what I need to figure out is how to get it to generate a Makefile that will uic3 all of the ui files.

  5. #5
    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: qt3 to qt4 - uic issue

    Quote Originally Posted by hvengel View Post
    So what I need to figure out is how to get it to generate a Makefile that will uic3 all of the ui files.
    It looks like all of the rules are already there, but they aren't triggered for some reason. Try cleaning .moc, .obj and .ui directories.

  6. #6
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue

    Cleaning those directories did not help. It only generates the header file for the first dialog and then the build fails because it can't find the other header files that uic3 should have generated. So it appears to me that even though all the rules are in the make file they are for some reason not correctly formed to result in the correct files being generated..

    When I try to run uic3 against one of the ui files I get:

    uic3 src/parmsqt/profileparmsbase.ui -o .ui/profileparmsbase.h
    uic3: property `lineWidth' for widget `smoothnessButtonGroup' of type `Q3ButtonGroup' is not supported. Line: 336 Column: 45
    uic3: property `paletteBackgroundColor' for widget `textLabel14' of type `QLabel' is not supported. Line: 496 Column: 39

    After running this the header file is created and looking at it it does appear to be OK. Running uic3 -impl ... results in an error message about not being able to parse the fist line of the header file and an empty implementation file. But looking that the qt4 docs I am not sure that I have to run uic3 -impl ... since it appears that everything needed is created inline in the header file.

    Even after creating the header file for the first file that the build is issuing a "no such file..." error for it still issues the same error. So for some reason the build is not looking in .ui even though the make file has -I.ui in the include path. I discovered that if I copy the uic3 generated header to the the same directory as the base .ui file that then the build finds it. I then ran uic3 by hand to generate the headers in a location where the build would find them. At that point I start seeing all kinds of compiler errors. Which is something I would expect on my code. So where this is happening with my as yet un-ported code I don't have an issue. But I am also seeing this in the uic3 generated header files which is something that I would not expect. Here is an example:

    ./profilecheckerbase.h: In member function 'void Ui_ProfileCheckerBase::setupUi(QDialog*)':
    ./profilecheckerbase.h:289: error: 'class Q3Table' has no member named 'setAutoMask'

    Looking in the above header file I find that this is happening with an object named ResultsGrid. Opening the ui file in designer 3 and navigating to this object I can't find a property having a name that corresponds to this so I don't know how to change the ui file to get rid of the error. Does that mean that I need to hand edit the generated header file? If so this is a very ugly issue in that it means that using uic3 I can no longer make changes to the ui files without it tuning into a major operation that requires lots of hand steps to get the project to build. By the way commenting out the one line in the generated header file does allow the build to get farther.

    At this point I would have to say that I am confused about how this should all work since much of it appears to be broken and none of the existing documentation seems to cover any of the issues I am seeing. My gut tells me that there must be something that I am doing wrong but I don't know what that is.

  7. #7
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue

    A little follow up. I am to the point where I can get the app to build and run using the designer 3 ui files. There is lots of stuff that does not work the way it should. For example I have some custom widgets that are not fully functional and my qassistantclient based help system is not working. But most of the major functionality is working even though the ui looks ugly.

    I am using a third party SpinBox for floats (wwfloatSpinBox) for qt3 and at this point I just made it a crude reimplementation of QDoubleSpinBox to get this initial port running so that I would not have to mess with the ui files at this stage. As a next step I am going to convert the ui files to QT 4 ui files and replace the wwfloatSpinBox stuff with QDoubleSpinBoxes and then work on my custom widgets. I suspect that migrating the ui files to designer 4 should help with the build issues I was having with uic3.

    Is there a good source document that describes how to setup custom widgets in designer 4? I don't need anything fancy like setting up a plugin for the custom widgets but I would like to be able to see a (visible) place holder in designer when I am placing and sizing the widgets. By the way when I try to use uic3 -convert to convert a ui file from designer 3 to designer 4 all I get is an empty file. It appears that I can open the ui file in designer 4 and it will convert it.

  8. #8
    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: qt3 to qt4 - uic issue

    Quote Originally Posted by hvengel View Post
    Is there a good source document that describes how to setup custom widgets in designer 4?
    You can try to promote a built-in widget to a custom widget.

    http://doc.trolltech.com/4.2/designe...moting-widgets

  9. #9
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue

    Well I already have a set of plugins for my custom widget set. I would like to figure out how to improve what I have to make the plugin simpler to build and install. There are other developers who work on this project and I want it to be simple to build and install the plugin(s). I have four related widgets that are all derived from the same base class (which is derived from a Qt class but with significant extensions). These widgets are highly specialized and are only useful for applications that do stuff related to creating ICC profiles.

    These are all used in my app to do similar things but with different types of external resources (profiles and CGATS files) and with slightly different user presentations depending on the context. I would like to be able to create a single plugin library that has all four widgets in it. But so far I have not been able to get this to build as a single plugin that will also make all four widgets available. But there are some widget plugin libraries that come with Qt4 that have many widgets in a single library. One example is the Qt3 compatibility widget set. So I know it is possible to do but none of the examples I have found show how to do this (IE. they only export a single widget class).

    I am sure that there is just something that I am not doing right but I do not know what that is. The basic problem is that it will not build if I have more than one Q_EXPORT_PLUGIN2 macro even if I separate the individual plugin implementations and header of the four widgets into individual files. This means that I can only have one custom widget per library file and that I must build and install each separately. What I would like is to have one project file that generates one Makefile that will correctly build and install all four widgets. Anyone have any ideas about how to do this?

    By the way I have converted my ui files to designer 4 and I am still having the problem with the generated make file not running uic or moc.

  10. #10
    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: qt3 to qt4 - uic issue

    Quote Originally Posted by hvengel View Post
    I would like to be able to create a single plugin library that has all four widgets in it. But so far I have not been able to get this to build as a single plugin that will also make all four widgets available.
    You need this: http://doc.trolltech.com/4.2/qdesign...interface.html

  11. #11
    Join Date
    Mar 2006
    Posts
    74
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qt3 to qt4 - uic issue (solved)

    That was it thanks.

Similar Threads

  1. Replies: 5
    Last Post: 22nd September 2006, 09:04
  2. Qt 3.3.4 -> Qt 4.1.2, moc file issue
    By philski in forum Qt Tools
    Replies: 1
    Last Post: 11th September 2006, 22:08
  3. Replies: 2
    Last Post: 11th July 2006, 15:19
  4. Qt 4.1.1, no use of uic with qmake?
    By Morea in forum Newbie
    Replies: 2
    Last Post: 28th February 2006, 22:42
  5. uic not creating seperate .h and .cpp files
    By Kapil in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2006, 11:43

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.