mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-29 05:49:57 +02:00
The application now uses right-to-left layouts when required by translations through a special, non-displayed translated string.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1518 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -168,6 +168,19 @@ void QETApp::setLanguage(const QString &desired_language) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
installTranslator(&qetTranslator);
|
installTranslator(&qetTranslator);
|
||||||
|
|
||||||
|
QString ltr_special_string = tr(
|
||||||
|
"LTR",
|
||||||
|
"Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR"
|
||||||
|
);
|
||||||
|
if (ltr_special_string == "RTL") switchLayout(Qt::RightToLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Switches the application to the provided layout.
|
||||||
|
*/
|
||||||
|
void QETApp::switchLayout(Qt::LayoutDirection direction) {
|
||||||
|
setLayoutDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class QETApp : public QETSingleApplication {
|
|||||||
public:
|
public:
|
||||||
static QETApp *instance();
|
static QETApp *instance();
|
||||||
void setLanguage(const QString &);
|
void setLanguage(const QString &);
|
||||||
|
void switchLayout(Qt::LayoutDirection);
|
||||||
static void printHelp();
|
static void printHelp();
|
||||||
static void printVersion();
|
static void printVersion();
|
||||||
static void printLicense();
|
static void printLicense();
|
||||||
|
|||||||
Reference in New Issue
Block a user