diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/affine/main.cpp | 2 | ||||
-rw-r--r-- | demos/boxes/glbuffers.cpp | 10 | ||||
-rw-r--r-- | demos/boxes/glbuffers.h | 2 | ||||
-rw-r--r-- | demos/boxes/qtbox.cpp | 2 | ||||
-rw-r--r-- | demos/boxes/scene.cpp | 2 | ||||
-rw-r--r-- | demos/browser/browserapplication.cpp | 4 | ||||
-rw-r--r-- | demos/browser/cookiejar.cpp | 2 | ||||
-rw-r--r-- | demos/browser/settings.cpp | 4 | ||||
-rw-r--r-- | demos/composition/main.cpp | 2 | ||||
-rw-r--r-- | demos/deform/main.cpp | 2 | ||||
-rw-r--r-- | demos/deform/pathdeform.cpp | 2 | ||||
-rw-r--r-- | demos/embeddeddialogs/customproxy.cpp | 2 | ||||
-rw-r--r-- | demos/gradients/main.cpp | 2 | ||||
-rw-r--r-- | demos/interview/model.cpp | 2 | ||||
-rw-r--r-- | demos/mainwindow/colorswatch.cpp | 6 | ||||
-rw-r--r-- | demos/mainwindow/toolbar.cpp | 2 | ||||
-rw-r--r-- | demos/pathstroke/main.cpp | 2 | ||||
-rw-r--r-- | demos/pathstroke/pathstroke.cpp | 2 | ||||
-rw-r--r-- | demos/shared/arthurstyle.cpp | 2 | ||||
-rw-r--r-- | demos/shared/arthurwidgets.cpp | 2 | ||||
-rw-r--r-- | demos/spectrum/app/settingsdialog.cpp | 8 | ||||
-rw-r--r-- | demos/spreadsheet/spreadsheetitem.cpp | 6 |
22 files changed, 41 insertions, 29 deletions
diff --git a/demos/affine/main.cpp b/demos/affine/main.cpp index 85da546..e14dc6b 100644 --- a/demos/affine/main.cpp +++ b/demos/affine/main.cpp @@ -53,7 +53,7 @@ int main(int argc, char **argv) QStyle *arthurStyle = new ArthurStyle(); xformWidget.setStyle(arthurStyle); - QList<QWidget *> widgets = qFindChildren<QWidget *>(&xformWidget); + QList<QWidget *> widgets = xformWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) { w->setStyle(arthurStyle); w->setAttribute(Qt::WA_AcceptTouchEvents); diff --git a/demos/boxes/glbuffers.cpp b/demos/boxes/glbuffers.cpp index 694d05b..84ab26c 100644 --- a/demos/boxes/glbuffers.cpp +++ b/demos/boxes/glbuffers.cpp @@ -42,6 +42,16 @@ #include "glbuffers.h" #include <QtGui/qmatrix4x4.h> + +void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + const GLdouble ymax = zNear * tan(fovy * M_PI / 360.0); + const GLdouble ymin = -ymax; + const GLdouble xmin = ymin * aspect; + const GLdouble xmax = ymax * aspect; + glFrustum(xmin, xmax, ymin, ymax, zNear, zFar); +} + //============================================================================// // GLTexture // //============================================================================// diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h index 67a4ea6..8c1e209 100644 --- a/demos/boxes/glbuffers.h +++ b/demos/boxes/glbuffers.h @@ -58,6 +58,8 @@ if (m_failed || !(assertion)) { returnStatement; \ } +void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); + QT_BEGIN_NAMESPACE class QMatrix4x4; QT_END_NAMESPACE diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 3aaf985..e3a5978 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -324,7 +324,7 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadMatrixf(moveToRectMatrix); - gluPerspective(60.0, 1.0, 0.01, 10.0); + qgluPerspective(60.0, 1.0, 0.01, 10.0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 97953f2..d65af22 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -922,7 +922,7 @@ void Scene::drawBackground(QPainter *painter, const QRectF &) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); - gluPerspective(60.0, width / height, 0.01, 15.0); + qgluPerspective(60.0, width / height, 0.01, 15.0); glMatrixMode(GL_MODELVIEW); diff --git a/demos/browser/browserapplication.cpp b/demos/browser/browserapplication.cpp index ed95d32..633307c 100644 --- a/demos/browser/browserapplication.cpp +++ b/demos/browser/browserapplication.cpp @@ -231,14 +231,14 @@ void BrowserApplication::loadSettings() QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont); int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize); QFont standardFont = QFont(standardFontFamily, standardFontSize); - standardFont = qVariantValue<QFont>(settings.value(QLatin1String("standardFont"), standardFont)); + standardFont = qvariant_cast<QFont>(settings.value(QLatin1String("standardFont"), standardFont)); defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize()); QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont); int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize); QFont fixedFont = QFont(fixedFontFamily, fixedFontSize); - fixedFont = qVariantValue<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont)); + fixedFont = qvariant_cast<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont)); defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize()); diff --git a/demos/browser/cookiejar.cpp b/demos/browser/cookiejar.cpp index 835b61b..d318e3a 100644 --- a/demos/browser/cookiejar.cpp +++ b/demos/browser/cookiejar.cpp @@ -186,7 +186,7 @@ void CookieJar::save() if (cookies.at(i).isSessionCookie()) cookies.removeAt(i); } - cookieSettings.setValue(QLatin1String("cookies"), qVariantFromValue<QList<QNetworkCookie> >(cookies)); + cookieSettings.setValue(QLatin1String("cookies"), QVariant::fromValue<QList<QNetworkCookie> >(cookies)); cookieSettings.beginGroup(QLatin1String("Exceptions")); cookieSettings.setValue(QLatin1String("block"), m_exceptions_block); cookieSettings.setValue(QLatin1String("allow"), m_exceptions_allow); diff --git a/demos/browser/settings.cpp b/demos/browser/settings.cpp index 5ceca67..d83e6a4 100644 --- a/demos/browser/settings.cpp +++ b/demos/browser/settings.cpp @@ -121,8 +121,8 @@ void SettingsDialog::loadFromSettings() // Appearance settings.beginGroup(QLatin1String("websettings")); - fixedFont = qVariantValue<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont)); - standardFont = qVariantValue<QFont>(settings.value(QLatin1String("standardFont"), standardFont)); + fixedFont = qvariant_cast<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont)); + standardFont = qvariant_cast<QFont>(settings.value(QLatin1String("standardFont"), standardFont)); standardLabel->setText(QString(QLatin1String("%1 %2")).arg(standardFont.family()).arg(standardFont.pointSize())); fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(fixedFont.family()).arg(fixedFont.pointSize())); diff --git a/demos/composition/main.cpp b/demos/composition/main.cpp index aa8c139..a528dff 100644 --- a/demos/composition/main.cpp +++ b/demos/composition/main.cpp @@ -59,7 +59,7 @@ int main(int argc, char **argv) QStyle *arthurStyle = new ArthurStyle(); compWidget.setStyle(arthurStyle); - QList<QWidget *> widgets = qFindChildren<QWidget *>(&compWidget); + QList<QWidget *> widgets = compWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) w->setStyle(arthurStyle); compWidget.show(); diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp index bef075a..c5491b3 100644 --- a/demos/deform/main.cpp +++ b/demos/deform/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char **argv) QStyle *arthurStyle = new ArthurStyle(); deformWidget.setStyle(arthurStyle); - QList<QWidget *> widgets = qFindChildren<QWidget *>(&deformWidget); + QList<QWidget *> widgets = deformWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) w->setStyle(arthurStyle); diff --git a/demos/deform/pathdeform.cpp b/demos/deform/pathdeform.cpp index 636d103..d6ac19e 100644 --- a/demos/deform/pathdeform.cpp +++ b/demos/deform/pathdeform.cpp @@ -297,7 +297,7 @@ void PathDeformWidget::setStyle( QStyle * style ) { m_controls->setStyle(style); - QList<QWidget *> widgets = qFindChildren<QWidget *>(m_controls); + QList<QWidget *> widgets = m_controls->findChildren<QWidget *>(); foreach (QWidget *w, widgets) w->setStyle(style); } diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp index bd56f5a..a715f5e 100644 --- a/demos/embeddeddialogs/customproxy.cpp +++ b/demos/embeddeddialogs/customproxy.cpp @@ -113,7 +113,7 @@ QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &valu { if (change == ItemChildAddedChange || change == ItemChildRemovedChange) { if (change == ItemChildAddedChange) { - currentPopup = qVariantValue<QGraphicsItem *>(value); + currentPopup = qvariant_cast<QGraphicsItem *>(value); currentPopup->setCacheMode(ItemCoordinateCache); if (scene()) currentPopup->installSceneEventFilter(this); diff --git a/demos/gradients/main.cpp b/demos/gradients/main.cpp index 8291e85..6678fa2 100644 --- a/demos/gradients/main.cpp +++ b/demos/gradients/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char **argv) GradientWidget gradientWidget(0); QStyle *arthurStyle = new ArthurStyle(); gradientWidget.setStyle(arthurStyle); - QList<QWidget *> widgets = qFindChildren<QWidget *>(&gradientWidget); + QList<QWidget *> widgets = gradientWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) { w->setStyle(arthurStyle); w->setAttribute(Qt::WA_AcceptTouchEvents); diff --git a/demos/interview/model.cpp b/demos/interview/model.cpp index 840bc60..88f200d 100644 --- a/demos/interview/model.cpp +++ b/demos/interview/model.cpp @@ -109,7 +109,7 @@ QVariant Model::headerData(int section, Qt::Orientation orientation, int role) c if (role == Qt::DisplayRole) return QString::number(section); if (role == Qt::DecorationRole) - return qVariantFromValue(services); + return QVariant::fromValue(services); return QAbstractItemModel::headerData(section, orientation, role); } diff --git a/demos/mainwindow/colorswatch.cpp b/demos/mainwindow/colorswatch.cpp index aab4f03..d4dbdca 100644 --- a/demos/mainwindow/colorswatch.cpp +++ b/demos/mainwindow/colorswatch.cpp @@ -454,7 +454,7 @@ void ColorSwatch::updateContextMenu() tabMenu->clear(); splitHMenu->clear(); splitVMenu->clear(); - QList<ColorSwatch*> dock_list = qFindChildren<ColorSwatch*>(mainWindow); + QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>(); foreach (ColorSwatch *dock, dock_list) { // if (!dock->isVisible() || dock->isFloating()) // continue; @@ -467,7 +467,7 @@ void ColorSwatch::updateContextMenu() void ColorSwatch::splitInto(QAction *action) { QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget()); - QList<ColorSwatch*> dock_list = qFindChildren<ColorSwatch*>(mainWindow); + QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>(); ColorSwatch *target = 0; foreach (ColorSwatch *dock, dock_list) { if (action->text() == dock->objectName()) { @@ -486,7 +486,7 @@ void ColorSwatch::splitInto(QAction *action) void ColorSwatch::tabInto(QAction *action) { QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget()); - QList<ColorSwatch*> dock_list = qFindChildren<ColorSwatch*>(mainWindow); + QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>(); ColorSwatch *target = 0; foreach (ColorSwatch *dock, dock_list) { if (action->text() == dock->objectName()) { diff --git a/demos/mainwindow/toolbar.cpp b/demos/mainwindow/toolbar.cpp index dd12419..a988d85 100644 --- a/demos/mainwindow/toolbar.cpp +++ b/demos/mainwindow/toolbar.cpp @@ -232,7 +232,7 @@ void ToolBar::updateMenu() void ToolBar::order() { QList<QAction *> ordered, actions1 = actions(), - actions2 = qFindChildren<QAction *>(this); + actions2 = findChildren<QAction *>(); while (!actions2.isEmpty()) { QAction *action = actions2.takeFirst(); if (!actions1.contains(action)) diff --git a/demos/pathstroke/main.cpp b/demos/pathstroke/main.cpp index 534b233..b10b2ea 100644 --- a/demos/pathstroke/main.cpp +++ b/demos/pathstroke/main.cpp @@ -53,7 +53,7 @@ int main(int argc, char **argv) PathStrokeWidget pathStrokeWidget(smallScreen); QStyle *arthurStyle = new ArthurStyle(); pathStrokeWidget.setStyle(arthurStyle); - QList<QWidget *> widgets = qFindChildren<QWidget *>(&pathStrokeWidget); + QList<QWidget *> widgets = pathStrokeWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) { w->setStyle(arthurStyle); w->setAttribute(Qt::WA_AcceptTouchEvents); diff --git a/demos/pathstroke/pathstroke.cpp b/demos/pathstroke/pathstroke.cpp index 257d02a..308c540 100644 --- a/demos/pathstroke/pathstroke.cpp +++ b/demos/pathstroke/pathstroke.cpp @@ -382,7 +382,7 @@ void PathStrokeWidget::setStyle( QStyle * style ) { m_controls->setStyle(style); - QList<QWidget *> widgets = qFindChildren<QWidget *>(m_controls); + QList<QWidget *> widgets = m_controls->findChildren<QWidget *>(); foreach (QWidget *w, widgets) w->setStyle(style); } diff --git a/demos/shared/arthurstyle.cpp b/demos/shared/arthurstyle.cpp index 4be9079..3a2a2cb 100644 --- a/demos/shared/arthurstyle.cpp +++ b/demos/shared/arthurstyle.cpp @@ -394,7 +394,7 @@ int ArthurStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QWid void ArthurStyle::polish(QWidget *widget) { if (widget->layout() && qobject_cast<QGroupBox *>(widget)) { - if (qFindChildren<QGroupBox *>(widget).size() == 0) { + if (widget->findChildren<QGroupBox *>().size() == 0) { widget->layout()->setSpacing(0); widget->layout()->setMargin(12); } else { diff --git a/demos/shared/arthurwidgets.cpp b/demos/shared/arthurwidgets.cpp index 4182ff1..2eaf96b 100644 --- a/demos/shared/arthurwidgets.cpp +++ b/demos/shared/arthurwidgets.cpp @@ -313,7 +313,7 @@ void ArthurFrame::loadSourceFile(const QString &sourceFile) void ArthurFrame::showSource() { // Check for existing source - if (qFindChild<QTextBrowser *>(this)) + if (findChild<QTextBrowser *>()) return; QString contents; diff --git a/demos/spectrum/app/settingsdialog.cpp b/demos/spectrum/app/settingsdialog.cpp index b5e8459..1f125c9 100644 --- a/demos/spectrum/app/settingsdialog.cpp +++ b/demos/spectrum/app/settingsdialog.cpp @@ -65,13 +65,13 @@ SettingsDialog::SettingsDialog( QAudioDeviceInfo device; foreach (device, availableInputDevices) m_inputDeviceComboBox->addItem(device.deviceName(), - qVariantFromValue(device)); + QVariant::fromValue(device)); foreach (device, availableOutputDevices) m_outputDeviceComboBox->addItem(device.deviceName(), - qVariantFromValue(device)); + QVariant::fromValue(device)); - m_windowFunctionComboBox->addItem(tr("None"), qVariantFromValue(int(NoWindow))); - m_windowFunctionComboBox->addItem("Hann", qVariantFromValue(int(HannWindow))); + m_windowFunctionComboBox->addItem(tr("None"), QVariant::fromValue(int(NoWindow))); + m_windowFunctionComboBox->addItem("Hann", QVariant::fromValue(int(HannWindow))); m_windowFunctionComboBox->setCurrentIndex(m_windowFunction); // Initialize default devices diff --git a/demos/spreadsheet/spreadsheetitem.cpp b/demos/spreadsheet/spreadsheetitem.cpp index e1f0143..93c82a0 100644 --- a/demos/spreadsheet/spreadsheetitem.cpp +++ b/demos/spreadsheet/spreadsheetitem.cpp @@ -72,10 +72,10 @@ QVariant SpreadSheetItem::data(int role) const if (role == Qt::TextColorRole) { if (!isNumber) - return qVariantFromValue(QColor(Qt::black)); + return QVariant::fromValue(QColor(Qt::black)); else if (number < 0) - return qVariantFromValue(QColor(Qt::red)); - return qVariantFromValue(QColor(Qt::blue)); + return QVariant::fromValue(QColor(Qt::red)); + return QVariant::fromValue(QColor(Qt::blue)); } if (role == Qt::TextAlignmentRole) |