Active Topics

 


Reply
Thread Tools
Posts: 227 | Thanked: 51 times | Joined on Feb 2006
#1
I've made my first non-trivial QT application in QT creator. Works great except I needed to make the window a little smaller. For some reason, none of the changes I make in the design window propagate to my application now. I can add buttons, move buttons and change window size but nothing changes in my application. I've tried rebuild all, clean, qmake but nothing seems to work. What simple step am I missing to make my form changes take effect in my application?

Thanks,
David
__________________
David Smoot
 
GreatGonzo's Avatar
Posts: 275 | Thanked: 389 times | Joined on Feb 2010 @ Sydney
#2
Could you post the contents of your .pro file...
__________________
Quick Widgets - http://wiki.maemo.org/Quick_Widgets
 
benlau's Avatar
Posts: 135 | Thanked: 375 times | Joined on Mar 2010 @ Hong Kong
#3
It is strange problem. One of the possible reason is something wrong with build path.

New version of Qt creator create a build directory to hold generated source code and object files. (e.g yourprogram-build-desktop) , but old version of Qt creator build on (yourprogram/ or yourprogram/release depend on platform) . If you have tried to build using command line , it also use yourprogram/ .

If you have used command line or old version of Qt creator , it will generate ui_xxx.h in yourprogram/ , and it is always included first. But new version of Qt creator generate ui_xxx.h in yourporgram-build-desktop , but it will use the ui_xxx.h in yourprogram/ in linking. Then the changes of your UI file will not be appear in output program.
__________________
Qt Ambassador | Nokia Certified Qt Specialist
PenPen SketchBook |
FrontView - 0.2 is released! | DQuest
Status: Now working on GTD software
 
Posts: 227 | Thanked: 51 times | Joined on Feb 2006
#4
I've made some progress with google (or maybe I'm digging the hole deeper)...

When I change the mainwindow.ui file, that is getting changed just fine on disk. But when I run qmake, it is not regenerating ui_mainwindow.h? I can run
Code:
uic-qt4 -o ui_mainwindow.h mainwindow.ui
and get it to re-generate the .h but I should not have to do that by hand.

Anyway, I did make some hand edits to the .pro file so I might have hosed it up... The contents of my .pro file:

Code:
#-------------------------------------------------
#
# Project created by QtCreator 2010-10-26T21:15:44
#
#-------------------------------------------------
AUTHOR = David Smoot
EMAIL = davidsmoot gmail.com
LICENSE = GPL
LANGUAGE = C++

QT       += dbus

TARGET = termaemo
TEMPLATE = app

win32 : DEFINES += _TTY_WIN_ QWT_DLL QT_DLL
unix : DEFINES += _TTY_POSIX_

CONFIG += qt warn_on debug app_bundle thread x11
SOURCES += main.cpp\
        mainwindow.cpp \
    SerialPort/qextserialport.cpp \
    SerialPort/qextserialbase.cpp \
    SerialPort/ManageSerialPort.cpp \
    hxmparser.cpp

win32 : SOURCES += SerialPort/win_qextserialport.cpp

unix : SOURCES += SerialPort/posix_qextserialport.cpp

HEADERS  += mainwindow.h \
    SerialPort/qextserialport.h \
    SerialPort/qextserialbase.h \
    SerialPort/ManageSerialPort.h \
    hxmparser.h \
    ui_mainwindow.h

win32 : HEADERS += SerialPort/win_qextserialport.h

unix : HEADERS += SerialPort/posix_qextserialport.h

FORMS    += mainwindow.ui
Is the generated ui_mainwindow.h supposed to live in the project directory or in the build directory?

Thanks for taking the time to respond,
David
__________________
David Smoot

Last edited by djs_tx; 2010-11-24 at 03:24.
 
benlau's Avatar
Posts: 135 | Thanked: 375 times | Joined on Mar 2010 @ Hong Kong
#5
Originally Posted by djs_tx View Post
Is the generated ui_mainwindow.h supposed to live in the project directory or in the build directory?

Thanks for taking the time to respond,
David
It depends. If you use Qt creator , it should live in build directory. If you use command line , it is usually live in project directory unless you have specific the build path in .pro file.

Don't use Qt creator and command line togather unless you know qmake very well.

You may first remove all ui_* , moc_* , *.o & Makefile in project & build path. And try to build the program again.
__________________
Qt Ambassador | Nokia Certified Qt Specialist
PenPen SketchBook |
FrontView - 0.2 is released! | DQuest
Status: Now working on GTD software
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#6
There seems to be a problem with the creator
Under the project page in build, there are two options, shadow build and skip packaging step.
I find normally by ticking the skip packaging step, doing a clean and a rebuild itsuddenly works fine!
The other odd reason (And only happenned once due to my stupidity is that on the device, the install folder seemed to have root permission s so didnt update!)

Anyway, worth a try
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 

The Following User Says Thank You to noobmonkey For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 16:44.