[Qt-interest] Re : Anyone Using the Qt/Motif Extension

Jake Colman colman at ppllc.com
Wed Sep 29 16:44:39 CEST 2010


Guys,

Hmmmm.  This seems to work.  But it irks me greatly that I have to
manually reposition my QMessageBoxes and QDialogs when it should be able
to center itself automatically!  If the parent is a Qt Widget this works
fine, no?  So it's only a problem if the parent is a QtMotifWidget.?

...Jake


>>>>> "BO" == BOUCARD Olivier <boucard_olivier at yahoo.fr> writes:

   BO> It should be preferable to use frameGeometry property instead of
   BO> geometry to correctly center a window on the screen.

   BO> ________________________________
   BO> De : David Boosalis <david.boosalis at gmail.com>
   BO> À : Jake Colman <colman at ppllc.com>
   BO> Cc : qt-interest at trolltech.com
   BO> Envoyé le : Mer 29 septembre 2010, 16h 04min 53s
   BO> Objet : Re: [Qt-interest] Anyone Using the Qt/Motif Extension

   BO> Could you not do something like this:

   BO> QRect rect= parentGeometry();
   BO> QRect dialogRect = myDialog->geometry();
   BO> int newX = rect.x() + (rect.width() - dialogRect.width())/2);
   BO> int newY = rect.y()  + (rect.height() - dialogRect.height())/2);
   myDialog-> move(newX,newY);
   myDialog-> show()

   BO> On Tue, Sep 28, 2010 at 7:34 PM, Jake Colman <colman at ppllc.com> wrote:

   >> My app is legacy Motif application that uses Qt for all of its new
   >> screens.  As such, we make heavy use of the Qt/Motif extension.  I am
   >> now in the process of porting from Qt 3.3.4 to Qt 4.7.0.  Most of the
   >> app is running well and I am working out the kinks.  A major kink for me
   >> is that dialog boxes are no longer centered over the dialog's parent
   >> window.  Does anyone else have this issue or know what to do about it?
   >> 
   >> --
   >> Jake Colman | Director, Software Development
   >> Principia Partners LLC
   >> 101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
   >> t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
   >> e: colman at ppllc.com | w: www.principiapartners.com
   >> Credit technology innovation awards winner 2008 and 2009
   >> 
   >> _______________________________________________
   >> Qt-interest mailing list
   >> Qt-interest at trolltech.com
   >> http://lists.trolltech.com/mailman/listinfo/qt-interest
   >> 

   BO> _______________________________________________
   BO> Qt-interest mailing list
   BO> Qt-interest at trolltech.com
   BO> http://lists.trolltech.com/mailman/listinfo/qt-interest

-- 
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008 and 2009




More information about the Qt-interest-old mailing list