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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:05:16+00:00 2026-05-28T18:05:16+00:00

I basically have a QMainWindow, and a Dialog window whose constructor is shown below;

  • 0

I basically have a QMainWindow, and a Dialog window whose constructor is shown below;

class VisualTool(QtGui.QDialog):
    def __init__(self, parent = None):
        QtGui.QWidget.__init__(self, parent)
        self.WidgetBoard = Ui_Aesthetics_Tool()
        self.WidgetBoard.setupUi(self)
        self.setWindowFlags(QtCore.Qt.Tool)    # <-

As you can see, I would like to treat the Dialog as a Tool window (it’s exactly the type of window I need). The tool window should be shown after a button click on the QMainWindow, and for interaction with QMainWindow to continue.

Before my QMainWindow is shown, calling .show() on my tool window spawns it correctly.
However, if I attempt to show my Tool window AFTER showing QMainWindow (such as after a button click), calling .show() and .exec() have no effect whatsoever.

(There’s not even any flicker of a window. There’s no spawn whatsoever!)

Once the window is shown, I can not change the Window Flags. It has no effect.

How can I get this Tool window to show?!
Thanks!


PyQt4
python 2.7.2
windows 7

  • 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-05-28T18:05:17+00:00Added an answer on May 28, 2026 at 6:05 pm

    I’m not sure I understand what your issue really is. This test code snippet seems to function fine, though I have no idea what your missing Ui_Aesthetics_Tool() code does to modify the tool window:

    #!/usr/bin/env python
    
    import sys
    from PyQt4 import QtCore, QtGui
    
    
    class Main(QtGui.QMainWindow):
        def __init__(self, parent=None):
            super(Main, self).__init__(parent)
            self.resize(640,480)        
            self.button = QtGui.QPushButton("Click me")
            self.setCentralWidget(self.button)
    
            self.button.clicked.connect(self.showTool)
    
        def showTool(self):
            tool = VisualTool(self)
            tool.show()
    
    class VisualTool(QtGui.QDialog):
        def __init__(self, parent = None):
            QtGui.QWidget.__init__(self, parent)
            # self.WidgetBoard = Ui_Aesthetics_Tool()
            # self.WidgetBoard.setupUi(self)
            self.setWindowFlags(QtCore.Qt.Tool)
    
    
    if __name__ == "__main__":
        app = QtGui.QApplication(sys.argv)
        myapp = Main()
        myapp.show()
        sys.exit(app.exec_())
    

    I am able to launch multiple tool windows.
    And as for using exec_(), that is a modal blocking call and probably not what you want.

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

Sidebar

Related Questions

Right, what I have is: <Window x:Class=WpfGettingThingsDone.View.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml AllowsTransparency=True Background=Transparent WindowStyle=None Title={Binding Title}
I basically have 3 layers ( Window > Scene > View ) that each
I basically have a class within another class (child). I'm trying to get the
I basically have: Public Class Job: MyBaseClass { public virtual string JobInformation {get;set;} ...
I basically have the following class: .sf-sub-indicator { background: url(/abcprod/images/arrows-ffffff.png) no-repeat -10px -100px; }
I basically have this markup coming from my JSP. I add class in each
I basically have a page which shows a processing screen which has been flushed
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I basically have three tables, posts, images and postimages (this simply contains the ids

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.