Hello,
I use the following software: Qt 4.8.1, VC++ 2010, MS Windows, Qt Creator




I prepared the following QWizardPage class:
Qt Code:
  1. class AppWizard : public QWizard
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit AppWizard(QWidget *parent = 0);
  6. };
  7.  
  8.  
  9. class WelcomePage : public QWizardPage
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit WelcomePage(QWidget *parent = 0);
  14. private:
  15. QLabel *intro_label_1;
  16. QLabel *intro_label_2;
  17. QVBoxLayout *vbox_layout;
  18. QGridLayout *grid_layout;
  19. QLabel *email_label;
  20. QLineEdit *email_edit;
  21. QRegExpValidator *email_validator;
  22. QLabel *password_label;
  23. QLineEdit *password_edit;
  24. QPushButton *login;
  25. QLabel *register_label;
  26. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. WelcomePage::WelcomePage(QWidget *parent) :
  2. QWizardPage(parent)
  3. {
  4. // QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
  5. setTitle("There is title");
  6. setButtonText(QWizard::NextButton, "Another name");
  7. setButtonText(QWizard::CancelButton, "Another cancel");
  8.  
  9. intro_label_1 = new QLabel("Welcome to software");
  10. intro_label_2 = new QLabel("ółćłćłźźłżżźćźżłźżć.");
  11. email_label = new QLabel("ółłłąął");
  12. email_edit = new QLineEdit(this);
  13.  
  14. password_label = new QLabel("ddsdfdsffds");
  15. password_edit = new QLineEdit(this);
  16. password_edit->setEchoMode(QLineEdit::Password);
  17. login = new QPushButton();
  18. login->setText("dsfsfsfsfdsf");
  19. login->setMaximumWidth(100);
  20. register_label = new QLabel("dsfdfsdsfdsff");
  21.  
  22. grid_layout = new QGridLayout(this);
  23. grid_layout->addWidget(intro_label_1, 0, 0);
  24. grid_layout->addWidget(intro_label_2, 1,0);
  25. grid_layout->addWidget(email_label, 2, 0);
  26. grid_layout->addWidget(email_edit, 2, 1);
  27. grid_layout->addWidget(password_label, 3, 0);
  28. grid_layout->addWidget(password_edit, 3, 1);
  29. grid_layout->addWidget(login, 4, 0);
  30. grid_layout->addWidget(register_label, 7, 0);
  31. }
To copy to clipboard, switch view to plain text mode 

However,the encodings fails. I tried to fix this using:
Qt Code:
  1. // QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
To copy to clipboard, switch view to plain text mode 

Does Qt Creator use UTF-8 as default encoding? Why unicode chars are not displayed correctly in additional class?

Thank you for you attention,