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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:12:06+00:00 2026-05-13T20:12:06+00:00

what I need is something very alike QtMessageBox.information method, but I need it form

  • 0

what I need is something very alike QtMessageBox.information method, but I need it form my custom window.

I need a one window with few labels, one QtTreeViewWidget, one QButtonGroup … This window will be called from main window. If we call class that implements called window as SelectionWindow, than what I need is:

class MainWindow(QtGui.QMainWindow):
    ...
    def method2(self):
        selWin = SelectionWindow()
        tempSelectionValue = selWin.getSelection()
        # Blocked until return from getSelection
        self.method1(tempSelectionValue)
        ...

class SelectionWindow(QtGui.QMainWindow):
    ...
    def getSelection(self):
        ...
        return selectedRow
    ...

Method getSelection from SelectionWindow should pop up selection window and at the end return row selected in QTreeViewWidget. I want that main window remains blocked until user selects one row in selection window and confirms it by button. I hope that you will understand what I need.

I will appreciate any help!

Thanks,
Tiho

  • 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-13T20:12:06+00:00Added an answer on May 13, 2026 at 8:12 pm

    I would do something like this:

    • dialog window with buttonbox ->
      events connected to accept() and
      reject() slots of the dialog itself
    • set the dialog modality to something like application modal
    • call the exec_() method of the dialog to keep it blocking until the user chooses ok/cancel
    • after the execution of the exec_() method terminates, you can read what you need from the dialog widgets.

    Something like this should fit your needs:

    class SelectionWindow(QtGui.QMainWindow):
        ...
        def getSelection(self):
            result = self.exec_()
            if result:
                # User clicked Ok - read currentRow
                selectedRow = self.ui.myQtTreeViewWidget.currentIndex()
            else:
                # User clicked Cancel
                selectedRow = None
            return selectedRow
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know about SortedSet , but in my case I need something that implements
Basically, what I need is something like Dependecy Walker , but it should work
I need to match something in the form <a href=pic/5 id=piclink><img src=thumb/5 /></a> to
Very often I need something like that: foreach (Line line in lines) { if
I need something in between a full text search and an index search: I
I need something that takes a directory's contents and then proceeds to generate an
I need to add full web search to my site. I need something like
I want to ditch my current editor. I feel I need something else. That
Are there any good code profilers/analyzers for Erlang? I need something that can build
Well... that's it. I need something simple and reliable (doesn't have to have fancy

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.