I have problem with Qt Dialog constructor.
While creating a window I want to pass some extra variables but I can't simply add them to constructor...
This is automaticly generated code by qt creator.
c'tor in dialog.h
public: explicit Dialog(QWidget *parent=0); ~Dialog();
c'tor in dialog.cpp
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
///code
}
how window is created in main :
Dialog w;
And this is constructor in QDialog documentation :
QDialog ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
My question is, How i can pass extra arguments while creating new object. I tried :
explicit Dialog(QWidget *parent=0,int a, int b);
I also tried to create new ctor by overloading and then call (from initialization list) for this one.
I simply need to pass this to know how many columns and rows user wants to create.
Appreciate any help,
Notes.


Sign In
Create Account


Back to top










