〔前の画面〕
〔クリックポイント〕 〔最新の一覧〕
〔全て読んだことにする〕〔全て読んだことにして終了〕 〔終了〕
2776 re(5):gnuplot を使おう。 その3 のアドレス変更 |
2014/5/29(木)16:41 - kakuto - 42-150-13-212.rev.home.ne.jp - 2564 hit(s)
松岡> 翻訳の有効化でなにかこつがあれば,教えてください。
おそらく mingw でそのまま使用可能なパッチを投稿します。
パッチとして正しく表示できないでしょうから,
読みとって下さい。
qtgnuplot_fr.qm と qtgnuplot_ja.qm を gnuplot/share/qt
に入れると仮定しています。
デフォルトの graphics system を opengl にしていますが,
そこは適当にして下さい。(あと,raster と native が可)。
--- gnuplot_qt.cpp.origWed Jan 18 05:53:54 2012
+++ gnuplot_qt.cppThu May 29 16:30:59 2014
@@ -45,8 +45,30 @@
#include <QtCore>
#include <signal.h>
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
int main(int argc, char* argv[])
{
+#if defined(_WIN32)
+static char *qt_gnuplot_data_dir = NULL;
+char buff[512];
+char *p;
+
+if(qt_gnuplot_data_dir == NULL) {
+ if(GetModuleFileNameA(NULL, (LPCH) buff, sizeof(buff))) {
+ p = strrchr(buff, '\\');
+ if(p != NULL) {
+ *p = '\0';
+ if(_stricmp(buff + strlen(buff)-4, "\\bin") == 0)
+ *(buff + strlen(buff) - 4) = '\0';
+ strcat(buff, "\\share\\qt");
+ qt_gnuplot_data_dir = _strdup(buff);
+ }
+ }
+}
+#endif
signal(SIGINT, SIG_IGN); // Do not listen to SIGINT signals anymore
#if QT_VERSION < 0x040700
@@ -60,6 +82,13 @@
// This makes a huge difference to the speed of polygon rendering.
// Alternatives are "native", "raster", "opengl"
QApplication::setGraphicsSystem("raster");
+#else
+#if defined(_WIN32)
+p = getenv("QT_GRAPHICSSYSTEM");
+if(p == NULL) {
+ _putenv("QT_GRAPHICSSYSTEM=opengl");
+}
+#endif
#endif
QtGnuplotApplication application(argc, argv);
@@ -71,7 +100,11 @@
// Load translations for the qt terminal
QTranslator translator;
+#if defined(_WIN32)
+translator.load("qtgnuplot_" + QLocale::system().name(), qt_gnuplot_data_dir);
+#else
translator.load("qtgnuplot_" + QLocale::system().name(), QTGNUPLOT_DATA_DIR);
+#endif
application.installTranslator(&translator);
// Start
〔ツリー構成〕
┣【2776】 re(5):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)16:41 kakuto (1890) |
〔前の画面〕
〔クリックポイント〕 〔最新の一覧〕
〔全て読んだことにする〕〔全て読んだことにして終了〕 〔終了〕
※ 『クリックポイント』とは一覧上から読み始めた地点を指し、ツリー上の記事を巡回しても、その位置に戻ることができます.