Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. Qt 4.8中文显示是不是有问题啊
Forum Updated to NodeBB v4.3 + New Features

Qt 4.8中文显示是不是有问题啊

Scheduled Pinned Locked Moved Chinese
6 Posts 3 Posters 8.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tangming10000
    wrote on last edited by
    #1

    我用Qt4.8创建的控件,上面显示的中文全部重叠到一起去了,英文又显示正常,求解决啊!!!!

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zzjin
      wrote on last edited by
      #2

      能不能有截图或者是代码部分提供参考啊?光是个这个说明没有意义

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leonlee
        wrote on last edited by
        #3

        请提供您的测试代码。谢谢!

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tangming10000
          wrote on last edited by
          #4

          !http://forum.ubuntu.org.cn/download/file.php?id=151277(截图)!
          编译Qt的环境是Scientific Linux 6.1
          代码:
          #include <QtGui/QApplication>
          #include <QTextCodec>
          #include <QPushButton>

          int main(int argc, char argv[])
          {
          QApplication a(argc, argv);
          QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
          QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
          QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
          QPushButton
          b = new QPushButton(tr("退出程序"));
          b->resize(200,100);
          QObject::connect(b,SIGNAL(clicked()),&a,SLOT(quit()));
          b->show();

          return a.exec();
          }

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leonlee
            wrote on last edited by
            #5

            我能显示中文。我使用您的代码。但是,我使用Kubuntu11.04版本。

            !http://www.picpaste.com/pics/testchineseoutput-BWwjeoUQ.1329830627.png(中文显示)!

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tangming10000
              wrote on last edited by
              #6

              KDE下面我也试过,的确没问题

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved