I have a strange problem, I had developed 2 months ago a small project and I started to work on it again.
The problem is that the application starts (as I can click on the stop button in the IDE to kill it). But the windows does not show. No error messages are shown, I tried to launch it outside of the IDE (with all DLLs and platform plugins). But this is the same.
Here is my MainWindow constructor :
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow) {
qDebug() << "R";
ui->setupUi(this);
ui->statusbar->setSizeGripEnabled(false);
recorder = new QAudioRecorder(this);
createTempDir();
this->canProcessData = false;
this->state = WAITING;
this->mode = NONE;
connect(this->recorder, SIGNAL(durationChanged(qint64)),
this, SLOT(updateDuration(qint64)));
connect(this->recorder, SIGNAL(statusChanged(QMediaRecorder::Status)),
this, SLOT(updateStatus(QMediaRecorder::Status)));
connect(this->recorder, SIGNAL(stateChanged(QMediaRecorder::State)),
this, SLOT(onStateChanged(QMediaRecorder::State)));
connect(this->recorder, SIGNAL(error(QMediaRecorder::Error)),
this, SLOT(showError()));
// list settings
foreach(const QString &device, recorder->audioInputs()) {
ui->input_device->addItem(device, QVariant(device));
}
foreach(const QString &codec, recorder->supportedAudioCodecs()) {
ui->codec->addItem(codec, QVariant(codec));
}
foreach(int sample_rate, recorder->supportedAudioSampleRates()) {
ui->sample_rate->addItem(QString::number(sample_rate), QVariant(sample_rate));
}
this->log("Ready :)");
}
Here is main.cpp code:
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
qDebug() << "A";
MainWindow w;
w.setFixedSize(720,455);
w.setWindowFlags(w.windowFlags() |= Qt::MSWindowsFixedSizeDialogHint);
w.show();
return a.exec();
}
As i you can see, I have a qDebug() << "R";
at the first line but it does not even show.
I googled it but obviously all that I could find was topics where it was a DLL problem.
I think its worth mentionning that when I dropped the project 2 months ago I was on the same PC and all the paths (compiler, libraries and Qt) are the same.
I you know something I would be grateful to you.