summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-12 07:47:49 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-12 07:47:49 (GMT)
commit6ab9ca55342dad0ce16402b7d2f8d47d61a0af76 (patch)
tree8a022fb07d41cb3d7f3850ae5f68a15ecd8130c5 /src/gui/kernel/qwidget.cpp
parent144154046529e557616738c13b3721e3cab77301 (diff)
parentd0baa9b8dc9ed191903447032f1cf6afe9a2463e (diff)
downloadQt-6ab9ca55342dad0ce16402b7d2f8d47d61a0af76.zip
Qt-6ab9ca55342dad0ce16402b7d2f8d47d61a0af76.tar.gz
Qt-6ab9ca55342dad0ce16402b7d2f8d47d61a0af76.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index dfbd647..a1daf46 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1055,7 +1055,7 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
{
Q_Q(QWidget);
- if (qApp->type() == QApplication::Tty)
+ if (QApplication::type() == QApplication::Tty)
qFatal("QWidget: Cannot create a QWidget when no GUI is being used");
Q_ASSERT(uncreatedWidgets);
@@ -1070,7 +1070,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
q->data = &data;
#ifndef QT_NO_THREAD
- if (!q->parent()) {
+ if (!parent) {
Q_ASSERT_X(q->thread() == qApp->thread(), "QWidget",
"Widgets must be created in the GUI thread.");
}
@@ -1348,7 +1348,7 @@ QWidget::~QWidget()
#ifdef QT3_SUPPORT
if (QApplicationPrivate::main_widget == this) { // reset main widget
QApplicationPrivate::main_widget = 0;
- qApp->quit();
+ QApplication::quit();
}
#endif
@@ -2037,8 +2037,8 @@ void QWidgetPrivate::deactivateWidgetCleanup()
{
Q_Q(QWidget);
// If this was the active application window, reset it
- if (qApp->activeWindow() == q)
- qApp->setActiveWindow(0);
+ if (QApplication::activeWindow() == q)
+ QApplication::setActiveWindow(0);
// If the is the active mouse press widget, reset it
if (q == qt_button_down)
qt_button_down = 0;
@@ -2239,7 +2239,7 @@ QStyle *QWidget::style() const
if (d->extra && d->extra->style)
return d->extra->style;
- return qApp->style();
+ return QApplication::style();
}
/*!
@@ -4996,7 +4996,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
QPoint scrollAreaOffset;
#ifndef QT_NO_SCROLLAREA
- QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(q->parent());
+ QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent);
if (scrollArea && scrollArea->viewport() == q) {
QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr;
QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate);
@@ -5375,7 +5375,7 @@ QIcon QWidget::windowIcon() const
return *d->extra->topextra->icon;
w = w->parentWidget();
}
- return qApp->windowIcon();
+ return QApplication::windowIcon();
}
void QWidgetPrivate::setWindowIcon_helper()
@@ -5897,7 +5897,7 @@ QWidget *QWidget::previousInFocusChain() const
bool QWidget::isActiveWindow() const
{
QWidget *tlw = window();
- if(tlw == qApp->activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup)))
+ if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup)))
return true;
#ifndef QT_NO_GRAPHICSVIEW
@@ -5918,7 +5918,7 @@ bool QWidget::isActiveWindow() const
!tlw->isModal() &&
(!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow()))
return true;
- QWidget *w = qApp->activeWindow();
+ QWidget *w = QApplication::activeWindow();
while(w && tlw->windowType() == Qt::Tool &&
!w->isModal() && w->parentWidget()) {
w = w->parentWidget()->window();
@@ -7088,7 +7088,7 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
#ifdef QT3_SUPPORT
if (isMain)
- qApp->quit();
+ QApplication::quit();
#endif
// Attempt to close the application only if this widget has the
// WA_QuitOnClose flag set set and has a non-visible parent
@@ -7271,10 +7271,10 @@ QSize QWidgetPrivate::adjustedSize() const
if (q->isWindow()) {
Qt::Orientations exp;
- if (QLayout *l = q->layout()) {
- if (l->hasHeightForWidth())
- s.setHeight(l->totalHeightForWidth(s.width()));
- exp = l->expandingDirections();
+ if (layout) {
+ if (layout->hasHeightForWidth())
+ s.setHeight(layout->totalHeightForWidth(s.width()));
+ exp = layout->expandingDirections();
} else
{
if (q->sizePolicy().hasHeightForWidth())
@@ -7791,7 +7791,7 @@ bool QWidget::event(QEvent *event)
QList<QObject*> childList = d->children;
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
- if (o != qApp->activeModalWidget()) {
+ if (o != QApplication::activeModalWidget()) {
if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->isWindow()) {
// do not forward the event to child windows,
// QApplication does this for us
@@ -8017,9 +8017,9 @@ void QWidget::mousePressEvent(QMouseEvent *event)
if ((windowType() == Qt::Popup)) {
event->accept();
QWidget* w;
- while ((w = qApp->activePopupWidget()) && w != this){
+ while ((w = QApplication::activePopupWidget()) && w != this){
w->close();
- if (qApp->activePopupWidget() == w) // widget does not want to dissappear
+ if (QApplication::activePopupWidget() == w) // widget does not want to dissappear
w->hide(); // hide at least
}
if (!rect().contains(event->pos())){