diff options
Diffstat (limited to 'examples/widget')
-rw-r--r-- | examples/widget/doc/images/widget-example.png | bin | 322046 -> 0 bytes | |||
-rw-r--r-- | examples/widget/doc/src/widget.qdoc | 159 | ||||
-rw-r--r-- | examples/widget/graphmodifier.cpp | 229 | ||||
-rw-r--r-- | examples/widget/graphmodifier.h | 79 | ||||
-rw-r--r-- | examples/widget/main.cpp | 211 | ||||
-rw-r--r-- | examples/widget/widget.pro | 14 |
6 files changed, 0 insertions, 692 deletions
diff --git a/examples/widget/doc/images/widget-example.png b/examples/widget/doc/images/widget-example.png Binary files differdeleted file mode 100644 index c2d4d598..00000000 --- a/examples/widget/doc/images/widget-example.png +++ /dev/null diff --git a/examples/widget/doc/src/widget.qdoc b/examples/widget/doc/src/widget.qdoc deleted file mode 100644 index b67386c7..00000000 --- a/examples/widget/doc/src/widget.qdoc +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the QtDataVisualization module. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** -****************************************************************************/ - -/*! - \example widget - \title Widget Example - \ingroup qtdatavisualization_examples - \brief Using Q3DBars in a widget application. - - The widget example shows how to make a 3D bar graph using Q3DBars and combining the use of - widgets for adjusting several adjustable qualities. The example shows how to: - - \list - \li Create an application with Q3DBars and some widgets - \li Use QBarDataProxy to set data to the graph - \li Adjust some graph properties using widget controls - \endlist - - It also demonstrates how having negative bar values affects the graph. - - \image widget-example.png - - \section1 Creating the application - - First, in main.cpp, we create a QApplication, instantiate Q3DBars and a window container - for it: - - \snippet ../examples/widget/main.cpp 0 - - The call to QWidget::createWindowContainer is required, as all data visualization types - (Q3DBars, Q3DScatter, Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used - as a widget any other way. - - Then we'll create horizontal and vertical layouts. We'll add the graph and the vertical - layout into the horizontal one: - - \snippet ../examples/widget/main.cpp 1 - - We're not using the vertical layout for anything yet, but we'll get back to it in - \l {Using widgets to control the graph} - - Next, let's create another class to handle the data addition and other interaction with the - graph. Let's call it GraphModifier (See \l {Setting up the graph} and - \l {Adding data to the graph} for details): - - \snippet ../examples/widget/main.cpp 2 - - The application main is done and we can show the graph and start the event loop: - - \snippet ../examples/widget/main.cpp 3 - - \section1 Setting up the graph - - Let's set up the graph in the constructor of the GraphModifier class we instantiated in the - application main: - - \snippet ../examples/widget/graphmodifier.cpp 0 - - Let's take a closer look at parts of the code. - - First we're creating the axes and the proxy into member variables to support changing them - easily later on, if we want to: - - \snippet ../examples/widget/graphmodifier.cpp 1 - - Then we're setting some of the visual qualities for the graph: - - \snippet ../examples/widget/graphmodifier.cpp 2 - - We're also setting up the axes and adding them to the graph. Notice that we're not setting them - active yet: - - \snippet ../examples/widget/graphmodifier.cpp 3 - - And add the proxy. Note that we're not setting it active yet, but just adding it: - - \snippet ../examples/widget/graphmodifier.cpp 4 - - That concludes setting up the graph. - - \section1 Adding data to the graph - - At the end of the constructor there's a call: - - \code resetTemperatureData(); \endcode - - The method is used to add data to the proxy: - - \snippet ../examples/widget/graphmodifier.cpp 5 - - Now the data is in the proxy, but not in the graph. We have not set the proxy active yet. - - In application main, we called \c {modifier->start()} after constructing all the necessary - objects. This is what is done in it: - - \snippet ../examples/widget/graphmodifier.cpp 6 - - Finally we set the proxy and the axes active. Now our graph has the data and is ready to be - used. - - \section1 Using widgets to control the graph - - There isn't much interaction yet, so let's continue by adding some widgets back in the - application main. Let's just focus on two: - - \snippet ../examples/widget/main.cpp 4 - - We can use these to rotate the graph using slider widgets instead of just using the mouse or - touch. - - Let's add them to the vertical layout we created earlier: - - \snippet ../examples/widget/main.cpp 5 - - Then we'll connect them to methods in GraphModifier: - - \snippet ../examples/widget/main.cpp 6 - - Here are the methods in GraphModifier the signals were connected to: - - \snippet ../examples/widget/graphmodifier.cpp 7 - - Now these two sliders can be used to rotate the graph. - - And so we have an application in which we can control: - - \list - \li Graph rotation - \li Label style - \li Camera preset - \li Background visibility - \li Grid visibility - \li Bar shading smoothness - \li Bar style - \li Selection mode - \li Theme - \li Shadow quality - \li Font - \li Font size - \endlist - - \section1 Example contents - -*/ diff --git a/examples/widget/graphmodifier.cpp b/examples/widget/graphmodifier.cpp deleted file mode 100644 index 0b33bde0..00000000 --- a/examples/widget/graphmodifier.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the QtDataVisualization module. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** -****************************************************************************/ - -#include "graphmodifier.h" -#include <QtDataVisualization/q3dcategoryaxis.h> -#include <QtDataVisualization/q3dvalueaxis.h> -#include <QtDataVisualization/qbardataproxy.h> -#include <QtDataVisualization/q3dscene.h> -#include <QtDataVisualization/q3dcamera.h> -#include <QTime> - -QT_DATAVISUALIZATION_USE_NAMESPACE - -const QString celsiusString = QString(QChar(0xB0)) + "C"; - -//! [0] -GraphModifier::GraphModifier(Q3DBars *bargraph) - : m_graph(bargraph), - m_xRotation(0.0), - m_yRotation(0.0), - m_fontSize(30), - m_segments(4), - m_subSegments(3), - m_minval(-20.0), - m_maxval(20.0), - //! [1] - m_temperatureAxis(new Q3DValueAxis), - m_yearAxis(new Q3DCategoryAxis), - m_monthAxis(new Q3DCategoryAxis), - m_temperatureData(new QBarDataProxy), - //! [1] - m_style(QDataVis::MeshStyleBevelBars), - m_smooth(false) -{ - //! [2] - m_graph->setBackgroundVisible(false); - m_graph->setShadowQuality(QDataVis::ShadowQualitySoftMedium); - m_graph->setFont(QFont("Times New Roman", m_fontSize)); - m_graph->setLabelStyle(QDataVis::LabelStyleFromTheme); - //! [2] - - m_months << "January" << "February" << "March" << "April" << "May" << "June" << "July" << "August" << "September" << "October" << "November" << "December"; - m_years << "2006" << "2007" << "2008" << "2009" << "2010" << "2011" << "2012"; - - //! [3] - m_temperatureAxis->setTitle("Average temperature"); - m_temperatureAxis->setSegmentCount(m_segments); - m_temperatureAxis->setSubSegmentCount(m_subSegments); - m_temperatureAxis->setRange(m_minval, m_maxval); - m_temperatureAxis->setLabelFormat(QString(QStringLiteral("%d ") + celsiusString)); - - m_yearAxis->setTitle("Year"); - m_monthAxis->setTitle("Month"); - - m_graph->addAxis(m_temperatureAxis); - m_graph->addAxis(m_yearAxis); - m_graph->addAxis(m_monthAxis); - //! [3] - - m_temperatureData->setItemLabelFormat(QStringLiteral("@valueTitle for @colLabel @rowLabel: @valueLabel")); - - //! [4] - m_graph->addDataProxy(m_temperatureData); - //! [4] - - resetTemperatureData(); -} -//! [0] - -GraphModifier::~GraphModifier() -{ - delete m_graph; -} - -void GraphModifier::start() -{ - //! [6] - m_graph->setActiveDataProxy(m_temperatureData); - - m_graph->setValueAxis(m_temperatureAxis); - m_graph->setRowAxis(m_yearAxis); - m_graph->setColumnAxis(m_monthAxis); - //! [6] -} - -void GraphModifier::resetTemperatureData() -{ - //! [5] - // Set up data - static const qreal temp[7][12] = { - {-6.7, -11.7, -9.7, 3.3, 9.2, 14.0, 16.3, 17.8, 10.2, 2.1, -2.6, -0.3}, // 2006 - {-6.8, -13.3, 0.2, 1.5, 7.9, 13.4, 16.1, 15.5, 8.2, 5.4, -2.6, -0.8}, // 2007 - {-4.2, -4.0, -4.6, 1.9, 7.3, 12.5, 15.0, 12.8, 7.6, 5.1, -0.9, -1.3}, // 2008 - {-7.8, -8.8, -4.2, 0.7, 9.3, 13.2, 15.8, 15.5, 11.2, 0.6, 0.7, -8.4}, // 2009 - {-14.4, -12.1, -7.0, 2.3, 11.0, 12.6, 18.8, 13.8, 9.4, 3.9, -5.6, -13.0}, // 2010 - {-9.0, -15.2, -3.8, 2.6, 8.3, 15.9, 18.6, 14.9, 11.1, 5.3, 1.8, -0.2}, // 2011 - {-8.7, -11.3, -2.3, 0.4, 7.5, 12.2, 16.4, 14.1, 9.2, 3.1, 0.3, -12.1} // 2012 - }; - - // Create data array - QBarDataArray *dataSet = new QBarDataArray; - QBarDataRow *dataRow; - - dataSet->reserve(m_years.size()); - for (int year = 0; year < m_years.size(); year++) { - // Create a data row - dataRow = new QBarDataRow(m_months.size()); - for (int month = 0; month < m_months.size(); month++) { - // Add data to the row - (*dataRow)[month].setValue(temp[year][month]); - } - // Add the row to the set - dataSet->append(dataRow); - } - - // Add data to the graph (the graph assumes ownership of it) - m_temperatureData->resetArray(dataSet, m_years, m_months); - //! [5] -} - -void GraphModifier::changeStyle(int style) -{ - m_style = QDataVis::MeshStyle(style); - m_graph->setBarType(m_style, m_smooth); -} - -void GraphModifier::changePresetCamera() -{ - static int preset = QDataVis::CameraPresetFrontLow; - - m_graph->scene()->activeCamera()->setCameraPreset((QDataVis::CameraPreset)preset); - - if (++preset > QDataVis::CameraPresetDirectlyBelow) - preset = QDataVis::CameraPresetFrontLow; -} - -void GraphModifier::changeTheme(int theme) -{ - m_graph->setTheme((QDataVis::Theme)theme); -} - -void GraphModifier::changeLabelStyle() -{ - static int style = QDataVis::LabelStyleFromTheme; - - m_graph->setLabelStyle((QDataVis::LabelStyle)style); - - if (++style > QDataVis::LabelStyleTransparent) - style = QDataVis::LabelStyleOpaque; -} - -void GraphModifier::changeSelectionMode(int selectionMode) -{ - m_graph->setSelectionMode((QDataVis::SelectionMode)selectionMode); -} - -void GraphModifier::changeFont(const QFont &font) -{ - QFont newFont = font; - newFont.setPointSize(m_fontSize); - m_graph->setFont(newFont); -} - -void GraphModifier::changeFontSize(int fontsize) -{ - m_fontSize = fontsize; - QFont font = m_graph->font(); - font.setPointSize(m_fontSize); - m_graph->setFont(font); -} - -void GraphModifier::shadowQualityUpdatedByVisual(QDataVis::ShadowQuality sq) -{ - int quality = int(sq); - // Updates the UI component to show correct shadow quality - emit shadowQualityChanged(quality); -} - -void GraphModifier::changeShadowQuality(int quality) -{ - QDataVis::ShadowQuality sq = QDataVis::ShadowQuality(quality); - m_graph->setShadowQuality(sq); - emit shadowQualityChanged(quality); -} - -//! [7] -void GraphModifier::rotateX(int rotation) -{ - m_xRotation = rotation; - m_graph->scene()->activeCamera()->setCameraPosition(m_xRotation, m_yRotation); -} - -void GraphModifier::rotateY(int rotation) -{ - m_yRotation = rotation; - m_graph->scene()->activeCamera()->setCameraPosition(m_xRotation, m_yRotation); -} -//! [7] - -void GraphModifier::setBackgroundEnabled(int enabled) -{ - m_graph->setBackgroundVisible((bool)enabled); -} - -void GraphModifier::setGridEnabled(int enabled) -{ - m_graph->setGridVisible((bool)enabled); -} - -void GraphModifier::setSmoothBars(int smooth) -{ - m_smooth = bool(smooth); - m_graph->setBarType(m_style, m_smooth); -} diff --git a/examples/widget/graphmodifier.h b/examples/widget/graphmodifier.h deleted file mode 100644 index 2e18ffd2..00000000 --- a/examples/widget/graphmodifier.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the QtDataVisualization module. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** -****************************************************************************/ - -#ifndef GRAPHMODIFIER_H -#define GRAPHMODIFIER_H - -#include <QtDataVisualization/q3dbars.h> - -#include <QFont> -#include <QDebug> -#include <QStringList> -#include <QPointer> - -using namespace QtDataVisualization; - -class GraphModifier : public QObject -{ - Q_OBJECT -public: - explicit GraphModifier(Q3DBars *bargraph); - ~GraphModifier(); - - void resetTemperatureData(); - void changePresetCamera(); - void changeLabelStyle(); - void changeFont(const QFont &font); - void changeFontSize(int fontsize); - void rotateX(int rotation); - void rotateY(int rotation); - void setBackgroundEnabled(int enabled); - void setGridEnabled(int enabled); - void setSmoothBars(int smooth); - void start(); - -public slots: - void changeStyle(int style); - void changeSelectionMode(int selectionMode); - void changeTheme(int theme); - void changeShadowQuality(int quality); - void shadowQualityUpdatedByVisual(QDataVis::ShadowQuality shadowQuality); - -signals: - void shadowQualityChanged(int quality); - -private: - Q3DBars *m_graph; - qreal m_xRotation; - qreal m_yRotation; - int m_fontSize; - int m_segments; - int m_subSegments; - qreal m_minval; - qreal m_maxval; - QStringList m_months; - QStringList m_years; - Q3DValueAxis *m_temperatureAxis; - Q3DCategoryAxis *m_yearAxis; - Q3DCategoryAxis *m_monthAxis; - QBarDataProxy *m_temperatureData; - QDataVis::MeshStyle m_style; - bool m_smooth; -}; - -#endif diff --git a/examples/widget/main.cpp b/examples/widget/main.cpp deleted file mode 100644 index 158244b4..00000000 --- a/examples/widget/main.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the QtDataVisualization module. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** -****************************************************************************/ - -#include "graphmodifier.h" - -#include <QApplication> -#include <QWidget> -#include <QHBoxLayout> -#include <QVBoxLayout> -#include <QPushButton> -#include <QCheckBox> -#include <QSlider> -#include <QFontComboBox> -#include <QLabel> -#include <QScreen> -#include <QFontDatabase> - -int main(int argc, char **argv) -{ - //! [0] - QApplication app(argc, argv); - Q3DBars *widgetgraph = new Q3DBars(); - QWidget *container = QWidget::createWindowContainer(widgetgraph); - //! [0] - - QSize screenSize = widgetgraph->screen()->size(); - container->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 1.5)); - container->setMaximumSize(screenSize); - container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - container->setFocusPolicy(Qt::StrongFocus); - - //! [1] - QWidget *widget = new QWidget; - QHBoxLayout *hLayout = new QHBoxLayout(widget); - QVBoxLayout *vLayout = new QVBoxLayout(); - hLayout->addWidget(container, 1); - hLayout->addLayout(vLayout); - //! [1] - - widget->setWindowTitle(QStringLiteral("Average temperatures in Oulu, Finland (2006-2012)")); - - QComboBox *themeList = new QComboBox(widget); - themeList->addItem(QStringLiteral("Qt")); - themeList->addItem(QStringLiteral("Primary Colors")); - themeList->addItem(QStringLiteral("Digia")); - themeList->addItem(QStringLiteral("Stone Moss")); - themeList->addItem(QStringLiteral("Army Blue")); - themeList->addItem(QStringLiteral("Retro")); - themeList->addItem(QStringLiteral("Ebony")); - themeList->addItem(QStringLiteral("Isabelle")); - themeList->setCurrentIndex(0); - - QPushButton *labelButton = new QPushButton(widget); - labelButton->setText(QStringLiteral("Change label style")); - - QCheckBox *smoothCheckBox = new QCheckBox(widget); - smoothCheckBox->setText(QStringLiteral("Smooth bars")); - smoothCheckBox->setChecked(false); - - QComboBox *barStyleList = new QComboBox(widget); - barStyleList->addItem(QStringLiteral("Bars")); - barStyleList->addItem(QStringLiteral("Pyramids")); - barStyleList->addItem(QStringLiteral("Cones")); - barStyleList->addItem(QStringLiteral("Cylinders")); - barStyleList->addItem(QStringLiteral("Beveled Bars")); - barStyleList->setCurrentIndex(4); - - QPushButton *cameraButton = new QPushButton(widget); - cameraButton->setText(QStringLiteral("Change camera preset")); - - QComboBox *selectionModeList = new QComboBox(widget); - selectionModeList->addItem(QStringLiteral("None")); - selectionModeList->addItem(QStringLiteral("Bar")); - selectionModeList->addItem(QStringLiteral("Bar and Row")); - selectionModeList->addItem(QStringLiteral("Bar and Column")); - selectionModeList->addItem(QStringLiteral("Bar, Row and Column")); - selectionModeList->addItem(QStringLiteral("Slice into Row")); - selectionModeList->addItem(QStringLiteral("Slice into Column")); - selectionModeList->setCurrentIndex(1); - - QCheckBox *backgroundCheckBox = new QCheckBox(widget); - backgroundCheckBox->setText(QStringLiteral("Show background")); - backgroundCheckBox->setChecked(false); - - QCheckBox *gridCheckBox = new QCheckBox(widget); - gridCheckBox->setText(QStringLiteral("Show grid")); - gridCheckBox->setChecked(true); - - //! [4] - QSlider *rotationSliderX = new QSlider(Qt::Horizontal, widget); - rotationSliderX->setTickInterval(30); - rotationSliderX->setTickPosition(QSlider::TicksBelow); - rotationSliderX->setMinimum(-180); - rotationSliderX->setValue(0); - rotationSliderX->setMaximum(180); - QSlider *rotationSliderY = new QSlider(Qt::Horizontal, widget); - rotationSliderY->setTickInterval(15); - rotationSliderY->setTickPosition(QSlider::TicksAbove); - rotationSliderY->setMinimum(-90); - rotationSliderY->setValue(0); - rotationSliderY->setMaximum(90); - //! [4] - - QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, widget); - fontSizeSlider->setTickInterval(10); - fontSizeSlider->setTickPosition(QSlider::TicksBelow); - fontSizeSlider->setMinimum(1); - fontSizeSlider->setValue(30); - fontSizeSlider->setMaximum(100); - - QFontComboBox *fontList = new QFontComboBox(widget); - fontList->setCurrentFont(QFont("Times New Roman")); - - QComboBox *shadowQuality = new QComboBox(widget); - shadowQuality->addItem(QStringLiteral("None")); - shadowQuality->addItem(QStringLiteral("Low")); - shadowQuality->addItem(QStringLiteral("Medium")); - shadowQuality->addItem(QStringLiteral("High")); - shadowQuality->addItem(QStringLiteral("Low Soft")); - shadowQuality->addItem(QStringLiteral("Medium Soft")); - shadowQuality->addItem(QStringLiteral("High Soft")); - shadowQuality->setCurrentIndex(5); - - //! [5] - vLayout->addWidget(new QLabel(QStringLiteral("Rotate horizontally"))); - vLayout->addWidget(rotationSliderX, 0, Qt::AlignTop); - vLayout->addWidget(new QLabel(QStringLiteral("Rotate vertically"))); - vLayout->addWidget(rotationSliderY, 0, Qt::AlignTop); - //! [5] - vLayout->addWidget(labelButton, 0, Qt::AlignTop); - vLayout->addWidget(cameraButton, 0, Qt::AlignTop); - vLayout->addWidget(backgroundCheckBox); - vLayout->addWidget(gridCheckBox); - vLayout->addWidget(smoothCheckBox, 0, Qt::AlignTop); - vLayout->addWidget(new QLabel(QStringLiteral("Change bar style"))); - vLayout->addWidget(barStyleList); - vLayout->addWidget(new QLabel(QStringLiteral("Change selection mode"))); - vLayout->addWidget(selectionModeList); - vLayout->addWidget(new QLabel(QStringLiteral("Change theme"))); - vLayout->addWidget(themeList); - vLayout->addWidget(new QLabel(QStringLiteral("Adjust shadow quality"))); - vLayout->addWidget(shadowQuality); - vLayout->addWidget(new QLabel(QStringLiteral("Change font"))); - vLayout->addWidget(fontList); - vLayout->addWidget(new QLabel(QStringLiteral("Adjust font size"))); - vLayout->addWidget(fontSizeSlider, 1, Qt::AlignTop); - - //! [2] - GraphModifier *modifier = new GraphModifier(widgetgraph); - //! [2] - - //! [6] - QObject::connect(rotationSliderX, &QSlider::valueChanged, modifier, &GraphModifier::rotateX); - QObject::connect(rotationSliderY, &QSlider::valueChanged, modifier, &GraphModifier::rotateY); - //! [6] - - QObject::connect(labelButton, &QPushButton::clicked, modifier, - &GraphModifier::changeLabelStyle); - QObject::connect(cameraButton, &QPushButton::clicked, modifier, - &GraphModifier::changePresetCamera); - - QObject::connect(backgroundCheckBox, &QCheckBox::stateChanged, modifier, - &GraphModifier::setBackgroundEnabled); - QObject::connect(gridCheckBox, &QCheckBox::stateChanged, modifier, - &GraphModifier::setGridEnabled); - QObject::connect(smoothCheckBox, &QCheckBox::stateChanged, modifier, - &GraphModifier::setSmoothBars); - - QObject::connect(barStyleList, SIGNAL(currentIndexChanged(int)), modifier, - SLOT(changeStyle(int))); - - QObject::connect(selectionModeList, SIGNAL(currentIndexChanged(int)), modifier, - SLOT(changeSelectionMode(int))); - - QObject::connect(themeList, SIGNAL(currentIndexChanged(int)), modifier, - SLOT(changeTheme(int))); - - QObject::connect(shadowQuality, SIGNAL(currentIndexChanged(int)), modifier, - SLOT(changeShadowQuality(int))); - - QObject::connect(modifier, &GraphModifier::shadowQualityChanged, shadowQuality, - &QComboBox::setCurrentIndex); - QObject::connect(widgetgraph, &Q3DBars::shadowQualityChanged, modifier, - &GraphModifier::shadowQualityUpdatedByVisual); - - QObject::connect(fontSizeSlider, &QSlider::valueChanged, modifier, - &GraphModifier::changeFontSize); - QObject::connect(fontList, &QFontComboBox::currentFontChanged, modifier, - &GraphModifier::changeFont); - - //! [3] - widget->show(); - modifier->start(); - return app.exec(); - //! [3] -} diff --git a/examples/widget/widget.pro b/examples/widget/widget.pro deleted file mode 100644 index c9feb187..00000000 --- a/examples/widget/widget.pro +++ /dev/null @@ -1,14 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -SOURCES += main.cpp graphmodifier.cpp -HEADERS += graphmodifier.h - -QT += widgets - -INSTALLS += target - -OTHER_FILES += doc/src/* \ - doc/images/* - |