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 8256095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:44:39+00:00 2026-06-08T01:44:39+00:00

I have doubts about my Qt .pro file… I had seen another post about

  • 0

I have doubts about my Qt .pro file… I had seen another post about a similar question in this link, but i used the contains() function and didn’t work.

In the my case, i have a file called mainconfig.h where i define some project configurations flags, i really create defines there, like: “#define MY_CONFIG_DEFINE”. Those flags define what menu options will be shown etc. My problem is: all files are always compiled, even when i don’t use its because i defined some flag in “mainconfig.h” file. I would like to avoid compile some files than i will not use, defining some variables in my .pro file and doing conditional commands, including only the files than i want to.

Can someone help me?

I tried this in my .pro file:

    # This variable defines the current project ADRIANO_PROJECT = PROJECT_TYPE_1
    ADRIANO_PROJECT = PROJECT_TYPE_1

    (...) 

    FORMS += ui/form1.ui \ 
    contains(ADRIANO_PROJECT, PROJECT_TYPE_1) {
            ui/myform1.ui \
            ui/myform2.ui \ 
    }
             ui/form2.ui \
             ui/form3.ui

    (...)

    # This is only a example, ok?

Sorry my english and thanks.

  • 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-06-08T01:44:42+00:00Added an answer on June 8, 2026 at 1:44 am

    IMHO your syntax is wrong. Try this instead:

    ADRIANO_PROJECT = PROJECT_TYPE_1
    
    FORMS += ui/form1.ui \ 
             ui/form2.ui \
             ui/form3.ui
    
    contains(ADRIANO_PROJECT, PROJECT_TYPE_1) {
            FORMS + = ui/myform1.ui \
                      ui/myform2.ui 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few doubts about this robots file. User-agent: * Disallow: /administrator/ Disallow:
I am thinking about using Gears in a project, but I have doubts about
I have programmed an emulator, but I have some doubts about how to organizate
I have some doubts about how to concatenate MvcHtmlString instances because of this information
I have some doubts about this server response stream compression on MVC. Actually im
I'm learning Zend Framework, but I have some doubts about the usage and the
I have some doubts about construction and initialization order guarantees in C++. For instance,
I'm a beginner about javascript, and I have some doubts about the variables of
I have doubts about the resizing of images in my iphone app. So the
I have two doubts about the use of memmove() : When is it preferable

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.