Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3878830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:39:25+00:00 2026-05-19T22:39:25+00:00

Qt creator has option to promote one widget to customly created class that derives

  • 0

Qt creator has option to promote one widget to customly created class that derives from base widget – I want to use that to promote widget to class in current project. Qt creator asks me about class name and header filename, and those value go directly to *.ui file, and then to ui_myform.h – the problem is that this file might be (and usually is) generated outside source tree (in build tree) which can be at arbitrary location, so direct specification of path in promoting window will not help. How to let QtCreator/uic know where to look for right header? Is it even possible?

Perhaps there is some Qt variable specyfying location of source tree, that I could insert in header filename field?

I am using self-compiled QtCreator 2.0.1 + self-compiled Qt 4.7.1.

EDIT:

Why can’t you just type in the complete path name of the header file?

What if I will move source tree, or even share it on the web – then everybody who wants to compile my project would have to edit this path either in Qt creator or in source files – both are unacceptable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:39:25+00:00Added an answer on May 19, 2026 at 10:39 pm

    The header file that Designer asks you for in the promotion dialog is YOUR own header file that define the custom widget, not the generated ui_*.h file.

    Say you want to promote a plain QWidget to MyCustomWidget, you must already have a MyCustomWidget.h that defines your MyCustomWidget class included in your .pro file like this:

    HEADERS  += MyCustomWidget.h
    

    And in the widget promotion dialog, just type in MyCustomWidget.h. The purpose of it is so the generated ui header file (wherever it is) can include YOUR class definition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a User class that has a property called Creator which is of
I'm looking for some feedback from anyone that has had a chance to spend
I am new to QT Creator. I have a form that has a line
I want to be able to list the items that either a user has
I want to do something like this: Creator method = new Creator(); method.addSubject(example); class
I'm using Qt creator 2.4. I need to use a string say hiworld in
How to disable qt creator from auto building when trying to debug? Currently when
I am testing a thumbnail image creator script which creates a thumbnail that can
I want to get full console functionality running the program in Qt Creator, the
I have a class library project which uses a namespace (e.g., Cosmos.Creator.Util). I then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.