I worked on a drawing software in 2012-13, but haven't touched it since. Now I'm brushing it up, and it works fine, except a costum dialog that doesn't work anymore.
Many things can have changed, but my search has so far been without result.
Here's the header and cpp-file:

penChooser.h

Qt Code:
  1. #ifndef PENCHOOSER_H
  2. #define PENCHOOSER_H
  3.  
  4. #include <QColorDialog>
  5. #include <QLabel>
  6. #include <QPushButton>
  7. #include <QSpinBox>
  8. #include <QComboBox>
  9. #include <QVBoxLayout>
  10. #include <QGridLayout>
  11.  
  12. class penChooser : public QDialog
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit penChooser(QDialog *parent = nullptr);
  17.  
  18. QColorDialog *colordialog;
  19. QLabel *labWidth;
  20. QSpinBox *sbWidth;
  21. QLabel *labPen;
  22. QComboBox *cbPen;
  23. QPushButton *btnExit;
  24. QPushButton *btnChange;
  25. QGridLayout *buttonLayout;
  26. QVBoxLayout *layout;
  27. signals:
  28.  
  29. public slots:
  30.  
  31. };
  32.  
  33. #endif // PENCHOOSER_H
To copy to clipboard, switch view to plain text mode 
penChooser.cpp

Qt Code:
  1. #include "penchooser.h"
  2.  
  3. penChooser::penChooser(QDialog *parent) :
  4. QDialog(parent)
  5. {
  6.  
  7. colordialog = new QColorDialog();
  8. colordialog->setOption(QColorDialog::NoButtons);
  9.  
  10. labWidth = new QLabel(tr("Pen width:"),this);
  11.  
  12. sbWidth = new QSpinBox(this);
  13. sbWidth->setRange(1,50);
  14. sbWidth->setValue(6);
  15.  
  16. labPen = new QLabel(tr("Pen type:"),this);
  17.  
  18. cbPen = new QComboBox(this);
  19. sl << tr("Standard") << tr("F5 sketching") << tr("F6 User defined")
  20. << tr("F7 User defined") << tr("F8 User defined");
  21. cbPen->addItems(sl);
  22.  
  23. btnExit = new QPushButton(tr("Exit"),this);
  24.  
  25. btnChange = new QPushButton(tr("Change color"),this);
  26.  
  27. buttonLayout = new QGridLayout();
  28. buttonLayout->addWidget(labWidth,0,0);
  29. buttonLayout->addWidget(labPen,0,1);
  30. buttonLayout->addWidget(sbWidth,1,0);
  31. buttonLayout->addWidget(cbPen,1,1);
  32. buttonLayout->addWidget(btnExit,2,0);
  33. buttonLayout->addWidget(btnChange,2,1);
  34.  
  35. layout = new QVBoxLayout();
  36. layout->addWidget(colordialog);
  37. layout->addLayout(buttonLayout);
  38.  
  39. setLayout(layout);
  40. setWindowTitle(tr("Choose Pen color and width"));
  41.  
  42. cbPen->setCurrentIndex(cbPen->findText("Pen"));
  43. sbWidth->setFocus();
  44. }
To copy to clipboard, switch view to plain text mode 
In mainwindow.h you'll find
Qt Code:
  1. penChooser *pc;
To copy to clipboard, switch view to plain text mode 
and in mainwindow.cpp
Qt Code:
  1. void MainWindow::penPick()
  2. {
  3. pc = new penChooser();
  4. pc->colordialog->setCurrentColor(sketchPad->penColor());
  5. pc->sbWidth->setValue(sketchPad->penWidth());
  6. pc->cbPen->setCurrentIndex(0);
  7. pc->setModal(true);
  8. connect(pc->btnExit, SIGNAL(clicked()), this, SLOT(cancelPenPick()));
  9. connect(pc->btnChange, SIGNAL(clicked()), this, SLOT(okPenPick()));
  10. pc->show();
  11. }
To copy to clipboard, switch view to plain text mode 
As said, it worked earlier and used to look like this:
penChooser.jpg

Anyone out there, that can tell me what I'm missing?