Results 1 to 6 of 6

Thread: opening a .ui file created in Designer in Visual Studio

  1. #1
    Join Date
    Feb 2009
    Posts
    45
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default opening a .ui file created in Designer in Visual Studio

    Hi,

    I am using Qt 4.5.1 and Visual Studio 2005.
    I notice that when I create a new .ui file in designer, then add it to Visual Studio.
    In VS, I rgt click the .ui file/ Properties, and add the Custom Build Step command
    "%qtdir%\bin\uic.exe" "$(InputPath)" -o "$(InputDir)ui_$(InputName).h"
    I make the other necessary changes for the .h file, and it compiles and runs fine.

    But if I were to open this file in VS, it gives me an error and displays the xml code instead.
    i.e. In Visual Studio, I goto <project name>/Forms/myFile.ui and double click this file. The error I get is
    Warning:
    The file </Forms/myFile.ui> cannot be opened with the Qt 4 form editor.
    Try converting the file using uic.exe

    What could be the issue?
    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: opening a .ui file created in Designer in Visual Studio

    Can you open the file with Qt Designer?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: opening a .ui file created in Designer in Visual Studio

    It sounds like you are using an old version of Qt Visual Studio integration. You need to contact Nokia with your appropriate license details for an updated version of the application.

    Alternatively, you can download the free VS integration tool from Nokia's website.

    If you wish to do neither, you can normally get the ui files to open by deleting the first line.

  4. The following user says thank you to squidge for this useful post:

    qtUser500 (6th November 2009)

  5. #4
    Join Date
    Feb 2009
    Posts
    45
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: opening a .ui file created in Designer in Visual Studio

    Wyosta: Yes I can open it from Qt Designer

    fatjuicymole:
    I have installed the correct licensed QT integrator, thats why I am suprised it doesn't open.

    But thanks for your suggestion, I deleted the first line, and 'voila' it opens! I haven't tried integrating this code, but it won't cause any other side-effects will it? (because the first line with the xml statement is removed?).
    Last edited by qtUser500; 6th November 2009 at 19:27.

  6. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: opening a .ui file created in Designer in Visual Studio

    Both designer and the VS built in form editor will accept the file, but you need to remember that if you open a ui file in designer and then save it out again it will re-add the top line, so the file will no longer open in Visual studio again.

    If you are possitive you have the latest version of the integrator, you need to contact Nokia Qt support team with your details.

  7. #6
    Join Date
    Feb 2009
    Posts
    45
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: opening a .ui file created in Designer in Visual Studio

    Thanks, shall do as suggested.

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  2. Visual Studio .NET & QT
    By fruzzo in forum Installation and Deployment
    Replies: 6
    Last Post: 3rd December 2007, 21:00
  3. Replies: 4
    Last Post: 24th November 2007, 13:33
  4. Replies: 5
    Last Post: 30th March 2007, 18:46
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

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.