jiveaxe
2nd November 2007, 14:25
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 (http://trolltech.com/developer/downloads/qt/windows) (self-extracting installer).
Then I have recompiled my source; from my experience here are my questions:
Who explains me this strange behaviour?
The folloeing code:
#include <QtGui>
#include <QSqlDatabase>
#include "maindialog.h"
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
MainDialog::MainDialog(QWidget *parent)
:QDialog(parent)
{
...
if(!createConnection())
return;
...
}
bool MainDialog::createConnection()
{
db.setDatabaseName(QApplication::applicationDirPat h() + "/gmc_db");
if (!db.open()) {
QMessageBox::critical(0, qApp->tr("Cannot open database"),
qApp->tr("Unable to establish a database connection.\n"
"This program needs SQLite support. Please read "
"the Qt SQL driver documentation for information how "
"to build it.\n\n"
"Click Cancel to exit."), QMessageBox::Cancel);
return false;
}
return true;
}
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
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
in createConnection() function it works good (in linux works in both situations).
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:
QFont Strings::totalscoreFont()
{
QFont font;
font.setStyleStrategy(QFont::PreferAntialias);
font.setStyleStrategy(QFont::ForceOutline);
font.setPixelSize(60);
font.setBold(true);
font.setFamily("Monofonto");
return font;
}
How can i change it so during compilation under windows it uses different fontfamily and size?
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,
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 (http://trolltech.com/developer/downloads/qt/windows) (self-extracting installer).
Then I have recompiled my source; from my experience here are my questions:
Who explains me this strange behaviour?
The folloeing code:
#include <QtGui>
#include <QSqlDatabase>
#include "maindialog.h"
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
MainDialog::MainDialog(QWidget *parent)
:QDialog(parent)
{
...
if(!createConnection())
return;
...
}
bool MainDialog::createConnection()
{
db.setDatabaseName(QApplication::applicationDirPat h() + "/gmc_db");
if (!db.open()) {
QMessageBox::critical(0, qApp->tr("Cannot open database"),
qApp->tr("Unable to establish a database connection.\n"
"This program needs SQLite support. Please read "
"the Qt SQL driver documentation for information how "
"to build it.\n\n"
"Click Cancel to exit."), QMessageBox::Cancel);
return false;
}
return true;
}
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
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
in createConnection() function it works good (in linux works in both situations).
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:
QFont Strings::totalscoreFont()
{
QFont font;
font.setStyleStrategy(QFont::PreferAntialias);
font.setStyleStrategy(QFont::ForceOutline);
font.setPixelSize(60);
font.setBold(true);
font.setFamily("Monofonto");
return font;
}
How can i change it so during compilation under windows it uses different fontfamily and size?
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,