Results 1 to 7 of 7

Thread: Some questions on porting apps to Window$

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    244
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    42
    Thanked 8 Times in 8 Posts

    Default Some questions on porting apps to Window$

    Hi everybody,
    new day new questions; cause some people are yet using gates' OS i am porting my application to this; since my application is 100% QT4.3 dipendent I have downloaded QT/Windows Open Source Edition (self-extracting installer).

    Then I have recompiled my source; from my experience here are my questions:
    1. Who explains me this strange behaviour?
      The folloeing code:
      Qt Code:
      1. #include <QtGui>
      2. #include <QSqlDatabase>
      3. #include "maindialog.h"
      4.  
      5. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
      6.  
      7. MainDialog::MainDialog(QWidget *parent)
      8. :QDialog(parent)
      9. {
      10. ...
      11. if(!createConnection())
      12. return;
      13. ...
      14. }
      15.  
      16. bool MainDialog::createConnection()
      17. {
      18. db.setDatabaseName(QApplication::applicationDirPath() + "/gmc_db");
      19. if (!db.open()) {
      20. QMessageBox::critical(0, qApp->tr("Cannot open database"),
      21. qApp->tr("Unable to establish a database connection.\n"
      22. "This program needs SQLite support. Please read "
      23. "the Qt SQL driver documentation for information how "
      24. "to build it.\n\n"
      25. "Click Cancel to exit."), QMessageBox::Cancel);
      26. return false;
      27. }
      28. return true;
      29. }
      To copy to clipboard, switch view to plain text mode 

      gives error during execution on db.open() (as it can't find the database file, while it exist and is in the same directory as the exe).

      If I move, instead, the row

      Qt Code:
      1. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
      To copy to clipboard, switch view to plain text mode 

      in createConnection() function it works good (in linux works in both situations).
    2. The aspect of the text in the windows version is worst than in linux; it appears bigger and aliased; why? Is related to windows itself or to qt libraries?

      If I have this code:

      Qt Code:
      1. QFont Strings::totalscoreFont()
      2. {
      3. QFont font;
      4. font.setStyleStrategy(QFont::PreferAntialias);
      5. font.setStyleStrategy(QFont::ForceOutline);
      6. font.setPixelSize(60);
      7. font.setBold(true);
      8. font.setFamily("Monofonto");
      9.  
      10. return font;
      11. }
      To copy to clipboard, switch view to plain text mode 

      How can i change it so during compilation under windows it uses different fontfamily and size?
    3. If i want give the compiled exe to my friends they need qt4.3 installed, doesn't they? Or can I include some qt's dll with my code (my application will be licensed under GPL).


    Thanks for helping me,
    Giuseppe CalÃ

  2. The following user says thank you to jiveaxe for this useful post:


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.