Results 1 to 5 of 5

Thread: Qt Creator: Can't find resources from my second form

  1. #1
    Join Date
    Jul 2015
    Location
    Sweden
    Posts
    12
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Question Qt Creator: Can't find resources from my second form

    I've just started out trying to create a UI from scratch in Qt Creator. Eventually I'm trying to migrate the UI of a legacy app to Qt.
    The plan is to create as much of the UI in .ui files as possible to ensure it's visible in the Qt Linguist. If only linguist could use the same ui rendering engine as Designer/Creator, but that's a separate issue.

    I've run into what must be a real noob problem. I've created a mainwindow form and a qrc resource file with all our existing images. And all image resources are available when working with the mainwindow form in the Creator Design mode.
    Then I added a new widget based form but in Design mode absolutely no resources are available. I did see a note in a forum post that it's possible to have different resource files for each form in a project. But my situation is that I need to have access to the same resource file with images from all forms in my project.

    How and where can I connect my existing resource file to the new widget based form?

    This was really trivial when working in Designer but here in Creator I just don't understand how to do it. I've been looking everywhere but I must be missing something really obvious here.

    Thanks for helping!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator: Can't find resources from my second form

    I am not sure I understand, but if stand-alone Designer works better than the integrated one, can't you just use the stand-alone variant?

    Cheers,
    _

  3. #3
    Join Date
    Jul 2015
    Location
    Sweden
    Posts
    12
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt Creator: Can't find resources from my second form

    Well I've previously done a few ui designs in Designer. But now I'm testing working with Creator trying out it's code generation and refactoring support to see if it will save any time for me when porting the legacy apps UI.

    The issue I have is rather trivial (I hope).

    I have one project with two forms (+ wrapper classes) and one qrc resourse file containing 100+ images.

    When using the designer GUI to add an action in Design mode to the mainwindow form I can select an image from the resources. But when adding an action in Design mode to the second widget based form I can't select any images as there's no resource file associated with this form. And the dialog shown shows no resources and no option to specify a resource file.

    So the question is: Where is the option to specify the resource file(s) to use for a form?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator: Can't find resources from my second form

    Ok, I tried this:

    - created a new Qt widgets project
    - copied an icon to an image sub folder
    - added a Qt resource and added the icon to it
    - added a menu to the mainwindow form's menu bar
    - added an entry to that menu

    at this point I could chose the icon from the resource as the icon of the action that was generated.

    - added a dialog form class
    - added a button onto it

    at this point I could not yet select the icon from the resource

    - built the application

    now I could also set the ucon on the dialog's button.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    mikag (20th July 2015)

  6. #5
    Join Date
    Jul 2015
    Location
    Sweden
    Posts
    12
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt Creator: Can't find resources from my second form

    So right you are. Once I build and run the project I can access the resources from the new form.
    Never tried that, thanks for helping out!

Similar Threads

  1. Replies: 10
    Last Post: 16th June 2014, 15:40
  2. [Qt 5.0] Can't find Qt Creator?
    By Salads in forum Installation and Deployment
    Replies: 1
    Last Post: 27th January 2013, 02:32
  3. Replies: 2
    Last Post: 22nd November 2011, 00:09
  4. Qt Creator can't find N97 SDK
    By Denis1986 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2010, 09:19
  5. Replies: 2
    Last Post: 22nd May 2006, 22:08

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.