加载qtbase翻译文件
This commit is contained in:
parent
ea753d25f5
commit
e8211f4a68
|
@ -69,13 +69,6 @@ public:
|
|||
KyEapMethodTtlsInfo ttlsInfo;
|
||||
};
|
||||
|
||||
static void setLineEditMenuPolicy(QFrame *widget) {
|
||||
QList<QLineEdit *> lineEditList = widget->findChildren<QLineEdit *>();
|
||||
for (int i = 0; i < lineEditList.count(); ++i) {
|
||||
lineEditList.at(i)->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
}
|
||||
}
|
||||
|
||||
static void setFramePalette(QFrame *widget, QPalette &pal) {
|
||||
QList<QLineEdit *> lineEditList = widget->findChildren<QLineEdit *>();
|
||||
for (int i = 0; i < lineEditList.count(); ++i) {
|
||||
|
|
|
@ -7,8 +7,6 @@ CreatNetPage::CreatNetPage(QWidget *parent):QFrame(parent)
|
|||
{
|
||||
initUI();
|
||||
initComponent();
|
||||
QList<QLineEdit *> lineEditList = this->findChildren<QLineEdit *>();
|
||||
setLineEditMenuPolicy(this);
|
||||
}
|
||||
|
||||
void CreatNetPage::initUI()
|
||||
|
|
|
@ -12,7 +12,6 @@ DetailPage::DetailPage(bool isWlan, bool isCreate, QWidget *parent)
|
|||
this->setFrameShape(QFrame::Shape::StyledPanel);
|
||||
this->setMaximumWidth(960);
|
||||
initUI();
|
||||
setLineEditMenuPolicy(this);
|
||||
if (isCreate) {
|
||||
connect(mSSIDEdit, &QLineEdit::textEdited, this, &DetailPage::setEnableOfSaveBtn);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ Ipv4Page::Ipv4Page(QWidget *parent):QFrame(parent)
|
|||
{
|
||||
initUI();
|
||||
initComponent();
|
||||
setLineEditMenuPolicy(this);
|
||||
}
|
||||
|
||||
void Ipv4Page::initUI() {
|
||||
|
|
|
@ -5,7 +5,6 @@ Ipv6Page::Ipv6Page(QWidget *parent):QFrame(parent)
|
|||
{
|
||||
initUI();
|
||||
initComponent();
|
||||
setLineEditMenuPolicy(this);
|
||||
}
|
||||
|
||||
void Ipv6Page::setIpv6Config(KyIpConfigType ipv6Config)
|
||||
|
|
|
@ -7,7 +7,6 @@ SecurityPage::SecurityPage(QWidget *parent) : QFrame(parent)
|
|||
{
|
||||
initUI();
|
||||
initConnect();
|
||||
setLineEditMenuPolicy(this);
|
||||
}
|
||||
|
||||
void SecurityPage::initUI()
|
||||
|
|
12
src/main.cpp
12
src/main.cpp
|
@ -31,6 +31,8 @@
|
|||
|
||||
#define LOG_IDENT "ukui_kylin_nm"
|
||||
|
||||
const QString QT_TRANSLATE_FILE = "/usr/share/qt5/translations/qt_zh_CN.qm";
|
||||
|
||||
void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
{
|
||||
QByteArray localMsg = msg.toLocal8Bit();
|
||||
|
@ -109,6 +111,16 @@ int main(int argc, char *argv[])
|
|||
qWarning() << "Translations load fail";
|
||||
}
|
||||
|
||||
QTranslator qtBaseTranslator;
|
||||
qtBaseTranslator.load(QT_TRANSLATE_FILE);
|
||||
if (qtBaseTranslator.load(QT_TRANSLATE_FILE))
|
||||
{
|
||||
a.installTranslator(&qtBaseTranslator);
|
||||
qDebug()<<"QtBase Translations load success";
|
||||
} else {
|
||||
qWarning() << "QtBase Translations load fail";
|
||||
}
|
||||
|
||||
while (!p_networkResource->NetworkManagerIsInited()) {
|
||||
::usleep(1000);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue