void ImageView::setButtonIcon(QPushButton *button, QString fileName, int width, int height) { QPixmap iconPixmap(fileName); QIcon buttonIcon(iconPixmap.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation)); button->setIcon(buttonIcon); button->setIconSize(iconPixmap.scaled(width, height).rect().size()); }
void PropertyRowField::redraw(IDrawContext& context) { int buttonCount = this->buttonCount(); int offset = 0; for (int i = 0; i < buttonCount; ++i) { Icon icon = buttonIcon(context.tree, i); Rect iconRect(context.widgetRect.right() - BUTTON_SIZE * buttonCount + offset, context.widgetRect.top(), BUTTON_SIZE, context.widgetRect.height()); context.drawIcon(iconRect, icon, userReadOnly() ? ICON_DISABLED : ICON_NORMAL); offset += BUTTON_SIZE; } int iconSpace = offset ? offset + 2 : 0; if(multiValue()) context.drawEntry(context.widgetRect, " ... ", false, userReadOnly(), iconSpace); else if(userReadOnly()) context.drawValueText(pulledSelected(), valueAsString().c_str()); else context.drawEntry(context.widgetRect, valueAsString().c_str(), usePathEllipsis(), false, iconSpace); }
listMemberDialog::listMemberDialog(QWidget *parent,QString classId) { conn = database::connectByC(); QVBoxLayout *topLeftLayout = new QVBoxLayout; view = new QTableView(this); model = new QStandardItemModel(this); view->setModel(model); model->setHorizontalHeaderItem(0, new QStandardItem(tr("ID"))); model->setHorizontalHeaderItem(1, new QStandardItem(tr("Name"))); model->setHorizontalHeaderItem(2, new QStandardItem(tr("Birth year"))); model->setHorizontalHeaderItem(3, new QStandardItem(tr("Note"))); model->setHorizontalHeaderItem(4, new QStandardItem(tr("-"))); view->setColumnWidth(0,20); view->setColumnWidth(1,90); view->setColumnWidth(2,57); view->setColumnWidth(3,40); view->setColumnWidth(4,30); label = new QLabel("Member list"); topLeftLayout->addWidget(label); int rowCurrent = 0; MYSQL_RES *res = database::classMember_searchClassId(conn,classId); while(MYSQL_ROW classMemberRow = mysql_fetch_row(res)) { QString memberId = classMemberRow[1]; MYSQL_ROW memberRow = database::member_searchMemberId(conn,memberId); model->setItem(rowCurrent, 0, new QStandardItem(memberRow[0])); model->setItem(rowCurrent, 1, new QStandardItem(memberRow[1])); model->setItem(rowCurrent, 2, new QStandardItem(memberRow[2])); model->setItem(rowCurrent, 3, new QStandardItem(memberRow[3])); QPushButton *button = new QPushButton(""); QPixmap pixmap("Resources/Delete_icon.png"); QIcon buttonIcon(pixmap); button->setIcon(buttonIcon); QSignalMapper *signalMapper = new QSignalMapper(this); signalMapper->setMapping(button,memberId); QObject::connect(button,SIGNAL(clicked()),signalMapper,SLOT(map())); QObject::connect(signalMapper,SIGNAL(mapped(QString)),this,SLOT(deleteMemberAction(QString))); view->setIndexWidget(model->index(rowCurrent,4),button); rowCurrent++; } numOldMemberInDialog = rowCurrent; topLeftLayout->addWidget(view); QHBoxLayout *horizontalLayout = new QHBoxLayout(); QPushButton *saveButton = new QPushButton("Save"); QPixmap pixmap1("Resources/save_icon.png"); QIcon ButtonIcon1(pixmap1); saveButton->setIcon(ButtonIcon1); QSignalMapper *saveMapper = new QSignalMapper(this); saveMapper->setMapping(saveButton,classId); QObject::connect(saveButton,SIGNAL(clicked()),saveMapper,SLOT(map())); QObject::connect(saveMapper,SIGNAL(mapped(QString)),this,SLOT(saveListAction(QString))); horizontalLayout->addWidget(saveButton); QPushButton *addMemberButton = new QPushButton("Add Member"); QPixmap pixmap("Resources/add-icon.png"); QIcon ButtonIcon(pixmap); addMemberButton->setIcon(ButtonIcon); QObject::connect(addMemberButton,SIGNAL(clicked()),this,SLOT(addMemberAction())); horizontalLayout->addWidget(addMemberButton); setLayout(topLeftLayout); topLeftLayout->addLayout(horizontalLayout); setWindowTitle(tr("Member list")); setFixedHeight(sizeHint().height()); }
void QWaylandMaterialDecoration::paint(QPaintDevice *device) { const QRect frameGeometry = window()->frameGeometry(); QRect top(QPoint(WINDOW_BORDER, WINDOW_BORDER), QSize(frameGeometry.width(), margins().top())); QPainter p(device); p.setRenderHint(QPainter::Antialiasing); // Title bar int radius = waylandWindow()->isMaximized() ? 0 : dp(3); QPainterPath roundedRect; roundedRect.addRoundedRect(0, 0, frameGeometry.width(), margins().top() * 1.5, radius, radius); p.fillPath(roundedRect.simplified(), m_backgroundColor); // Borders QPainterPath borderPath; borderPath.addRect(0, margins().top(), margins().left(), frameGeometry.height() - margins().top()); borderPath.addRect(0, frameGeometry.height() - margins().bottom(), frameGeometry.width(), margins().bottom()); borderPath.addRect(frameGeometry.width() - margins().right(), margins().top(), margins().right(), frameGeometry.height() - margins().bottom()); p.fillPath(borderPath, m_backgroundColor); // Window title QString windowTitleText = window()->title(); if (!windowTitleText.isEmpty()) { if (m_windowTitle.text() != windowTitleText) { m_windowTitle.setText(windowTitleText); m_windowTitle.prepare(); } QRect titleBar = top; titleBar.setLeft(margins().left() + BUTTON_SPACING); titleBar.setRight(minimizeButtonRect().left() - BUTTON_SPACING); p.save(); p.setClipRect(titleBar); p.setPen(m_textColor); QSizeF size = m_windowTitle.size(); int dx = (top.width() - size.width()) / 2; int dy = (top.height() - size.height()) / 2; QFont font = p.font(); font.setBold(true); font.setFamily("Roboto"); p.setFont(font); QPoint windowTitlePoint(top.topLeft().x() + dx, top.topLeft().y() + dy); p.drawStaticText(windowTitlePoint, m_windowTitle); p.restore(); } p.save(); p.setPen(m_iconColor); // Close button QBitmap closeIcon = buttonIcon("window-close"); p.drawPixmap(closeButtonRect(), closeIcon, closeIcon.rect()); // Maximize button if (window()->flags() & Qt::WindowMaximizeButtonHint) { QBitmap maximizeIcon = buttonIcon(waylandWindow()->isMaximized() ? "window-restore" : "window-maximize"); p.drawPixmap(maximizeButtonRect(), maximizeIcon, maximizeIcon.rect()); } // Minimize button if (window()->flags() & Qt::WindowMinimizeButtonHint) { QBitmap minimizeIcon = buttonIcon("window-minimize"); p.drawPixmap(minimizeButtonRect(), minimizeIcon, minimizeIcon.rect()); } p.restore(); }
void QWaylandMaterialDecoration::paint(QPaintDevice *device) { QRect surfaceRect(QPoint(), window()->frameGeometry().size()); QRect top(QPoint(), QSize(window()->frameGeometry().width(), margins().top())); QPainter p(device); p.setRenderHint(QPainter::Antialiasing); // Title bar int radius = waylandWindow()->isMaximized() ? 0 : dp(3); QPainterPath roundedRect; roundedRect.addRoundedRect(0, 0, window()->frameGeometry().width(), margins().top() * 1.5, radius, radius); p.fillPath(roundedRect.simplified(), m_backgroundColor); // Window icon QIcon icon = waylandWindow()->windowIcon(); if (!icon.isNull()) { QPixmap pixmap = icon.pixmap(QSize(128, 128)); QPixmap scaled = pixmap.scaled(22, 22, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); QRectF iconRect(0, 0, 22, 22); p.drawPixmap(iconRect.adjusted(margins().left() + BUTTON_SPACING, 4, margins().left() + BUTTON_SPACING, 4), scaled, iconRect); } // Window title QString windowTitleText = window()->title(); if (!windowTitleText.isEmpty()) { if (m_windowTitle.text() != windowTitleText) { m_windowTitle.setText(windowTitleText); m_windowTitle.prepare(); } QRect titleBar = top; titleBar.setLeft(margins().left() + BUTTON_SPACING + (icon.isNull() ? 0 : 22 + BUTTON_SPACING)); titleBar.setRight(minimizeButtonRect().left() - BUTTON_SPACING); p.save(); p.setClipRect(titleBar); p.setPen(m_textColor); QSizeF size = m_windowTitle.size(); int dx = (top.width() - size.width()) / 2; int dy = (top.height() - size.height()) / 2; QFont font = p.font(); font.setBold(true); font.setFamily("Roboto"); p.setFont(font); QPoint windowTitlePoint(top.topLeft().x() + dx, top.topLeft().y() + dy); p.drawStaticText(windowTitlePoint, m_windowTitle); p.restore(); } p.save(); p.setPen(m_iconColor); // Close button QBitmap closeIcon = buttonIcon("window-close"); p.drawPixmap(closeButtonRect(), closeIcon, closeIcon.rect()); // Maximize button QBitmap maximizeIcon = buttonIcon(waylandWindow()->isMaximized() ? "window-restore" : "window-maximize"); p.drawPixmap(maximizeButtonRect(), maximizeIcon, maximizeIcon.rect()); // Minimize button QBitmap minimizeIcon = buttonIcon("window-minimize"); p.drawPixmap(minimizeButtonRect(), minimizeIcon, minimizeIcon.rect()); p.restore(); }
medAlgorithmPaintToolbox::medAlgorithmPaintToolbox(QWidget *parent ) : medSegmentationAbstractToolBox( parent), m_MinValueImage(0), m_MaxValueImage(500), m_strokeRadius(4), m_strokeLabel(1), m_paintState(PaintState::None) { QWidget *displayWidget = new QWidget(this); this->addWidget(displayWidget); this->setTitle(this->name()); QVBoxLayout * layout = new QVBoxLayout(displayWidget); m_strokeButton = new QPushButton( tr("Paint / Erase") , displayWidget); m_strokeButton->setToolTip(tr("Left-click: Start painting with specified label.\nRight-click: Erase painted voxels.")); m_strokeButton->setCheckable(true); m_magicWandButton = new QPushButton(tr("Magic Wand"), displayWidget); QPixmap pixmap(":medSegmentation/pixmaps/magic_wand.png"); QIcon buttonIcon(pixmap); m_magicWandButton->setIcon(buttonIcon); m_magicWandButton->setToolTip(tr("Magic wand to automatically paint similar voxels.")); m_magicWandButton->setCheckable(true); QHBoxLayout * addRemoveButtonLayout = new QHBoxLayout(); addRemoveButtonLayout->addWidget( m_strokeButton ); addRemoveButtonLayout->addWidget( m_magicWandButton ); layout->addLayout( addRemoveButtonLayout ); QHBoxLayout * brushSizeLayout = new QHBoxLayout(); m_brushSizeSlider = new QSlider(Qt::Horizontal, displayWidget); m_brushSizeSlider->setToolTip(tr("Changes the brush radius.")); m_brushSizeSlider->setValue(this->m_strokeRadius); m_brushSizeSlider->setRange(1, 10); m_brushSizeSlider->hide(); m_brushSizeSpinBox = new QSpinBox(displayWidget); m_brushSizeSpinBox->setToolTip(tr("Changes the brush radius.")); m_brushSizeSpinBox->setValue(this->m_strokeRadius); m_brushSizeSpinBox->setMinimum(1); m_brushSizeSpinBox->setMaximum(10); m_brushSizeSpinBox->hide(); m_brushRadiusLabel = new QLabel(tr("Brush Radius"), displayWidget); m_brushRadiusLabel->hide(); connect(m_brushSizeSpinBox, SIGNAL(valueChanged(int)),m_brushSizeSlider,SLOT(setValue(int)) ); connect(m_brushSizeSlider,SIGNAL(valueChanged(int)),m_brushSizeSpinBox,SLOT(setValue(int)) ); brushSizeLayout->addWidget(m_brushRadiusLabel); brushSizeLayout->addWidget( m_brushSizeSlider ); brushSizeLayout->addWidget( m_brushSizeSpinBox ); layout->addLayout( brushSizeLayout ); QHBoxLayout * magicWandLayout = new QHBoxLayout(); m_wandThresholdSizeSlider = new QSlider(Qt::Horizontal, displayWidget); m_wandThresholdSizeSlider->setValue(100); m_wandThresholdSizeSlider->setMinimum(0); m_wandThresholdSizeSlider->setMaximum(1000); m_wandThresholdSizeSlider->hide(); m_wandThresholdSizeSpinBox = new QDoubleSpinBox(displayWidget); m_wandThresholdSizeSpinBox->setMinimum(0); m_wandThresholdSizeSpinBox->setMaximum(1000000); m_wandThresholdSizeSpinBox->setDecimals(2); m_wandThresholdSizeSpinBox->hide(); this->setWandSpinBoxValue(100); connect(m_wandThresholdSizeSpinBox, SIGNAL(valueChanged(double)),this,SLOT(setWandSliderValue(double)) ); connect(m_wandThresholdSizeSlider,SIGNAL(valueChanged(int)),this,SLOT(setWandSpinBoxValue(int)) ); m_wand3DCheckbox = new QCheckBox (tr("3D"), displayWidget); m_wand3DCheckbox->setCheckState(Qt::Unchecked); m_wand3DCheckbox->hide(); magicWandLayout->addWidget( m_wand3DCheckbox ); magicWandLayout->addWidget( m_wandThresholdSizeSlider ); magicWandLayout->addWidget( m_wandThresholdSizeSpinBox ); layout->addLayout( magicWandLayout ); this->generateLabelColorMap(24); QHBoxLayout * labelSelectionLayout = new QHBoxLayout(); m_strokeLabelSpinBox = new QSpinBox(displayWidget); m_strokeLabelSpinBox->setToolTip(tr("Changes the painted label.")); m_strokeLabelSpinBox->setValue(this->m_strokeLabel); m_strokeLabelSpinBox->setMinimum(1); m_strokeLabelSpinBox->setMaximum(24); m_strokeLabelSpinBox->hide(); connect (m_strokeLabelSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setLabel(int))); m_labelColorWidget = new QPushButton(displayWidget); m_labelColorWidget->setToolTip(tr("Current label color")); m_labelColorWidget->setStyleSheet("background-color: rgb(255, 0, 0);border:0;border-radius: 0px;width:20px;height:20px;"); m_labelColorWidget->setCheckable(false); m_labelColorWidget->setText(""); m_labelColorWidget->hide(); connect(m_labelColorWidget, SIGNAL(clicked()), this, SLOT(setLabelColor())); m_colorLabel = new QLabel(tr("Label:"), displayWidget); m_colorLabel->hide(); labelSelectionLayout->addStretch(); labelSelectionLayout->addWidget(m_colorLabel ); labelSelectionLayout->addWidget( m_labelColorWidget ); labelSelectionLayout->addWidget( m_strokeLabelSpinBox ); layout->addLayout( labelSelectionLayout ); m_clearMaskButton = new QPushButton( tr("Clear Mask") , displayWidget); m_clearMaskButton->setToolTip(tr("Resets the mask.")); QHBoxLayout * dataButtonsLayout = new QHBoxLayout(); dataButtonsLayout->addWidget(m_clearMaskButton); layout->addLayout(dataButtonsLayout); connect (m_strokeButton, SIGNAL(pressed()), this, SLOT(activateStroke ())); connect (m_magicWandButton, SIGNAL(pressed()),this,SLOT(activateMagicWand())); connect (m_clearMaskButton, SIGNAL(pressed()), this, SLOT(clearMask())); connect(this->segmentationToolBox(), SIGNAL(inputChanged()), this, SLOT(updateMouseInteraction())); showButtons(false); }
int main(int argc, char **argv) { QApplication app(argc, argv); // Initializing the graph and its container Q3DScatter *graph = new Q3DScatter(); QWidget *container = QWidget::createWindowContainer(graph); //! [0] QSize screenSize = graph->screen()->size(); container->setMinimumSize(QSize(screenSize.width() / 2.25, screenSize.height() / 4)); container->setMaximumSize(screenSize); container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); container->setFocusPolicy(Qt::StrongFocus); //! [1] QWidget *widget = new QWidget; QGroupBox *menuLayout = new QGroupBox; QGroupBox *optionLayout = new QGroupBox; QVBoxLayout *vLayout = new QVBoxLayout(widget); vLayout->addWidget(menuLayout); vLayout->addWidget(container, 1); vLayout->addWidget(optionLayout); //! [1] widget->setWindowTitle(QStringLiteral("CRN Dava Visualization")); //! [4] /* 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(6); QPushButton *labelButton = new QPushButton(widget); labelButton->setText(QStringLiteral("Change label style")); */ int logoHeight = 100, logoWidth = 300; int buttonSize = 100; QGridLayout *gridMenu = new QGridLayout(); QPushButton *taLogoLabel = new QPushButton(); QPushButton *configLabel = new QPushButton(); QPushButton *saveLabel = new QPushButton(); QPushButton *openLabel = new QPushButton(); QPushButton *globeLabel = new QPushButton(); QPixmap taLogoPix("/home/adityarputra/Pictures/placeholder.png"); QIcon taLogoIcon(taLogoPix); QPixmap configPix("/home/adityarputra/Pictures/placeholder.png"); QIcon configIcon(configPix); QPixmap savePix("/home/adityarputra/Pictures/placeholder.png"); QIcon saveIcon(savePix); QPixmap openPix("/home/adityarputra/Pictures/placeholder.png"); QIcon openIcon(openPix); QPixmap globePix("/home/adityarputra/Pictures/placeholder.png"); QIcon globeIcon(globePix); taLogoLabel->setIcon(taLogoIcon); taLogoLabel->setMaximumSize(logoWidth,logoHeight); //taLogoLabel->setText("TA logo label"); configLabel->setIcon(configIcon); configLabel->setMaximumSize(buttonSize,buttonSize); //configLabel->setText("Config Icon"); saveLabel->setIcon(saveIcon); saveLabel->setMaximumSize(buttonSize,buttonSize); //saveLabel->setText("Save Icon"); openLabel->setIcon(openIcon); openLabel->setMaximumSize(buttonSize,buttonSize); //openLabel->setText("Open Icon"); globeLabel->setIcon(globeIcon); globeLabel->setMaximumSize(buttonSize,buttonSize); //globeLabel->setText("Globe Icon"); gridMenu->addWidget(taLogoLabel,0,0); gridMenu->addWidget(configLabel,0,2); gridMenu->addWidget(saveLabel,0,3); gridMenu->addWidget(openLabel,0,4); gridMenu->addWidget(globeLabel,0,5); gridMenu->setColumnStretch(0,300); gridMenu->setRowMinimumHeight(0,100); gridMenu->setColumnStretch(1,100); gridMenu->setColumnStretch(2,100); gridMenu->setColumnStretch(3,100); gridMenu->setColumnStretch(4,100); gridMenu->setColumnStretch(5,100); menuLayout->setLayout(gridMenu); //-----------------------------------// QGridLayout *gridOption = new QGridLayout(); QComboBox *gasTypeCombo = new QComboBox(); QPushButton *rewindButton = new QPushButton(); QPushButton *prevButton = new QPushButton(); QPushButton *startButton = new QPushButton(); QPushButton *nextButton = new QPushButton(); QPushButton *forwardButton = new QPushButton(); QTableWidget *sensorDataTable = new QTableWidget(); QPlainTextEdit *console = new QPlainTextEdit(); sensorDataTable->setRowCount(60); sensorDataTable->setColumnCount(9); QPixmap buttonPix("/home/adityarputra/Pictures/placeholder.png"); QIcon buttonIcon(buttonPix); rewindButton->setIcon(buttonIcon); rewindButton->setMaximumWidth(50); prevButton->setIcon(buttonIcon); prevButton->setMaximumWidth(50); startButton->setIcon(buttonIcon); startButton->setMaximumWidth(50); nextButton->setIcon(buttonIcon); nextButton->setMaximumWidth(50); forwardButton->setIcon(buttonIcon); forwardButton->setMaximumWidth(50); gridOption->addWidget(sensorDataTable,0,6,3,1); gridOption->addWidget(gasTypeCombo,0,0,1,5); gridOption->addWidget(rewindButton,1,0); gridOption->addWidget(prevButton,1,1); gridOption->addWidget(startButton,1,2); gridOption->addWidget(nextButton,1,3); gridOption->addWidget(forwardButton,1,4); gridOption->addWidget(console,2,0,1,5); gridOption->setColumnStretch(0,50); gridOption->setColumnStretch(1,50); gridOption->setColumnStretch(2,50); gridOption->setColumnStretch(3,50); gridOption->setColumnStretch(4,50); gridOption->setColumnStretch(5,50); gridOption->setColumnStretch(6,400); optionLayout->setLayout(gridOption); //----------------------------------To be deleted--------------------------------- /*QCheckBox *smoothCheckBox = new QCheckBox(widget); smoothCheckBox->setText(QStringLiteral("Smooth dots")); smoothCheckBox->setChecked(true); QComboBox *itemStyleList = new QComboBox(widget); itemStyleList->addItem(QStringLiteral("Sphere"), int(QAbstract3DSeries::MeshSphere)); itemStyleList->addItem(QStringLiteral("Cube"), int(QAbstract3DSeries::MeshCube)); itemStyleList->addItem(QStringLiteral("Minimal"), int(QAbstract3DSeries::MeshMinimal)); itemStyleList->addItem(QStringLiteral("Point"), int(QAbstract3DSeries::MeshPoint)); itemStyleList->setCurrentIndex(0); QPushButton *cameraButton = new QPushButton(widget); cameraButton->setText(QStringLiteral("Change camera preset")); QPushButton *itemCountButton = new QPushButton(widget); itemCountButton->setText(QStringLiteral("Toggle item count")); QCheckBox *backgroundCheckBox = new QCheckBox(widget); backgroundCheckBox->setText(QStringLiteral("Show background")); backgroundCheckBox->setChecked(true); QCheckBox *gridCheckBox = new QCheckBox(widget); gridCheckBox->setText(QStringLiteral("Show grid")); gridCheckBox->setChecked(true); 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(4); QFontComboBox *fontList = new QFontComboBox(widget); fontList->setCurrentFont(QFont("Arial"));*/ //---------------------------------------------------------------- // Adding widget to respective layout /* vLayout->addWidget(labelButton, 0, Qt::AlignTop); vLayout->addWidget(cameraButton, 0, Qt::AlignTop); vLayout->addWidget(itemCountButton, 0, Qt::AlignTop); vLayout->addWidget(backgroundCheckBox); vLayout->addWidget(gridCheckBox); vLayout->addWidget(smoothCheckBox, 0, Qt::AlignTop); vLayout->addWidget(new QLabel(QStringLiteral("Change dot style"))); vLayout->addWidget(itemStyleList); 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, 1, Qt::AlignTop); */ //! [5] //! [2] ScatterDataModifier *modifier = new ScatterDataModifier(graph); //! [2] connect(configLabel,SIGNAL(clicked(bool)),this, /* QObject::connect(cameraButton, &QPushButton::clicked, modifier, &ScatterDataModifier::changePresetCamera); QObject::connect(labelButton, &QPushButton::clicked, modifier, &ScatterDataModifier::changeLabelStyle); QObject::connect(itemCountButton, &QPushButton::clicked, modifier, &ScatterDataModifier::toggleItemCount); QObject::connect(backgroundCheckBox, &QCheckBox::stateChanged, modifier, &ScatterDataModifier::setBackgroundEnabled); QObject::connect(gridCheckBox, &QCheckBox::stateChanged, modifier, &ScatterDataModifier::setGridEnabled); QObject::connect(smoothCheckBox, &QCheckBox::stateChanged, modifier, &ScatterDataModifier::setSmoothDots); QObject::connect(modifier, &ScatterDataModifier::backgroundEnabledChanged, backgroundCheckBox, &QCheckBox::setChecked); QObject::connect(modifier, &ScatterDataModifier::gridEnabledChanged, gridCheckBox, &QCheckBox::setChecked); QObject::connect(itemStyleList, SIGNAL(currentIndexChanged(int)), modifier, SLOT(changeStyle(int))); QObject::connect(themeList, SIGNAL(currentIndexChanged(int)), modifier, SLOT(changeTheme(int))); QObject::connect(shadowQuality, SIGNAL(currentIndexChanged(int)), modifier, SLOT(changeShadowQuality(int))); QObject::connect(modifier, &ScatterDataModifier::shadowQualityChanged, shadowQuality, &QComboBox::setCurrentIndex); QObject::connect(graph, &Q3DScatter::shadowQualityChanged, modifier, &ScatterDataModifier::shadowQualityUpdatedByVisual); QObject::connect(fontList, &QFontComboBox::currentFontChanged, modifier, &ScatterDataModifier::changeFont); QObject::connect(modifier, &ScatterDataModifier::fontChanged, fontList, &QFontComboBox::setCurrentFont); */ //! [6] //! [3] widget->show(); return app.exec(); //! [3] }