newb_developer
3rd July 2012, 23:10
Hello,
I use the following software: Qt 4.8.1, VC++ 2010, MS Windows, Qt Creator
I prepared the following QWizardPage class:
class AppWizard : public QWizard
{
Q_OBJECT
public:
explicit AppWizard(QWidget *parent = 0);
};
class WelcomePage : public QWizardPage
{
Q_OBJECT
public:
explicit WelcomePage(QWidget *parent = 0);
private:
QLabel *intro_label_1;
QLabel *intro_label_2;
QVBoxLayout *vbox_layout;
QGridLayout *grid_layout;
QLabel *email_label;
QLineEdit *email_edit;
QRegExpValidator *email_validator;
QLabel *password_label;
QLineEdit *password_edit;
QPushButton *login;
QLabel *register_label;
};
WelcomePage::WelcomePage(QWidget *parent) :
QWizardPage(parent)
{
// QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
setTitle("There is title");
setButtonText(QWizard::NextButton, "Another name");
setButtonText(QWizard::CancelButton, "Another cancel");
intro_label_1 = new QLabel("Welcome to software");
intro_label_2 = new QLabel("ółćłćłźźłżż źćźżłźżć.");
email_label = new QLabel("ółłłąął");
email_edit = new QLineEdit(this);
password_label = new QLabel("ddsdfdsffds");
password_edit = new QLineEdit(this);
password_edit->setEchoMode(QLineEdit::Password);
login = new QPushButton();
login->setText("dsfsfsfsfdsf");
login->setMaximumWidth(100);
register_label = new QLabel("dsfdfsdsfdsff");
grid_layout = new QGridLayout(this);
grid_layout->addWidget(intro_label_1, 0, 0);
grid_layout->addWidget(intro_label_2, 1,0);
grid_layout->addWidget(email_label, 2, 0);
grid_layout->addWidget(email_edit, 2, 1);
grid_layout->addWidget(password_label, 3, 0);
grid_layout->addWidget(password_edit, 3, 1);
grid_layout->addWidget(login, 4, 0);
grid_layout->addWidget(register_label, 7, 0);
}
However,the encodings fails. I tried to fix this using:
// QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
Does Qt Creator use UTF-8 as default encoding? Why unicode chars are not displayed correctly in additional class?
Thank you for you attention,
I use the following software: Qt 4.8.1, VC++ 2010, MS Windows, Qt Creator
I prepared the following QWizardPage class:
class AppWizard : public QWizard
{
Q_OBJECT
public:
explicit AppWizard(QWidget *parent = 0);
};
class WelcomePage : public QWizardPage
{
Q_OBJECT
public:
explicit WelcomePage(QWidget *parent = 0);
private:
QLabel *intro_label_1;
QLabel *intro_label_2;
QVBoxLayout *vbox_layout;
QGridLayout *grid_layout;
QLabel *email_label;
QLineEdit *email_edit;
QRegExpValidator *email_validator;
QLabel *password_label;
QLineEdit *password_edit;
QPushButton *login;
QLabel *register_label;
};
WelcomePage::WelcomePage(QWidget *parent) :
QWizardPage(parent)
{
// QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
setTitle("There is title");
setButtonText(QWizard::NextButton, "Another name");
setButtonText(QWizard::CancelButton, "Another cancel");
intro_label_1 = new QLabel("Welcome to software");
intro_label_2 = new QLabel("ółćłćłźźłżż źćźżłźżć.");
email_label = new QLabel("ółłłąął");
email_edit = new QLineEdit(this);
password_label = new QLabel("ddsdfdsffds");
password_edit = new QLineEdit(this);
password_edit->setEchoMode(QLineEdit::Password);
login = new QPushButton();
login->setText("dsfsfsfsfdsf");
login->setMaximumWidth(100);
register_label = new QLabel("dsfdfsdsfdsff");
grid_layout = new QGridLayout(this);
grid_layout->addWidget(intro_label_1, 0, 0);
grid_layout->addWidget(intro_label_2, 1,0);
grid_layout->addWidget(email_label, 2, 0);
grid_layout->addWidget(email_edit, 2, 1);
grid_layout->addWidget(password_label, 3, 0);
grid_layout->addWidget(password_edit, 3, 1);
grid_layout->addWidget(login, 4, 0);
grid_layout->addWidget(register_label, 7, 0);
}
However,the encodings fails. I tried to fix this using:
// QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
Does Qt Creator use UTF-8 as default encoding? Why unicode chars are not displayed correctly in additional class?
Thank you for you attention,