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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:25:36+00:00 2026-06-08T14:25:36+00:00

Suppose I have a main Widget, which is used to view some objects. The

  • 0

Suppose I have a main Widget, which is used to view some objects. The names of those objects are stored in a QListWidget. Now when a user selects one object (one item of the QListWidget), I want to open another widget in a separate window which takes the name of the object as an argument.

class MainWidget
{
Q_OBJECT

public slots:
    void openSelection();

};

class ChildWidget
{
public:
    ChildWidget(QString name, QWidget* parent = nullptr);
};

void MainWidget::openSelection()
{
    QString selectedObjectName = ui->objectsNamesList->selectedItem()->text();
    ChildWidget* detaildedWiew = new ChildWidget(selectedObjectName, this);
    detaildedWiew->show();
}

When I do this, the child widget opens, but it has no space of its own. It is locked in the area of the parent. I need to set the children free, to run around the screen freely, independent of their parent. How can I do this? Is there some Qt way, or do I have to define some “pseudo child” relationship and develop a system to properly delete the pseudo children?

  • 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-08T14:25:37+00:00Added an answer on June 8, 2026 at 2:25 pm

    You can use QWidget::setWindowFlags(Qt::Window) to make your widget a separate window.
    Also have a look at Qt::WindowFlags.

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

Sidebar

Related Questions

Suppose I have a main branch and a dev branch. Suppose I merge some
Suppose i have a main js file on the website that contains some code
Suppose I have a module which defines some basic constants such as integer, parameter
How to use subdomain like user.test.com in IIS 7. Suppose we have main domain
Suppose a have a controller (let's call it main) and an associated model which
I have a widget that supposed to call an Activity of the main app
Suppose I have two tables Main and Other like the following: Main +----------+-----------------------------------+ |
suppose I have following test/ Main.py test/one/ One.py test1.txt test/two/ Two.py test2.txt What I
Suppose I have a Javascript file function js_main(args){ /* some code */ var x
Suppose I have the following senario: Trunk is my main development line where programmers

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.