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

  • Home
  • SEARCH
  • 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 8768181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:00:35+00:00 2026-06-13T17:00:35+00:00

Here is my problem: I created a QDockWidget and put a QGraphicsView in it,

  • 0

Here is my problem: I created a QDockWidget and put a QGraphicsView in it, while it is floating everything shows up correctly, but if Dock it somewhere, the starting X and Y of my content is on the titlebar of the QDockWidget. Obviously, it should be under:

tilesetWindow = new QDockWidget(tr("Tileset"), this);
tilesetWindow->setMinimumSize(256,256);
tilesetWindow->setFloating(true);
connect(tilesetWindow, SIGNAL(visibilityChanged(bool)), this, SLOT(triggeredTileset()));

tilesetViewer = new QGraphicsView(tilesetWindow);
tilesetViewer->resize(256,256);
tilesetViewer->show();

An image to illustrate this: http://img86.xooimage.com/files/d/7/6/problem-391a96a.png

I’ve tried to put the QGraphicsView in a container and then in the QDockWidget but had the same result as above. it’s the only place where I write code for the QDockWidget.

How can I make it start at the right place when it is Docked?

Edit:

I tried in a new QtProject and made a QDockWidget with a QTextBrowser in it and had the same bug:

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QDockWidget *dock = new QDockWidget(this, 0);
    dock->setFloating(true);

    QTextBrowser *t = new QTextBrowser(dock);
    t->show();
}

I’m missing something I think…

Qt Creator 2.4.1
Based on Qt 4.7.4 (32 bit)

  • 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-13T17:00:36+00:00Added an answer on June 13, 2026 at 5:00 pm

    After setting the QDockWidget as the Parent, you also need to set the QDockWidget’s Widget as the QGraphicsView, or any other you want.

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    
    QDockWidget *dock = new QDockWidget(this, 0);
    dock->setFloating(true);
    
    QTextBrowser *t = new QTextBrowser(dock);
    dock->setWidget(t);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So here's my problem: I've created a custom AVCaptureSession that takes pictures. I'm not
I've created an example of the problem here: http://jsfiddle.net/JustinN/qWeLT/1/ My actual code is hooked
Here is my problem. I have created a pretty heavy readonly class making many
Okay, here is my problem... I created a Data Layer using the RTM Fluent
I have created a jsfiddle of my problem. Here is a link to the
I've run into a strange problem here: I created today a mousemove horizontal gallery.
Here is my problem: The Problem I have created Tabs using jQuery which is
Small problem here. I have an event created on Facebook and am using the
Pretty basic problem here. So I have a Java package that I have created
I'm thinking the problem here is with my SQL Syntax, but I'm not sure

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.