Giter Club home page Giter Club logo

Comments (8)

domspad avatar domspad commented on September 4, 2024

Given the following code:

from pyface.api import AboutDialog
dl = AboutDialog(title='TITLEHERE')
import ipdb; ipdb.set_trace()
dl.open()

If i intercept the creation of the dialog, at https://github.com/enthought/pyface/blob/master/pyface/ui/qt4/about_dialog.py#L79
it looks like parent.parent() is resolving to None, resulting in the title attribute being reset.

Confirmed, if I skip this if/else clause, I get the desired behavior
image

from pyface.

pberkes avatar pberkes commented on September 4, 2024

Confirm problem, this is a high priority bug.

from pyface.

corranwebster avatar corranwebster commented on September 4, 2024

Looks like the whole section has some bogus code: eg. https://github.com/enthought/pyface/blob/master/pyface/ui/qt4/about_dialog.py#L85 looks dubious.

Fix looks straightforward (title should be being set when control is created, not when contents are created, which is handled by the base Dialog class already). Bonus points for adding a trait change handler to the title trait... so who wants to do it?

from pyface.

pankajp avatar pankajp commented on September 4, 2024

I think the code for setting the default title https://github.com/enthought/pyface/blob/master/pyface/ui/qt4/about_dialog.py#L85 should be fine if it is only executed when self.title is an empty string.

from pyface.

corranwebster avatar corranwebster commented on September 4, 2024

But even better would just be to have a default title trait for about dialogs to be "About" or "About Dialog" or something similar.

from pyface.

pberkes avatar pberkes commented on September 4, 2024

The ticket is not specific to AboutDialogs, we have this problem with error dialogs.

from pyface.

mdickinson avatar mdickinson commented on September 4, 2024

From the Qt documentation for QMessageBox.setWindowTitle:

Sets the title of the message box to title. On macOS, the window title is ignored (as required by the macOS Guidelines).

from pyface.

mdickinson avatar mdickinson commented on September 4, 2024

To add more information: the error dialogs that @pberkes was referring to use PyFace's MessageDialog, which under Qt uses QMessageBox. So the fact that we're not seeing the title on those under macOS is unrelated to this issue, and arguably isn't a bug.

The original issue with the "about" dialog still persists.

from pyface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.