I'm just getting started again with c++/Qt working on a project.
I have a class the just lays out a widget with a button and a line edit field.
I'll be creating an instance of this object in another class (mainwindow), and will need to make some connections with the buttons. Is it bad form to make these buttons public? The below works great, solves my problem, but I would rather do it the right way. Or should I just go about creating signals and slots for these objects and make them private? Thanks for advice


Qt Code:
  1. class CustomWidget : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit CustomWidget(QWidget *parent = 0);
  6.  
  7. QPushButton *pushButton;
  8. QLineEdit *lineEdit;
  9. private:
  10. QVBoxLayout *vLayout;
  11. QHBoxLayout *hLayout1;
  12. QHBoxLayout *hLayout2;
  13.  
  14. // QLineEdit *lineEdit;
  15. // QPushButton *pushButton;
  16.  
  17. };
To copy to clipboard, switch view to plain text mode