Greetings, I'm a bit of a hobbyist programmer in a few languages, and am now finally stepping up to real application developement.
Was giving Qt a shot and I must say its very good for rapid GUI building on linux.

What I'm working on is pretty analogous to an IDE, in that you chose a 'project file' which is read in and sets up the project paths and such.

I'm having issue with a portion of it, in that I can't figure out how to pass information from the project file into a subwindow of the application;
Current code:
Qt Code:
  1. void MainWindow::file_open_project()
  2. {
  3. QString projectFile = QFileDialog::getOpenFileName(
  4. this, tr("Open Project"),
  5. QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
  6. tr("Project files (*.proj)"));
  7. if(!projectFile.isEmpty())
  8. {
  9. load_project(projectFile);
  10. }
  11. }
  12.  
  13. void MainWindow::load_project(QString projectFile)
  14. {
  15. QFileInfo project(projectFile);
  16. QString projectPath = project.absolutePath();
  17. QSettings *projectSettings = new QSettings(projectPath+"/Project", QSettings::IniFormat, this);
  18. this->archiveFile->append(projectSettings->value("Archive").toString());
  19. }
  20.  
  21. void MainWindow::archiveAction()
  22. {
  23. ArchiveEditor *archiveEditor = new ArchiveEditor(this, &archiveFile);
  24. archiveEditor->setAttribute(Qt::WA_DeleteOnClose);
  25. archiveEditor->setAttribute(Qt::WA_ShowModal);
  26. archiveEditor->show();
  27. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. ArchiveEditor::ArchiveEditor(QWidget *parent, QString *file)
  2. :QWidget(parent, Qt::Window)
  3. {
  4. setWindowTitle(tr("Archive Editor"));
  5.  
  6. loadScriptArchive(file);
  7. }
  8.  
  9. void ArchiveEditor::loadArchive(const QString &file)
  10. {
  11. QFile archiveFile = QFile(file);
  12. if (!archiveFile.open(QFile::ReadOnly))
  13. {
  14. QMessageBox::critical(this,
  15. tr("File read error"), tr("Cannot open file: ") + file);
  16. return;
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

ArchiveEditor obviously doesn't do much atm, I'm just trying to figure out how to pass something from the Project.ini file into a subwindow to tell it which archive to load.