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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:34:02+00:00 2026-06-07T15:34:02+00:00

I’m currently doing a map editor for a game I created, and I have

  • 0

I’m currently doing a map editor for a game I created, and I have a tiny problem with Qt. It’s the first time I use it, but I love the challenge and I thought it would be a great experience.

I’m currently building my interface using Qt Designer and I’m stuck on the map part. Indeed, my map is composed of 2 layers : The terrain, and the units/obstacles/vegetation.

I’m using a QTableWidget to contain the terrain information, but now I would like to stack another QTableWidget above it, with the exact same size, so I can place my units, etc. However, I didn’t find how to achieve this on Qt Designer. As soon as I create a new QTableWidget, it goes on the side of the first, not above it.

I thought about using the QStackedWidget, but since it only allows 1 Widget to be visible at a time, it doesn’t fit my hope.

If someone has an idea, as tiny as it might be, I would be very thanksful.

Have a nice day everyone !

EDIT : By above, I don’t mean aside… I know it’s kinda hard to explain. If we consider that the Axis on which we look our screen is Z, I would like both tables to be :
– Equivalent on the X Axis (same number of columns)
– Equivalent on the Y Axis (same number of row)
– Different on the Z Axis (one table is “deeper”)

  • 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-07T15:34:05+00:00Added an answer on June 7, 2026 at 3:34 pm

    Note: This answer is off-topic, as I misunderstood the question. The question is about stacking widgets but painting all of them. However, I leave it there if a future reader wants to put widges one below the other. (See the comments on the questions for details.)


    You can put widgets one below the other using QVBoxLayout. Just select the two table widgets and select ‘Lay out’ > ‘Lay out vertically’ in the context menu. You should then use row stretches to tell the layout that the widgets should have the same sizes. As far as I know, stretches can only be set using C++ code, not from within your .ui designer file. This can be done by putting these two lines in the constructor of your widget class, right after ui->setup(this);:

    ui->verticalLayout->setStretch(0, 50); //  50%, but the number doesn't have to be
    ui->verticalLayout->setStretch(1, 50); //  in percent, so 1 / 1 is the same.
    

    If I understand it correctly, you want to have a big widget, your map editor’s main widget, and the two other widgets below or at the side. If they are below, you can put this together into one QVBoxLayout and set the stretches, for example, to 3:1:1, which makes the main widget occupy 60% of the available height and your two table widgets 20% each:

    ui->verticalLayout->setStretch(0, 3);
    ui->verticalLayout->setStretch(1, 1);
    ui->verticalLayout->setStretch(2, 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't

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.