Results 1 to 13 of 13

Thread: qt designer has no effect on the application

  1. #1
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default qt designer has no effect on the application

    Hello to everyone,

    I have a problem with a little application I'm working at. I created a GUI and if I want to change some things from the GUI (for example set a title for the main window of the application or change the tab order of some buttons and textedits ), even though in Qt Designer the changes are saved, at runtime I see no changes in the application. Can anyone give me an advice about what to do? I tried to delete the debug folder created by Qt when I press Run, I tried to clean and rebuild the project and nothing. However, if I make some changes in the code the application acts as my code is telling. And I don't get any kind of warnings.

    Thanks in advance!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qt designer has no effect on the application

    Is the UI file you are editing listed in the PRO file FORMS variable?
    Does the compile output show it attempting to build your UI?
    Are the timestamps on your files good?

  3. #3
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    Thank you for your answer. Now to answer your questions.
    1. The UI file I am editing is listed in the pro file forms variable.
    2. The compile output when I run the application is:
    19:08:00: Running steps for project conturi...
    19:08:00: Configuration unchanged, skipping qmake step.
    19:08:00: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe"
    C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/aplicatie_conturi/build-conturi-Desktop_Qt_5_4_2_MinGW_32bit-Debug'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'C:/aplicatie_conturi/build-conturi-Desktop_Qt_5_4_2_MinGW_32bit-Debug'
    19:08:01: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited normally.
    19:08:01: Elapsed time: 00:01.
    where 'C:/aplicatie_conturi/build-conturi-Desktop_Qt_5_4_2_MinGW_32bit-Debug' is the folder built for the application.
    3. I don't understand your question. How can I check if the timestamps on my files are good?

  4. #4
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qt designer has no effect on the application

    As part of its job building your program, mingw32-make is supposed to do the following whenever you modify your UI file (which I named foowidget.ui):
    1. run uic to generate a header ui_foowidget.h from foowidget.ui;
    2. recompile every C++ source file that includes ui_foowidget.h (for instance, foowidget.cpp);
    3. run the linker to produce the executable (let us call it barprogram.exe).

    Therefore, after a successful build, if you order the files from least recently modified to most recently modified, you should have foowidget.ui, then ui_foowidget.h, then foowidget.o (or is it foowidget.obj?), then barprogram.exe.

    Run mingw32-make, and have a look at the timestamps of these files to check that they are in the expected order. From what you describe, it looks like step 1 above is not performed, which would be confirmed if, after a build, foowidget.ui were more recent than ui_foowidget.h.

    Oh, and please also do a clean build of your project (make clean, qmake, make). Could you also post your .pro file?

  5. #5
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    yeye_olive, that's it. The file mainwindow.ui is more recent than ui_mainwindow.h. Why is that? Is there any solution to that? I've read from other places that I should delete the file ui_mainwindow.h. Isn't there an official solution from Qt? If I do a clean and run qmake and after that build, it has no effect.

    The content of my .pro file is:

    #-------------------------------------------------
    #
    # Project created by QtCreator 2014-05-11T22:21:26
    #
    #-------------------------------------------------

    QT += core gui sql

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    #QMAKE_LFLAGS += /INCREMENTAL:NO

    TARGET = conturi
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui
    Last edited by Saurian; 24th June 2015 at 20:12.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qt designer has no effect on the application

    Completely delete the shadow build directory and rebuild the project.

  7. #7
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    I've already tried that and had no effect.

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt designer has no effect on the application

    Have you checked to make sure it isn't something really dumb (and easily overlooked) like the name of the file being misspelled in in either the .pro file or the place where the header is being included? Are you on a case-sensitive OS?

  9. #9
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    Hard to believe. The .pro file was automatic created and I didn't change anything to do with the name of my files. The only thing I changed in the .pro file was at the lines:

    QT += core gui sql

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    #QMAKE_LFLAGS += /INCREMENTAL:NO
    when I used the sql library (to work with sqlite) or when I moved the project on Ubuntu and back on Windows.

  10. #10
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    I, finally, found the problem. In my application's folder, aplicatie_conturi, there was already a version of the ui_mainwindow.h created by Qt a while ago and the path was changed at a certain point for creating the exe file with ui_mainwindow.h and all in another folder. So when I was building the project, Qt seems that was using the files from the application source files' folder.

  11. #11
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt designer has no effect on the application

    Have you checked to make sure it isn't something really dumb (and easily overlooked) like ... the place where the header is being included?
    How many times have we all done something like that?

  12. #12
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    So I have exactly the same issue but this time is on Ubuntu 16.04 and there is no ui_mainwindow.h file. I tried to delete the shadow build, delete the make file, clean, qmake, build and the same. At a certain point I deleted the executable file from the application directory and apparently Qt can't generate a new executable. I'm getting the error message: "Executable path_to_executable does not exist."

    Anyone has any idea what the issue may be?
    Best regards,
    Sorin

  13. #13
    Join Date
    Apr 2012
    Location
    Romania
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt designer has no effect on the application

    Apparently the issue is that make doesn't generate any executable from Makefile. If I delete Makefile and try to run make (either through Qt or directly from the terminal) I'm getting the following compile output:

    make: Nothing to be done for 'first'.
    If I try to generate Makefile from Terminal running qmake conturi.pro I'm getting the following Makefile:

    ################################################## ###########################
    # Makefile for building: conturi
    # Generated by qmake (2.01a) (Qt 4.8.7) on: Jo apr. 12 18:27:22 2018
    # Project: conturi.pro
    # Template: subdirs
    # Command: /usr/lib/x86_64-linux-gnu/qt4/bin/qmake -o Makefile conturi.pro
    ################################################## ###########################

    first: make_default
    MAKEFILE = Makefile
    QMAKE = /usr/lib/x86_64-linux-gnu/qt4/bin/qmake
    DEL_FILE = rm -f
    CHK_DIR_EXISTS= test -d
    MKDIR = mkdir -p
    COPY = cp -f
    COPY_FILE = $(COPY)
    COPY_DIR = $(COPY) -r
    INSTALL_FILE = install -m 644 -p
    INSTALL_PROGRAM = install -m 755 -p
    INSTALL_DIR = $(COPY_DIR)
    DEL_FILE = rm -f
    SYMLINK = ln -f -s
    DEL_DIR = rmdir
    MOVE = mv -f
    CHK_DIR_EXISTS= test -d
    MKDIR = mkdir -p
    SUBTARGETS =


    Makefile: conturi.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
    /usr/share/qt4/mkspecs/common/linux.conf \
    /usr/share/qt4/mkspecs/common/gcc-base.conf \
    /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
    /usr/share/qt4/mkspecs/common/g++-base.conf \
    /usr/share/qt4/mkspecs/common/g++-unix.conf \
    /usr/share/qt4/mkspecs/qconfig.pri \
    /usr/share/qt4/mkspecs/features/qt_functions.prf \
    /usr/share/qt4/mkspecs/features/qt_config.prf \
    /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    /usr/share/qt4/mkspecs/features/default_pre.prf \
    /usr/share/qt4/mkspecs/features/release.prf \
    /usr/share/qt4/mkspecs/features/default_post.prf \
    /usr/share/qt4/mkspecs/features/shared.prf \
    /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
    /usr/share/qt4/mkspecs/features/warn_on.prf \
    /usr/share/qt4/mkspecs/features/qt.prf \
    /usr/share/qt4/mkspecs/features/unix/thread.prf \
    /usr/share/qt4/mkspecs/features/moc.prf \
    /usr/share/qt4/mkspecs/features/resources.prf \
    /usr/share/qt4/mkspecs/features/uic.prf \
    /usr/share/qt4/mkspecs/features/yacc.prf \
    /usr/share/qt4/mkspecs/features/lex.prf \
    /usr/share/qt4/mkspecs/features/include_source_dir.prf
    $(QMAKE) -o Makefile conturi.pro
    /usr/share/qt4/mkspecs/common/unix.conf:
    /usr/share/qt4/mkspecs/common/linux.conf:
    /usr/share/qt4/mkspecs/common/gcc-base.conf:
    /usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
    /usr/share/qt4/mkspecs/common/g++-base.conf:
    /usr/share/qt4/mkspecs/common/g++-unix.conf:
    /usr/share/qt4/mkspecs/qconfig.pri:
    /usr/share/qt4/mkspecs/features/qt_functions.prf:
    /usr/share/qt4/mkspecs/features/qt_config.prf:
    /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
    /usr/share/qt4/mkspecs/features/default_pre.prf:
    /usr/share/qt4/mkspecs/features/release.prf:
    /usr/share/qt4/mkspecs/features/default_post.prf:
    /usr/share/qt4/mkspecs/features/shared.prf:
    /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
    /usr/share/qt4/mkspecs/features/warn_on.prf:
    /usr/share/qt4/mkspecs/features/qt.prf:
    /usr/share/qt4/mkspecs/features/unix/thread.prf:
    /usr/share/qt4/mkspecs/features/moc.prf:
    /usr/share/qt4/mkspecs/features/resources.prf:
    /usr/share/qt4/mkspecs/features/uic.prf:
    /usr/share/qt4/mkspecs/features/yacc.prf:
    /usr/share/qt4/mkspecs/features/lex.prf:
    /usr/share/qt4/mkspecs/features/include_source_dir.prf:
    qmake: qmake_all FORCE
    @$(QMAKE) -o Makefile conturi.pro

    qmake_all: FORCE

    make_default: FORCE
    make_first: FORCE
    all: FORCE
    clean: FORCE
    distclean: FORCE
    -$(DEL_FILE) Makefile
    install_subtargets: FORCE
    uninstall_subtargets: FORCE

    check:

    mocclean: compiler_moc_header_clean compiler_moc_source_clean

    mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    install: install_subtargets FORCE

    uninstall: uninstall_subtargets FORCE

    FORCE:
    Here is conturi.pro:

    #-------------------------------------------------
    #
    # Project created by QtCreator 2014-05-11T22:21:26
    #
    #-------------------------------------------------

    QT += core gui sql

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    #QMAKE_LFLAGS += /INCREMENTAL:NO

    TARGET = conturi
    TEMPLATE = subdirs

    SOURCES += src/sources/main.cpp\
    src/sources/mainwindow.cpp

    HEADERS += src/headers/mainwindow.h

    FORMS += src/forms/mainwindow.ui

    RC_FILE = src/resources/conturi.rc
    Best regards,
    Sorin

Similar Threads

  1. Replies: 1
    Last Post: 15th August 2014, 08:48
  2. Replies: 3
    Last Post: 14th February 2013, 19:41
  3. Drag & Drop Widget Designer Application
    By arunpk in forum Qt Programming
    Replies: 6
    Last Post: 19th September 2012, 09:01
  4. Screen Resolution stting takes effect on application !
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2008, 14:06
  5. Replies: 2
    Last Post: 27th June 2007, 11:23

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.