diff options
Diffstat (limited to 'examples/widgets/painting/pathstroke/pathstroke.cpp')
-rw-r--r-- | examples/widgets/painting/pathstroke/pathstroke.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp index 5a7b8fd9fe..b04998afac 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.cpp +++ b/examples/widgets/painting/pathstroke/pathstroke.cpp @@ -211,13 +211,11 @@ void PathStrokeControls::layoutForDesktop() QPushButton *showSourceButton = new QPushButton(mainGroup); showSourceButton->setText(tr("Show Source")); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) QPushButton *enableOpenGLButton = new QPushButton(mainGroup); enableOpenGLButton->setText(tr("Use OpenGL")); enableOpenGLButton->setCheckable(true); enableOpenGLButton->setChecked(m_renderer->usesOpenGL()); - if (!QGLFormat::hasOpenGL()) - enableOpenGLButton->hide(); #endif QPushButton *whatsThisButton = new QPushButton(mainGroup); whatsThisButton->setText(tr("What's This?")); @@ -242,7 +240,7 @@ void PathStrokeControls::layoutForDesktop() mainGroupLayout->addWidget(animated); mainGroupLayout->addStretch(1); mainGroupLayout->addWidget(showSourceButton); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) mainGroupLayout->addWidget(enableOpenGLButton); #endif mainGroupLayout->addWidget(whatsThisButton); @@ -254,7 +252,7 @@ void PathStrokeControls::layoutForDesktop() connect(penWidth, SIGNAL(valueChanged(int)), m_renderer, SLOT(setPenWidth(int))); connect(showSourceButton, SIGNAL(clicked()), m_renderer, SLOT(showSource())); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool))); #endif connect(whatsThisButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setDescriptionEnabled(bool))); @@ -290,13 +288,11 @@ void PathStrokeControls::layoutForSmallScreens() penWidth->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); penWidth->setRange(0, 500); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) QPushButton *enableOpenGLButton = new QPushButton(this); enableOpenGLButton->setText(tr("Use OpenGL")); enableOpenGLButton->setCheckable(true); enableOpenGLButton->setChecked(m_renderer->usesOpenGL()); - if (!QGLFormat::hasOpenGL()) - enableOpenGLButton->hide(); #endif // Layouts: @@ -307,7 +303,7 @@ void PathStrokeControls::layoutForSmallScreens() QVBoxLayout *leftLayout = new QVBoxLayout(0); leftLayout->addWidget(m_capGroup); leftLayout->addWidget(m_joinGroup); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) leftLayout->addWidget(enableOpenGLButton); #endif leftLayout->addLayout(penWidthLayout); @@ -330,7 +326,7 @@ void PathStrokeControls::layoutForSmallScreens() mainLayout->addWidget(quitBtn, 2, 1, Qt::AlignHCenter | Qt::AlignTop); mainLayout->addWidget(okBtn, 2, 2, Qt::AlignHCenter | Qt::AlignTop); -#ifdef QT_OPENGL_SUPPORT +#if QT_CONFIG(opengl) connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool))); #endif |