I'm trying to make a custom QMainWindow. I have this error:
:20: multiple definition of `non-virtual thunk to MainWindow::~MainWindow()'
:15: multiple definition of `MainWindow::~MainWindow()'
:9: first defined here
Works fine for me on Ubuntu with Qt 4.5.2. However there are two bugs in it:
1) You don't allocate memory for saveDialog -> Segmentation fault
2) You don't need to call getSaveFileName and show on saveDialog. getSaveFileName alone is enough.
Try recompiling the complete project (also run qmake), this often removes weird errors.
Thanks! I have another question though. I'm trying to open a program from within my program. I've looked into QProcess, but none of the examples I've tried work.
So you solved the problem by just recompiling the project?
lotios611 wrote:I have another question though. I'm trying to open a program from within my program. I've looked into QProcess, but none of the examples I've tried work.
I have never used QProcess, so I can't tell you much about it. Maybe if you show me your code. "system" would be a very ugly but simple solution.
So you solved the problem by just recompiling the project?
That, and changing the other things you said.
dani93 wrote:
I have never used QProcess, so I can't tell you much about it. Maybe if you show me your code. "system" would be a very ugly but simple solution.
Works perfect for me again. Another reason I don't like Windows... the paths. Although you already corrected the backslashes in the path, I'm quite sure that the spaces are making problems. Don't know how you can avoid such things on Windows, but you could try something like that:
So Windows will interpret it as one command, not as several separated by spaces (I hope...).
BTW: If you only want to open an URL in the default browser you can use QDesktopServices::openUrl (QUrl); You can never be sure that everyone has installed Firefox (even in the same directory?!). Qt was designed to be platform independent. Something like starting a process with a static path destroys everything.