**
****************************************************************************/
-#include "qapplication.h"
+#include "qguiapplication.h"
#ifndef QT_NO_DRAGANDDROP
// ### Temporary workaround for 4.2-rc1!!! To prevent flickering when
// using drag'n drop in a client application. (task 126956)
// setAttribute() should be done unconditionally!
- if (QApplication::type() == QApplication::GuiServer)
+ // if (QApplication::type() == QApplication::GuiServer)
setAttribute(Qt::WA_TransparentForMouseEvents);
}
if (qt_qws_dnd_deco)
qt_qws_dnd_deco->show();
if (currentActionForOverrideCursor != global_accepted_action) {
- QApplication::changeOverrideCursor(QCursor(dragCursor(global_accepted_action), 0, 0));
+ QGuiApplication::changeOverrideCursor(QCursor(dragCursor(global_accepted_action), 0, 0));
currentActionForOverrideCursor = global_accepted_action;
}
} else {
- QCursor *overrideCursor = QApplication::overrideCursor();
+ QCursor *overrideCursor = QGuiApplication::overrideCursor();
if (!overrideCursor || overrideCursor->shape() != Qt::ForbiddenCursor) {
- QApplication::changeOverrideCursor(QCursor(Qt::ForbiddenCursor));
+ QGuiApplication::changeOverrideCursor(QCursor(Qt::ForbiddenCursor));
currentActionForOverrideCursor = Qt::IgnoreAction;
}
if (qt_qws_dnd_deco)
if (object->target() != cw) {
if (object->target()) {
QDragLeaveEvent dle;
- QApplication::sendEvent(object->target(), &dle);
+ QCoreApplication::sendEvent(object->target(), &dle);
willDrop = false;
global_accepted_action = Qt::IgnoreAction;
updateCursor();
object->d_func()->target = cw;
QDragEnterEvent dee(cw->mapFromGlobal(me->globalPos()), possible_actions, dropData,
me->buttons(), me->modifiers());
- QApplication::sendEvent(object->target(), &dee);
+ QCoreApplication::sendEvent(object->target(), &dee);
willDrop = dee.isAccepted() && dee.dropAction() != Qt::IgnoreAction;
global_accepted_action = willDrop ? dee.dropAction() : Qt::IgnoreAction;
updateCursor();
dme.setDropAction(global_accepted_action);
dme.accept();
}
- QApplication::sendEvent(cw, &dme);
+ QCoreApplication::sendEvent(cw, &dme);
willDrop = dme.isAccepted();
global_accepted_action = willDrop ? dme.dropAction() : Qt::IgnoreAction;
updatePixmap();
if (restoreCursor) {
willDrop = false;
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
restoreCursor = false;
}
QDropEvent de(object->target()->mapFromGlobal(me->globalPos()), possible_actions, dropData,
me->buttons(), me->modifiers());
- QApplication::sendEvent(object->target(), &de);
+ QCoreApplication::sendEvent(object->target(), &de);
if (de.isAccepted())
global_accepted_action = de.dropAction();
else
if (object->target()) {
QDragLeaveEvent dle;
- QApplication::sendEvent(object->target(), &dle);
+ QCoreApplication::sendEvent(object->target(), &dle);
}
#ifndef QT_NO_CURSOR
if (restoreCursor) {
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
restoreCursor = false;
}
#endif
****************************************************************************/
#include "qplatformdefs.h"
-#include "qapplication.h"
+#include "qcoreapplication.h"
#include "qeventdispatcher_qpa_p.h"
#include "private/qeventdispatcher_unix_p.h"
-#include "private/qapplication_p.h"
+#include "private/qguiapplication_p.h"
#include "qplatformeventloopintegration_qpa.h"
#include <QWindowSystemInterface>
// handle gui and posted events
d->interrupt = false;
- QApplication::sendPostedEvents();
+ QCoreApplication::sendPostedEvents();
while (!d->interrupt) { // also flushes output buffer ###can be optimized
QWindowSystemInterfacePrivate::WindowSystemEvent *event;
void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
{
QEvent event(QEvent::Enter);
- QApplication::sendSpontaneousEvent(e->enter.data(), &event);
+ QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event);
}
void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e)
{
QEvent event(QEvent::Leave);
- QApplication::sendSpontaneousEvent(e->leave.data(), &event);
+ QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);
}
void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *)