[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Mon Sep 24 21:09:58 CEST 2007
SVN commit 716480 by treat:
* Revamp the dialog class to provide custom areas.
* Get ready to move edit multiple skeleton over.
A datadialog.cpp [License: GPL (v2+)]
A datadialog.h [License: GPL (v2+)]
M +19 -0 dialog.cpp
M +5 -0 dialog.h
M +89 -33 dialog.ui
M +2 -0 libkstapp.pro
M +2 -6 vectordialog.cpp
M +2 -2 vectordialog.h
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.cpp #716479:716480
@@ -57,6 +57,25 @@
}
+QWidget *Dialog::leftCustomWidget() const {
+ return _leftCustom;
+}
+
+
+QWidget *Dialog::rightCustomWidget() const {
+ return _rightCustom;
+}
+
+
+QWidget *Dialog::topCustomWidget() const {
+ return _topCustom;
+}
+
+
+QWidget *Dialog::bottomCustomWidget() const {
+ return _bottomCustom;
+}
+
void Dialog::selectPageForItem(QListWidgetItem *item) {
if (_itemHash.contains(item))
_stackedWidget->setCurrentWidget(_itemHash.value(item));
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.h #716479:716480
@@ -42,6 +42,11 @@
protected:
void setVisible(bool visible);
+ QWidget *leftCustomWidget() const;
+ QWidget *rightCustomWidget() const;
+ QWidget *topCustomWidget() const;
+ QWidget *bottomCustomWidget() const;
+
private Q_SLOTS:
void selectPageForItem(QListWidgetItem *item);
void buttonClicked(QAbstractButton *button);
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.ui #716479:716480
@@ -5,47 +5,103 @@
<rect>
<x>0</x>
<y>0</y>
- <width>400</width>
- <height>300</height>
+ <width>396</width>
+ <height>299</height>
</rect>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <widget class="QSplitter" name="_splitter" >
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <property name="horizontalSpacing" >
+ <number>0</number>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <property name="verticalSpacing" >
+ <number>0</number>
</property>
- <property name="childrenCollapsible" >
- <bool>false</bool>
- </property>
- <widget class="QListWidget" name="_listWidget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QStackedWidget" name="_stackedWidget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="currentIndex" >
- <number>-1</number>
- </property>
- </widget>
- </widget>
+ <item row="0" column="0" colspan="3" >
+ <widget class="QWidget" native="1" name="_topCustom" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QWidget" native="1" name="_leftCustom" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSplitter" name="_splitter" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="childrenCollapsible" >
+ <bool>false</bool>
+ </property>
+ <widget class="QListWidget" name="_listWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QStackedWidget" name="_stackedWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex" >
+ <number>-1</number>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QWidget" native="1" name="_rightCustom" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3" >
+ <widget class="QWidget" native="1" name="_bottomCustom" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
- <item>
+ <item row="1" column="0" >
<widget class="QDialogButtonBox" name="_buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #716479:716480
@@ -25,6 +25,7 @@
axis.cpp \
boxitem.cpp \
builtingraphics.cpp \
+ datadialog.cpp \
datamanager.cpp \
debugdialog.cpp \
debugnotifier.cpp \
@@ -74,6 +75,7 @@
axis.h \
boxitem.h \
builtingraphics.h \
+ datadialog.h \
datamanager.h \
dataref.h \
debugdialog.h \
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.cpp #716479:716480
@@ -28,17 +28,13 @@
VectorDialog::VectorDialog(QWidget *parent)
- : Dialog(parent) {
+ : DataDialog(parent) {
setWindowTitle(tr("New Vector"));
_vectorTab = new VectorTab(this);
// connect(_vectorTab, SIGNAL(apply()), this, SLOT(vectorChanged()));
-
- DialogPage *page = new DialogPage(this);
- page->setPageTitle(tr("Vector"));
- page->addDialogTab(_vectorTab);
- addDialogPage(page);
+ addDataTab(_vectorTab);
}
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.h #716479:716480
@@ -12,7 +12,7 @@
#ifndef VECTORDIALOG_H
#define VECTORDIALOG_H
-#include "dialog.h"
+#include "datadialog.h"
#include "dialogtab.h"
#include "ui_vectortab.h"
@@ -28,7 +28,7 @@
virtual ~VectorTab();
};
-class KST_EXPORT VectorDialog : public Dialog {
+class KST_EXPORT VectorDialog : public DataDialog {
Q_OBJECT
public:
VectorDialog(QWidget *parent = 0);
More information about the Kst
mailing list