MCPcopy Create free account
hub / github.com/KDAB/KDChart / SavePdfDialog

Method SavePdfDialog

examples/Gantt/project/mainwindow.cpp:317–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317SavePdfDialog::SavePdfDialog(QWidget *parent)
318 : QDialog(parent)
319{
320 setModal(true);
321 setWindowTitle(tr("Save as PDF"));
322 auto *l = new QVBoxLayout(this);
323 setLayout(l);
324
325 auto *fileLayout = new QHBoxLayout(this);
326 l->addLayout(fileLayout);
327 auto *fileLabel = new QLabel(tr("File:"), this);
328 fileLayout->addWidget(fileLabel);
329 m_fileEdit = new QLineEdit(this);
330 fileLabel->setBuddy(m_fileEdit);
331 m_fileEdit->setText(QFileInfo(QDir::homePath(), "gantt.pdf").absoluteFilePath());
332 fileLayout->addWidget(m_fileEdit);
333 auto *m_fileButton = new QPushButton("...", this);
334 connect(m_fileButton, SIGNAL(clicked()), this, SLOT(fileButtonClicked()));
335 fileLayout->addWidget(m_fileButton);
336
337 m_rowLabels = new QCheckBox(tr("Row Header"), this);
338 m_rowLabels->setChecked(true);
339 l->addWidget(m_rowLabels);
340
341 m_columnLabels = new QCheckBox(tr("Column Header"), this);
342 m_columnLabels->setChecked(true);
343 l->addWidget(m_columnLabels);
344
345 auto *btnBox = new QDialogButtonBox(this);
346 btnBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
347 connect(btnBox, SIGNAL(accepted()), this, SLOT(accept()));
348 connect(btnBox, SIGNAL(rejected()), this, SLOT(reject()));
349 l->addWidget(btnBox);
350
351 resize(QSize(400, 100).expandedTo(minimumSizeHint()));
352}
353
354void SavePdfDialog::fileButtonClicked()
355{

Callers

nothing calls this directly

Calls 2

expandedToMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected