r18758 by craig - Make a new QML directory and install from it. Update QML source to something testable. Change set lib path to add lib path in scpaths for accessing Qt image plugins

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 19 22:55:06 UTC 2014


Author: craig
Date: Sun Jan 19 22:55:06 2014
New Revision: 18758

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18758
Log:
Make a new QML directory and install from it. Update QML source to something testable. Change set lib path to add lib path in scpaths for accessing Qt image plugins

Added:
    trunk/Scribus/scribus/ui/qml/
    trunk/Scribus/scribus/ui/qml/CMakeLists.txt   (with props)
    trunk/Scribus/scribus/ui/qml/qtq_test1.qml
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/menumanager.cpp
    trunk/Scribus/scribus/scpaths.cpp
    trunk/Scribus/scribus/scpaths.h
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18758&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sun Jan 19 22:55:06 2014
@@ -9,6 +9,7 @@
 ADD_SUBDIRECTORY(fonts)
 ADD_SUBDIRECTORY(styles)
 ADD_SUBDIRECTORY(text)
+ADD_SUBDIRECTORY(ui/qml)
 IF(WITH_TESTS)
   ADD_SUBDIRECTORY(tests)
 ENDIF(WITH_TESTS)

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18758&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Sun Jan 19 22:55:06 2014
@@ -350,7 +350,7 @@
 	foreach (const QString &menuName, menuBarMenus.keys())
 	{
 		QMenu *m=menuBarMenus.value(menuName);
-		if (m)
+		if (m && menuStringTexts.contains(menuName))
 			m->setTitle(menuStringTexts[menuName]);
 	}
 }

Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18758&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Sun Jan 19 22:55:06 2014
@@ -55,10 +55,11 @@
 	m_iconDir(ICONDIR),
 	m_libDir(LIBDIR),
 	m_pluginDir(PLUGINDIR),
+	m_qmlDir(QMLDIR),
 	m_sampleScriptDir(SAMPLESDIR),
 	m_scriptDir(SCRIPTSDIR),
-	m_templateDir(TEMPLATEDIR),
-	m_shareDir(SHAREDIR)
+	m_shareDir(SHAREDIR),
+	m_templateDir(TEMPLATEDIR)
 {
 // On MacOS/X, override the compile-time settings with a location
 // obtained from the system.
@@ -73,8 +74,9 @@
 	m_templateDir = QString("%1/Contents/share/scribus/templates/").arg(pathPtr);
 	m_libDir = QString("%1/Contents/lib/scribus/").arg(pathPtr);
 	m_pluginDir = QString("%1/Contents/lib/scribus/plugins/").arg(pathPtr);
-	QApplication::setLibraryPaths(QStringList(QString("%1/Contents/lib/qtplugins/").arg(pathPtr)));
-
+	m_qmlDir = QString("%1/Contents/share/scribus/qml/").arg(pathPtr);
+	//QApplication::setLibraryPaths(QStringList(QString("%1/Contents/lib/qtplugins/").arg(pathPtr)));
+	QApplication::addLibraryPath(QString("%1/Contents/lib/qtplugins/").arg(pathPtr));
 	// on OSX this goes to the sys console, so user only sees it when they care -- AV
 	qDebug() << QString("scpaths: doc dir=%1").arg(m_docDir);
 	qDebug() << QString("scpaths: icon dir=%1").arg(m_iconDir);
@@ -84,6 +86,7 @@
 	qDebug() << QString("scpaths: template dir=%1").arg(m_templateDir);
 	qDebug() << QString("scpaths: lib dir=%1").arg(m_libDir);
 	qDebug() << QString("scpaths: plugin dir=%1").arg(m_pluginDir);
+	qDebug() << QString("scpaths: QML dir=%1").arg(m_qmlDir);
 	qDebug() << QString("scpaths: qtplugins=%1").arg(QApplication::libraryPaths().join(":"));
 
 #elif defined(_WIN32)
@@ -97,6 +100,7 @@
 	m_templateDir = QString("%1/share/templates/").arg(appPath);
 	m_libDir = QString("%1/libs/").arg(appPath);
 	m_pluginDir = QString("%1/plugins/").arg(appPath);
+	m_iconDir = QString("%1/share/qml/").arg(appPath);
 
 	QString qtpluginDir = QString("%1/qtplugins/").arg(appPath);
 	if (QDir(qtpluginDir).exists())
@@ -215,6 +219,11 @@
 	return m_shareDir;
 }
 
+const QString&  ScPaths::qmlDir() const
+{
+	return m_qmlDir;
+}
+
 QString ScPaths::translationDir() const
 {
 	return (m_shareDir + "translations/");

Modified: trunk/Scribus/scribus/scpaths.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18758&path=/trunk/Scribus/scribus/scpaths.h
==============================================================================
--- trunk/Scribus/scribus/scpaths.h (original)
+++ trunk/Scribus/scribus/scpaths.h Sun Jan 19 22:55:06 2014
@@ -48,6 +48,8 @@
 	const QString& templateDir() const;
 	/** @brief Return path to the Scribus share directory */
 	const QString& shareDir() const;
+	/** @brief Return path to the Scribus QML directory */
+	const QString& qmlDir() const;
 
 	/** @brief Return path to the translations directory */
 	QString translationDir() const;
@@ -95,13 +97,14 @@
 
 	// Members to hold system paths
 	QString m_docDir;
+	QString m_fontDir;
 	QString m_iconDir;
-	QString m_fontDir;
 	QString m_libDir;
 	QString m_pluginDir;
+	QString m_qmlDir;
 	QString m_sampleScriptDir;
 	QString m_scriptDir;
+	QString m_shareDir;
 	QString m_templateDir;
-	QString m_shareDir;
 };
 #endif

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18758&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Jan 19 22:55:06 2014
@@ -50,7 +50,10 @@
 #include <QMouseEvent>
 #include <QPixmap>
 #include <QProgressBar>
-//#include <QQuickView>
+//<<QML testing
+#include <QHBoxLayout>
+#include <QQuickView>
+//>>
 #include <QRegExp>
 #include <QStyleFactory>
 #include <QTableWidget>
@@ -11648,22 +11651,21 @@
 	HaveNewSel(-1);
 }
 
-#include <QHBoxLayout>
+
 void ScribusMainWindow::testQTQuick2_1()
 {
 	/*
 	qDebug()<<"Testing Qt Quick 2.0";
 
 	QQuickView qqv;
-
-
 	QDialog d(this);
 	QHBoxLayout *layout = new QHBoxLayout(&d);
 	QWidget *container = createWindowContainer(&qqv, this);
 	d.setMinimumSize(300, 200);
 	d.setMaximumSize(300, 200);
 	d.setFocusPolicy(Qt::TabFocus);
-	qqv.setSource(QUrl::fromLocalFile("//Users/craig/scribus/PostTrunk/trunkqt5/Scribus/scribus/ui/qtq_test1.qml"));
+	qqv.setSource(QUrl::fromLocalFile(ScPaths::instance().qmlDir() + "qtq_test1.qml"));
+
 	layout->addWidget(container);
 	d.exec();
 	*/




More information about the scribus-commit mailing list