#include "mainwindow.h" #include <QApplication> #include <QLocale> #include <QTranslator> #include <QPushButton> #include <QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QTranslator translator; const QStringList uiLanguages = QLocale::system().uiLanguages(); for (const QString &locale : uiLanguages) { const QString baseName = "haiQT_" + QLocale(locale).name(); if (translator.load(":/i18n/" + baseName)) { a.installTranslator(&translator); break; } } MainWindow w; // 按钮 QPushButton button1("按钮1", &w); button1.move(55,50); // label QLabel label1("文本...", &w); label1.move(55,80); label1.setText("label 组件"); // 点击按钮关闭标签 QObject::connect( &button1, SIGNAL(clicked()), &label1, SLOT(close()) ); // 关闭窗口 QObject::connect(&button1, SIGNAL(clicked()), &w, SLOT(close())); w.show(); return a.exec(); }
|
{{comment.u_nickname}}
{{comment.u_nickname}} @ {{comment.comments_reply_uname}}
{{comment.comments_date}}
点赞 ({{comment.comments_like_count}})
  回复 ({{comment.comments_reply_count}})
|