[Kst] branches/work/kst/portto4/kst/src

Peter Kümmel syntheticpp at gmx.net
Sat Nov 20 23:56:30 CET 2010


SVN commit 1199167 by kuemmel:

also build with Qt 4.4 (openSuse 11.1)

 M  +2 -0      datasources/ascii/asciisourceconfig.cpp  
 M  +11 -0     libkst/datasource.h  
 M  +13 -0     libkst/objectlist.h  
 M  +1 -2      libkstapp/changedatasampledialog.cpp  
 M  +1 -2      libkstapp/changefiledialog.cpp  
 M  +1 -2      libkstapp/choosecolordialog.cpp  
 M  +1 -2      libkstapp/datamanager.cpp  
 M  +1 -2      libkstapp/datawizard.cpp  
 M  +2 -2      libkstapp/legenditem.cpp  
 M  +15 -1     libkstapp/mainwindow.cpp  
 M  +2 -0      libkstapp/mainwindow.h  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisourceconfig.cpp #1199166:1199167
@@ -20,6 +20,8 @@
 
 #include "asciisource.h"
 
+#include <QLocale>
+
 //
 // AsciiSourceConfig
 //
--- branches/work/kst/portto4/kst/src/libkst/datasource.h #1199166:1199167
@@ -287,6 +287,17 @@
       return rc;
     }
 
+#if QT_VERSION < 0x040500
+    void append(const DataSourcePtr& ptr) {
+      QList<DataSourcePtr>::append(ptr);
+    }
+    void append(const DataSourceList& list) {
+      foreach(const DataSourcePtr& ptr, list) {
+        QList<DataSourcePtr>::append(ptr);
+      }
+    }
+#endif
+
 };
 
 
--- branches/work/kst/portto4/kst/src/libkst/objectlist.h #1199166:1199167
@@ -22,6 +22,19 @@
 
 template<class T>
 class ObjectList : public QList<SharedPtr<T> > {
+
+#if QT_VERSION < 0x040500
+public:
+  void append(const SharedPtr<T>& ptr) {
+    QList<SharedPtr<T> >::append(ptr);
+  }
+  void append(const ObjectList& list) {
+    foreach(const SharedPtr<T>& ptr, list) {
+      QList<SharedPtr<T> >::append(ptr);
+    }
+  }
+#endif
+
 };
 
 }
--- branches/work/kst/portto4/kst/src/libkstapp/changedatasampledialog.cpp #1199166:1199167
@@ -27,8 +27,7 @@
   : QDialog(parent) {
    setupUi(this);
 
-   // Make sure the dialog gets maximize and minimize buttons under Windows
-   QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
+  MainWindow::setWidgetFlags(this);
 
    if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
     _store = mw->document()->objectStore();
--- branches/work/kst/portto4/kst/src/libkstapp/changefiledialog.cpp #1199166:1199167
@@ -39,8 +39,7 @@
   : QDialog(parent), _dataSource(0), _requestID(0) {
    setupUi(this);
 
-   // Make sure the dialog gets maximize and minimize buttons under Windows
-   QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
+  MainWindow::setWidgetFlags(this);
 
   if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
     _store = mw->document()->objectStore();
--- branches/work/kst/portto4/kst/src/libkstapp/choosecolordialog.cpp #1199166:1199167
@@ -30,8 +30,7 @@
 
   setupUi(this);
 
-  // Make sure the dialog gets maximize and minimize buttons under Windows
-  QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
+  MainWindow::setWidgetFlags(this);
 
   grid = 0;
 
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.cpp #1199166:1199167
@@ -45,8 +45,7 @@
 
   setupUi(this);
 
-  // Make sure the dialog gets maximize and minimize buttons under Windows
-  QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
+  MainWindow::setWidgetFlags(this);
 
   _session->header()->setResizeMode(QHeaderView::ResizeToContents);
   _session->setModel(doc->session());
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #1199166:1199167
@@ -41,8 +41,7 @@
   : QWizardPage(parent), _pageValid(false), _store(store), _requestID(0) {
    setupUi(this);
 
-   // Make sure the dialog gets maximize and minimize buttons under Windows
-   QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
+  MainWindow::setWidgetFlags(this);
 
    connect(_url, SIGNAL(changed(const QString&)), this, SLOT(sourceChanged(const QString&)));
    connect(_configureSource, SIGNAL(clicked()), this, SLOT(configureSource()));
--- branches/work/kst/portto4/kst/src/libkstapp/legenditem.cpp #1199166:1199167
@@ -404,9 +404,9 @@
   QString name = i18n("Empty Legend");
   if (_auto) {
     name = _plotItem->descriptiveName();
-  } else if (_relations.length()>0) {
+  } else if (_relations.size()>0) {
     name = _relations.at(0)->descriptiveName();
-    if (_relations.length()>1) {
+    if (_relations.size()>1) {
       name += ", ...";
     }
   }
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1199166:1199167
@@ -313,7 +313,7 @@
 void MainWindow::exportGraphicsFile(
     const QString &filename, const QString &format, int width, int height, int display) {
   int viewCount = 0;
-  int n_views = _tabWidget->views().length();
+  int n_views = _tabWidget->views().size();
   foreach (View *view, _tabWidget->views()) {
     QSize size;
     if (display == 0) {
@@ -499,9 +499,11 @@
   setPrinterDefaults(&printer);
 
   QPointer<QPrintDialog> pd = new QPrintDialog(&printer, this);
+#if QT_VERSION >= 0x040500
   pd->setOption(QPrintDialog::PrintToFile);
   pd->setOption(QPrintDialog::PrintPageRange, true);
   pd->setOption(QAbstractPrintDialog::PrintShowPageSize,true);
+#endif
 
   if (pd->exec() == QDialog::Accepted) {
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -1576,6 +1578,18 @@
   settings.setValue("toolbarState", saveState());
 }
 
+void MainWindow::setWidgetFlags(QWidget* widget)
+{
+  if (widget) {
+    // Make sure the dialog gets maximize and minimize buttons under Windows
+    widget->QWidget::setWindowFlags((Qt::WindowFlags) Qt::Dialog |     Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint
+#if QT_VERSION >= 0x040500
+        | Qt::WindowCloseButtonHint
+#endif
+);
 }
+}
 
+}
+
 // vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #1199166:1199167
@@ -56,6 +56,8 @@
     bool isHighlightPoint() { return _highlightPoint; }
     void setStatusMessage(QString message);
 
+    static void setWidgetFlags(QWidget*);
+
   public Q_SLOTS:
     void showDataManager();
     void showDebugDialog();


More information about the Kst mailing list