[Qt-interest] QDialog inside a QWidget
Smokey McPott
mailslave3000 at googlemail.com
Sat Jan 9 14:59:38 CET 2010
Hi,
my first idea would be to set the dialog's maximumSize to the parent's size
and reimplement moveEvent(QMoveEvent *event). Like this:
void Dialog::moveEvent(QMoveEvent *event)
{
position = event.pos();
if(position.x + this.size().width() > parent.pos().x +
parent.size().width() || position.x() < parent().pos().x() || /*same for
height*/ ...)
{
event.ignore();
}
else
{
QDialog::moveEvent(event);
}
}
didn't test it though. Hope it helps...
2010/1/9 Wolfgang Pausch <Wolfgang.Pausch at uibk.ac.at>
> Hello,
>
> I want to implement some modal QDialogs local to a QWidget. What I want is
> the
> following:
>
> - they should be application modal
> - they should not show up in the taskbar
> - it should not be possible to move them outside the parent QWidget
>
> Implementing the first two requirements was fairly easy, but how do I make
> a
> QDialog local to a QWidget? So far, e.g. maximizing maximizes the QDialog
> to
> the whole screen, however I want it maximized to the parent QWidget. How?
>
> Thanks for any hints,
>
> Wolfgang
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100109/2f58dc27/attachment.html
More information about the Qt-interest-old
mailing list