[QGIS Commit] r9084 - in branches/advanced_printing_branch/src:
app/composer ui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Aug 20 05:10:41 EDT 2008
Author: mhugent
Date: 2008-08-20 05:10:41 -0400 (Wed, 20 Aug 2008)
New Revision: 9084
Modified:
branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp
branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.cpp
branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.h
branches/advanced_printing_branch/src/ui/qgscomposerlabelwidgetbase.ui
Log:
Changed composer label widget to embed composer item widget
Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp 2008-08-20 09:03:14 UTC (rev 9083)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp 2008-08-20 09:10:41 UTC (rev 9084)
@@ -43,6 +43,8 @@
return;
}
+ drawBackground(painter);
+ painter->setPen(QPen(QColor(0, 0, 0))); //draw all text black
painter->setFont(mFont);
QFontMetricsF fontSize(mFont);
Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.cpp 2008-08-20 09:03:14 UTC (rev 9083)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.cpp 2008-08-20 09:10:41 UTC (rev 9084)
@@ -17,24 +17,21 @@
#include "qgscomposerlabelwidget.h"
#include "qgscomposerlabel.h"
+#include "qgscomposeritemwidget.h"
#include <QFontDialog>
#include <QWidget>
QgsComposerLabelWidget::QgsComposerLabelWidget(QgsComposerLabel* label): QWidget(), mComposerLabel(label)
{
setupUi(this);
+
+ //add widget for general composer item properties
+ QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget(this, label);
+ gridLayout->addWidget(itemPropertiesWidget, 5, 0, 1, 2);
+
if(mComposerLabel)
{
mTextEdit->setText(mComposerLabel->text());
- bool frame = mComposerLabel->frame();
- if(frame)
- {
- mBoxCheckBox->setCheckState(Qt::Checked);
- }
- else
- {
- mBoxCheckBox->setCheckState(Qt::Unchecked);
- }
mMarginDoubleSpinBox->setValue(mComposerLabel->margin());
}
}
@@ -62,22 +59,6 @@
}
}
-void QgsComposerLabelWidget::on_mBoxCheckBox_stateChanged(int state)
-{
- if(mComposerLabel)
- {
- if(state == Qt::Checked)
- {
- mComposerLabel->setFrame(true);
- }
- else
- {
- mComposerLabel->setFrame(false);
- }
- mComposerLabel->update();
- }
-}
-
void QgsComposerLabelWidget::on_mMarginDoubleSpinBox_valueChanged(double d)
{
if(mComposerLabel)
Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.h 2008-08-20 09:03:14 UTC (rev 9083)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlabelwidget.h 2008-08-20 09:10:41 UTC (rev 9084)
@@ -34,7 +34,6 @@
public slots:
void on_mTextEdit_textChanged();
void on_mFontButton_clicked();
- void on_mBoxCheckBox_stateChanged(int state);
void on_mMarginDoubleSpinBox_valueChanged(double d);
private:
Modified: branches/advanced_printing_branch/src/ui/qgscomposerlabelwidgetbase.ui
===================================================================
--- branches/advanced_printing_branch/src/ui/qgscomposerlabelwidgetbase.ui 2008-08-20 09:03:14 UTC (rev 9083)
+++ branches/advanced_printing_branch/src/ui/qgscomposerlabelwidgetbase.ui 2008-08-20 09:10:41 UTC (rev 9084)
@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>217</width>
- <height>341</height>
+ <height>274</height>
</rect>
</property>
<property name="sizePolicy" >
@@ -49,35 +49,11 @@
<item row="2" column="1" >
<widget class="QDoubleSpinBox" name="mMarginDoubleSpinBox" />
</item>
- <item row="3" column="0" colspan="2" >
- <widget class="QCheckBox" name="mBoxCheckBox" >
- <property name="text" >
- <string>Box</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0" colspan="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>197</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<tabstops>
<tabstop>mFontButton</tabstop>
- <tabstop>mBoxCheckBox</tabstop>
</tabstops>
<resources/>
<connections/>
More information about the QGIS-commit
mailing list