printpanel.cpp Example File
trollprint/printpanel.cpp
#include <QtWidgets>
#include "printpanel.h"
PrintPanel::PrintPanel(QWidget *parent)
: QWidget(parent)
{
twoSidedGroupBox = new QGroupBox(tr("2-sided"));
twoSidedEnabledRadio = new QRadioButton(tr("Enabled"));
twoSidedDisabledRadio = new QRadioButton(tr("Disabled"));
twoSidedDisabledRadio->setChecked(true);
colorsGroupBox = new QGroupBox(tr("Colors"));
colorsEnabledRadio = new QRadioButton(tr("Enabled"));
colorsDisabledRadio = new QRadioButton(tr("Disabled"));
colorsDisabledRadio->setChecked(true);
QHBoxLayout *twoSidedLayout = new QHBoxLayout;
twoSidedLayout->addWidget(twoSidedEnabledRadio);
twoSidedLayout->addWidget(twoSidedDisabledRadio);
twoSidedGroupBox->setLayout(twoSidedLayout);
QHBoxLayout *colorsLayout = new QHBoxLayout;
colorsLayout->addWidget(colorsEnabledRadio);
colorsLayout->addWidget(colorsDisabledRadio);
colorsGroupBox->setLayout(colorsLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(twoSidedGroupBox);
mainLayout->addWidget(colorsGroupBox);
setLayout(mainLayout);
}