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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:21:54+00:00 2026-06-19T03:21:54+00:00

I am really new to QML and I am struggling with defining a basic

  • 0

I am really new to QML and I am struggling with defining a basic layout in QML. How do you anchor an element to the window, so that is resizes when the window is resized by the user? I want to add a Rectangle that fills all space available in the window, but I haven’t found a way to do this from inside the qml file. All examples I have found so far use a fix width and height, but this means that the element will keep its preset size when the size of the window changes.

  • 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-19T03:21:56+00:00Added an answer on June 19, 2026 at 3:21 am

    For your specific problem :

    1. Anchor all the elements based on their parents(siblings).
    2. Always make your top qml elemnt to fill the viewer space as explained here.

    Adding to it. Whenever you need such kind of re sizing to be done, you need to inform from one side to the other about change in geometry. By sides I mean, from qml to C++ or from C++ to qml.

    To tell qml about resizing in the top window :

    Your top parent element in qml will not get any signal about resizing of the widget. You need to do it manually.

    1. To get the information that top widget has actually re sized, you need to implement the resizeEvent function.

    2. Whenever your implementation gets called, you need to signal the qml side that some resizing has happened and thus the top qml parent should also resize itself.

    To tell C++ about resizing in the top qml element :

    Similarly, your widget in C++ will not get any signal about resizing of the top qml element. You need to do it manually:

    1. Expose a class from C++ side to qml.
    2. Whenever top qml element changes, call a function of this class to inform this change, and ask it to resize the top widget as well.

    You can get basic idea of these approaches here and here.

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

Sidebar

Related Questions

I'm really new to android and I got an issue that I don't clearly
Im really really new to Javascript but Ive got this script that loads the
I'm really new to Apache Hadoop. But I want to learn how to use
I am really new to python, just played around with the scrapy framework that
I'm really new to Python, but I've picked a problem that actually pertains to
I'm really new at Ruby On Rails and I'm working with a baseApp that
I'm really new to PHP but what I want to do is make a
I'm really new to Ruby (first day!) and I'm struggling with this here. I'm
I'm really new to flash and am struggling to find a way to do
I'm really new at add-in stuff. My code should do these: An outlook user

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.