[Uml-devel] KDE/kdesdk/umbrello/umbrello/dialogs
Andi Fischer
andi.fischer at hispeed.ch
Sun Aug 10 18:52:07 UTC 2008
SVN commit 844851 by fischer:
Replacing all q3 widgets.
M +31 -33 umlwidgetcolorpage.cpp
M +25 -25 umlwidgetcolorpage.h
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlwidgetcolorpage.cpp #844850:844851
@@ -1,5 +1,4 @@
/***************************************************************************
- * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@@ -11,22 +10,21 @@
#include "umlwidgetcolorpage.h"
+#include "optionstate.h"
+#include "umlview.h"
+#include "umlwidget.h"
+
+#include <klocale.h>
+#include <kcolorbutton.h>
+
#include <QtGui/QLayout>
-#include <q3groupbox.h>
+#include <QtGui/QGroupBox>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QCheckBox>
#include <QtGui/QVBoxLayout>
#include <QtGui/QGridLayout>
-#include <klocale.h>
-#include <kcolorbutton.h>
-
-#include "optionstate.h"
-#include "umlview.h"
-#include "umlwidget.h"
-
-
UMLWidgetColorPage::UMLWidgetColorPage( QWidget *pParent, UMLWidget *pWidget ) : QWidget( pParent )
{
m_pUMLWidget = pWidget;
@@ -34,7 +32,7 @@
init();
m_pLineColorB->setColor( pWidget->getLineColor() );
m_pFillColorB->setColor( pWidget->getFillColour() );
- m_pUseFillColorCB->setChecked( pWidget -> getUseFillColour() );
+ m_pUseFillColorCB->setChecked( pWidget->getUseFillColour() );
}
UMLWidgetColorPage::UMLWidgetColorPage( QWidget * pParent, Settings::OptionState *options ) : QWidget( pParent )
@@ -53,36 +51,36 @@
//setup GUI
QVBoxLayout * topLayout = new QVBoxLayout( this );
- topLayout -> setSpacing( 6 );
+ topLayout->setSpacing( 6 );
- m_pColorGB = new Q3GroupBox( i18nc("title of color group", "Color"), this );
- topLayout -> addWidget( m_pColorGB );
+ m_pColorGB = new QGroupBox( i18nc("title of color group", "Color"), this );
+ topLayout->addWidget( m_pColorGB );
QGridLayout * colorLayout = new QGridLayout( m_pColorGB );
- colorLayout -> setMargin( margin );
+ colorLayout->setMargin( margin );
m_pLineColorL = new QLabel( i18nc("line color", "&Line:"), m_pColorGB );
- colorLayout -> addWidget( m_pLineColorL, 0, 0 );
+ colorLayout->addWidget( m_pLineColorL, 0, 0 );
m_pLineColorB = new KColorButton( m_pColorGB );
- colorLayout -> addWidget( m_pLineColorB, 0, 1 );
+ colorLayout->addWidget( m_pLineColorB, 0, 1 );
m_pLineColorL->setBuddy(m_pLineColorB);
m_pLineDefaultB = new QPushButton( i18nc("default line color button", "&Default"), m_pColorGB) ;
- colorLayout -> addWidget( m_pLineDefaultB, 0, 2 );
+ colorLayout->addWidget( m_pLineDefaultB, 0, 2 );
m_pFillColorL = new QLabel( i18n("&Fill:"), m_pColorGB );
- colorLayout -> addWidget( m_pFillColorL, 1, 0 );
+ colorLayout->addWidget( m_pFillColorL, 1, 0 );
m_pFillColorB = new KColorButton( m_pColorGB );
- colorLayout -> addWidget( m_pFillColorB, 1, 1 );
+ colorLayout->addWidget( m_pFillColorB, 1, 1 );
m_pFillColorL->setBuddy(m_pFillColorB);
m_pFillDefaultB = new QPushButton( i18nc("default fill color button", "D&efault"), m_pColorGB );
- colorLayout -> addWidget( m_pFillDefaultB, 1, 2 );
+ colorLayout->addWidget( m_pFillDefaultB, 1, 2 );
m_pUseFillColorCB = new QCheckBox( i18n("&Use fill"), m_pColorGB );
- colorLayout -> setRowStretch( 2, 2 );
- colorLayout -> addWidget( m_pUseFillColorCB, 2, 0 );
+ colorLayout->setRowStretch( 2, 2 );
+ colorLayout->addWidget( m_pUseFillColorCB, 2, 0 );
//connect button signals up
connect( m_pLineDefaultB, SIGNAL( clicked() ), this, SLOT( slotLineButtonClicked() )) ;
@@ -95,29 +93,29 @@
void UMLWidgetColorPage::slotLineButtonClicked()
{
- // UMLView * pView = dynamic_cast<UMLView *>( m_pUMLWidget -> parent() );
- m_pLineColorB -> setColor( Settings::getOptionState().uiState.lineColor );
+ // UMLView * pView = dynamic_cast<UMLView *>( m_pUMLWidget->parent() );
+ m_pLineColorB->setColor( Settings::getOptionState().uiState.lineColor );
}
void UMLWidgetColorPage::slotFillButtonClicked()
{
- // UMLView * pView = dynamic_cast<UMLView *>( m_pUMLWidget -> parent() );
- m_pFillColorB -> setColor( Settings::getOptionState().uiState.fillColor );
+ // UMLView * pView = dynamic_cast<UMLView *>( m_pUMLWidget->parent() );
+ m_pFillColorB->setColor( Settings::getOptionState().uiState.fillColor );
}
void UMLWidgetColorPage::updateUMLWidget()
{
if(m_pUMLWidget)
{
- m_pUMLWidget->setUseFillColour( m_pUseFillColorCB -> isChecked() );
- m_pUMLWidget->setLineColor( m_pLineColorB -> color() );
- m_pUMLWidget->setFillColour( m_pFillColorB -> color() );
+ m_pUMLWidget->setUseFillColour( m_pUseFillColorCB->isChecked() );
+ m_pUMLWidget->setLineColor( m_pLineColorB->color() );
+ m_pUMLWidget->setFillColour( m_pFillColorB->color() );
}
else if(m_options)
{
- m_options->uiState.useFillColor = m_pUseFillColorCB -> isChecked();
- m_options->uiState.lineColor = m_pLineColorB -> color();
- m_options->uiState.fillColor = m_pFillColorB -> color();
+ m_options->uiState.useFillColor = m_pUseFillColorCB->isChecked();
+ m_options->uiState.lineColor = m_pLineColorB->color();
+ m_options->uiState.fillColor = m_pFillColorB->color();
}
}
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlwidgetcolorpage.h #844850:844851
@@ -1,22 +1,20 @@
/***************************************************************************
- * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2002-2006 *
+ * copyright (C) 2002-2008 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
#ifndef UMLWIDGETCOLORPAGE_H
#define UMLWIDGETCOLORPAGE_H
-#include <qwidget.h>
-//Added by qt3to4:
-#include <QLabel>
-#include "../optionstate.h"
+#include "optionstate.h"
+#include <QtGui/QWidget>
+
/**
* @author Paul Hensgen
* Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
@@ -26,59 +24,61 @@
class QLabel;
class QPushButton;
class QCheckBox;
-class Q3GroupBox;
+class QGroupBox;
-class UMLWidgetColorPage : public QWidget {
+class UMLWidgetColorPage : public QWidget
+{
Q_OBJECT
public:
/**
- * Constructor - Observe a UMLWidget
- */
+ * Constructor - Observe a UMLWidget
+ */
UMLWidgetColorPage( QWidget * pParent, UMLWidget * pWidget );
/**
- * Constructor - Observe an OptionState structure
- */
+ * Constructor - Observe an OptionState structure
+ */
UMLWidgetColorPage( QWidget * pParent, Settings::OptionState *options );
/**
- * destructor
- */
+ * destructor
+ */
virtual ~UMLWidgetColorPage();
/**
- * Updates the @ref UMLWidget with the dialog properties.
- */
+ * Updates the @ref UMLWidget with the dialog properties.
+ */
void updateUMLWidget();
public slots:
/**
- * Sets the default line color when default line button
- * clicked.
- */
+ * Sets the default line color when default line button
+ * clicked.
+ */
void slotLineButtonClicked();
/**
- * Sets the default fill color when default fill button
- * clicked.
- */
+ * Sets the default fill color when default fill button
+ * clicked.
+ */
void slotFillButtonClicked();
protected:
/**
- * The widget to set the color for.
- */
+ * The widget to set the color for.
+ */
UMLWidget * m_pUMLWidget;
Settings::OptionState *m_options;
//GUI widgets
- Q3GroupBox * m_pColorGB;
+ QGroupBox * m_pColorGB;
QLabel * m_pLineColorL, * m_pFillColorL;
QCheckBox * m_pUseFillColorCB;
QPushButton * m_pLineDefaultB, * m_pFillDefaultB;
KColorButton * m_pLineColorB, * m_pFillColorB;
+
private:
void init();
More information about the umbrello-devel
mailing list