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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:50:25+00:00 2026-06-06T14:50:25+00:00

This bad boy just does not want to change size to fill the dock

  • 0

This bad boy just does not want to change size to fill the dock widget area. I have tried all sorts of variations with QSizePolicy but nothing seems to work. The size of the QWebView always stays the same. Do I need to write a resize() callback?

Here’s what I have right now:

    self.helpwindow = QtGui.QDockWidget("Doc Browser")
    self.helpwindow.setAllowedAreas(QtCore.Qt.RightDockWidgetArea)
    self.helpwindow.setFeatures(QtGui.QDockWidget.DockWidgetClosable | QtGui.QDockWidget.DockWidgetFloatable)
    helpAction = self.helpwindow.toggleViewAction()
    helpAction.setText("&Help Browser")
    helpAction.setShortcut(QtGui.QKeySequence("F1"))
    helpMenu.addAction(helpAction)

    self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.helpwindow)      

    helpbrowser = QtWebKit.QWebView(self.helpwindow)
    indexpath = resource_filename(__name__,"help/index.html")
    url = QtCore.QUrl("file://" + indexpath)
    helpbrowser.load(url)
    helpbrowser.show()
    helpbrowser.updateGeometry()
    helpbrowser.update()

    helpbrowser.setMinimumWidth(400)
    helpbrowser.setMinimumHeight( self.helpwindow.height())
    sizepolicy = helpbrowser.sizePolicy()
    sizepolicy.setVerticalPolicy(QtGui.QSizePolicy.MinimumExpanding)
    sizepolicy.setHorizontalPolicy(QtGui.QSizePolicy.MinimumExpanding)

I’m using PyQT4 but C++ solutions gladly accepted.

  • 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-06T14:50:26+00:00Added an answer on June 6, 2026 at 2:50 pm

    Setting only paren’t wont make QDockWidget manage child widget. You need to call:

    helpwindow.setWidget(helpbrowser)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this a bad idea? Does calling a generic private constructor within a public
I become use raw socket and i have this problem: bad file descriptor the
First off, I'm aware this is a bad practice and I have answered many
Can EF really be this bad? Maybe... Let's say I have a fully loaded,
I hover over my menu and a submenu expands, then this bad boy comes
A have ListBox and 4 Items. 2 visible 2 colpased: Click: -this bad! I
For example, I have a list like this: list1 = ['good', 'bad', 'tall', 'big']
Say I have a sentence: I am a good buy and bad boy too
Possible Duplicates: Why is lock(this) {...} bad? In C# it is common to use
In our TFS(2007), we've got this (bad) hierarchy : $main |_ $V1 |_ $V2

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.