[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Disabling buttons in window title bar
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () web ! de>
Date:       2005-02-09 20:22:06
Message-ID: 200502092122.06520.thomas.luebking () web ! de
[Download RAW message or body]

On Wednesday 09 February 2005 20:59, David Jarvie wrote:
> I want to do this on a popup window, to prevent any possibility that the
> user might happen to click on the button positions just at the moment that
> the window appears, i.e. to prevent unintentional closure or hiding of the
> window.

void MyPopup::closeEvent( QCloseEvent *e ){

if (!myTimerSetFlag)
    e->ignore();
else
   e->accept();
    if (!popupParent)
        return;

    // remember that we (as a popup) might recieve the mouse release
    // event instead of the popupParent. This is due to the fact that
    // the popupParent popped us up in its mousePressEvent handler. To
    // avoid the button remaining in pressed state we simply send a
    // faked mouse button release event to it.
   // best just c&p the inheriteds widgets closeevent
    QMouseEvent me( QEvent::MouseButtonRelease, QPoint(0,0), QPoint(0,0), 
QMouseEvent::LeftButton, QMouseEvent::NoButton);
    QApplication::sendEvent( popupParent, &me );
}

if not your widget (e.g. plain kdialog), you can install an eventfilter, 
ignore the event and fire it by returning TRUE; (in both cases, wheter 
there's a parent or not)
but please don't ask me bout the visual impact on kwin

Thomas
-- 
Think, think different. But essentially: Think!
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic