bbad68
29th January 2010, 18:44
Hey all,
I'm creating a new form (let's call it 'A') that I want to open up another form ('B') that I recently completed. I KNOW that the FAQ talks about something similiar, but to my understanding, it doesnt address my particular problem. So essentially, I have 2 QMainWindows both in seperate directories, and since I'm new, I don't really know how to get one to access the other.
What I initially tried to do was to copy-paste B's .ui, .cpp, and .h files into A's directory, then included them in project A. The problem is that both A and B are QMainWindows (rather than having B as a QDialog as the FAQ implies), and so I get the following error when I try to compile the code:
error C2664: 'Ui_ISocGeneratorClass::setupUi' : cannot convert parameter 1 from 'ISocGenerator *const ' to 'QMainWindow *
Which occurs at the following line:
ui.setupUi(this);
So is there a simple way for me to convert B to a QDialog? What I tried to do was just change the QMainWindow to QDialog in the class constructor (ISocGenerator is what I've referred to as 'B'):
In the .h file
class ISocGenerator : public QDialog
In the class constructor in the .cpp file:
ISocGenerator::ISocGenerator(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
So, judging from the error message, I think that I have to change my ISocGenerator to a QDialog in the actual .ui file, but I don't know how to do that. What can I do?
I'm creating a new form (let's call it 'A') that I want to open up another form ('B') that I recently completed. I KNOW that the FAQ talks about something similiar, but to my understanding, it doesnt address my particular problem. So essentially, I have 2 QMainWindows both in seperate directories, and since I'm new, I don't really know how to get one to access the other.
What I initially tried to do was to copy-paste B's .ui, .cpp, and .h files into A's directory, then included them in project A. The problem is that both A and B are QMainWindows (rather than having B as a QDialog as the FAQ implies), and so I get the following error when I try to compile the code:
error C2664: 'Ui_ISocGeneratorClass::setupUi' : cannot convert parameter 1 from 'ISocGenerator *const ' to 'QMainWindow *
Which occurs at the following line:
ui.setupUi(this);
So is there a simple way for me to convert B to a QDialog? What I tried to do was just change the QMainWindow to QDialog in the class constructor (ISocGenerator is what I've referred to as 'B'):
In the .h file
class ISocGenerator : public QDialog
In the class constructor in the .cpp file:
ISocGenerator::ISocGenerator(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
So, judging from the error message, I think that I have to change my ISocGenerator to a QDialog in the actual .ui file, but I don't know how to do that. What can I do?