The same code works under Windows and fails under GNU/Linux
-
Ohhhh i apologies for too many abbreviations in my writing.
[quote author="Volker" date="1298556541"][quote author="vishwajeet" date="1298555161"]
Problem seems simple here i guess, its just you have to check the difference between win and Linux in terms of main() code execution, max u might have to go 1 layer down but that should resolve ur problem. [/quote][Highlighting by me]
Can you please use correct english in your writings. It's hard to read these non obvious abbreviations, especially for non-native speakers. This is neither Twitter nor SMS, we do have far more than 140 available :-) so no need to confuse people.
[/quote]To jerome.bouat
Could you please check if @MyApp app(argc,argv);
return app.exec(); // event loop@ is getting executed in case of windows and Linux ? -
The below code fragment is being executed
on Windows (because the application works properly)
and Linux (because I don't get the error if I comment it) :
@MyApp app(argc,argv);
return app.exec(); // event loop@I moved the GUI initialization in a separate method (createWindow) :
@class MyApp : public QApplication{
private:
Q_OBJECT
public:
bool tested;
QString program;
streambuf *coutbuf;
virtual ~MyApp();
// empty, just call super class constructor
// and initialize object attributesMyApp(int &,char **);
void createWindow(int &,char **);
};@
Into this new method, I don't get the error message
if I comment the "show()" call
@void MyApp::createWindow(int &argc,char **argv){
MainWindow *mainWindow = new MainWindow(argc,argv);
mainWindow->show(); // no error if commented
}@
Thus, the issue seems to be located into the super-super class method QWidget::show().
-
No way to analyze this here. Can you please:
- make a small test case
- put it into a complete project
- make sure it compiles, runs and shows the error
- put the sources (and only these) into a ZIP
- put the ZIP on dropbox, pastebin or make it available somewhere else
- post the link here
-
It seems to be an OpenGL issue but the error message I reported is far from that.
I'm investigating.
-
Just a Qt newbie question : I assume that all calls like below should be located into header files only and not cpp files :
@QObject::connect(scrollBar, SIGNAL(valueChanged(int)), label, SLOT(setNum(int)));@
?Or could we possibly use this call into cpp files by including the right Qt file ?
-
I assume the "emit" keyword can be used in cpp files ?