[Kstars-devel] KDE/kdeedu/kstars/kstars/widgets

Jason Harris kstars at 30doradus.org
Tue Nov 15 17:11:26 CET 2005


SVN commit 480581 by harris:

Fixes to make widgets directory compile.  It compiles, bt unfortunately, 
it doesn't install the plugin library to the Qt designer plugins 
directory.  Still need to figure this out...

CCMAIL: kstars-devel at kde.org



 M  +16 -14    Makefile.am  
 M  +3 -3      dmsbox.cpp  
 M  +3 -5      dmsbox.h  
 M  +6 -6      kstarsplotwidget.cpp  
 M  +3 -3      kstarsplotwidget.h  
 M  +4 -4      magnitudespinbox.cpp  
 M  +2 -2      magnitudespinbox.h  
 M  +4 -4      timespinbox.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/widgets/Makefile.am #480580:480581
@@ -1,24 +1,26 @@
-noinst_LIBRARIES = libkstarswidgets.a
+INCLUDES = -I$(top_srcdir) $(all_includes)
 
-libkstarswidgets_a_SOURCES = dmsbox.cpp draglistbox.cpp \
-	kstarsplotwidget.cpp magnitudespinbox.cpp \
+lib_LTLIBRARIES = libkstarswidgets.la
+
+libkstarswidgets_la_SOURCES = ../dms.cpp dmsbox.cpp draglistbox.cpp \
+	kstarsplotwidget.cpp magnitudespinbox.cpp mapcanvas.cpp \
 	timespinbox.cpp timestepbox.cpp timeunitbox.cpp 
 
-libkstarswidgets_a_LDFLAGS = $(all_libraries) -no-undefined 
-libkstarswidgets_la_LIBADD  = $(LIB_QTDESIGNER) $(LIB_KIO)
+#libkstarswidgets_a_LDFLAGS = $(all_libraries) -no-undefined 
+#libkstarswidgets_la_LIBADD  = $(LIB_QTDESIGNER) $(LIB_KIO)
 
 AM_CXXFLAGS = -DQT_PLUGIN
-kde_widget_LTLIBRARIES = kdepimwidgets.la
-kdepimwidgets_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
-kdepimwidgets_la_LIBADD = $(LIB_KIO) libkdepim.la
-kdepimwidgets_la_SOURCES = kdepimwidgets.cpp 
+kde_widget_LTLIBRARIES = kstarswidgets.la
+kstarswidgets_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
+kstarswidgets_la_LIBADD = $(LIB_KIO) $(LIB_QTDESIGNER) libkstarswidgets.la
+kstarswidgets_la_SOURCES = kstarswidgets.cpp 
 
-kdepimwidgets.cpp: $(srcdir)/kstars.widgets
-        $(MAKEKDEWIDGETS) -o kstarswidgets.cpp $(srcdir)/kstars.widgets
+kstarswidgets.cpp: $(srcdir)/kstars.widgets
+	$(MAKEKDEWIDGETS) -o kstarswidgets.cpp $(srcdir)/kstars.widgets
 
-kdepimwidgets.lo: kstarswidgets.moc
-kdepimwidgets.moc: kstarswidgets.cpp
-        $(MOC) -o kstarswidgets.moc kstarswidgets.cpp
+kstarswidgets.lo: kstarswidgets.moc
+kstarswidgets.moc: kstarswidgets.cpp
+	$(MOC) -o kstarswidgets.moc kstarswidgets.cpp
 
 CLEANFILES = kstarswidgets.cpp
 
--- trunk/KDE/kdeedu/kstars/kstars/widgets/dmsbox.cpp #480580:480581
@@ -28,8 +28,8 @@
 #include <QWhatsThis>
 #include <QFocusEvent>
 
-dmsBox::dmsBox(QWidget *parent, const char *name, bool dg) 
-	: KLineEdit(parent,name), EmptyFlag(true) {
+dmsBox::dmsBox(QWidget *parent, bool dg) 
+	: KLineEdit(parent), EmptyFlag(true) {
 	setMaxLength(14);
 	setMaximumWidth(160);
 	setDegType( dg );
@@ -114,7 +114,7 @@
 			     "\"12 20\", \"12 20 00.0\", etc.)." ).arg(sDeg).arg(sMin).arg(sSec);
 	}
 
-	setTooltip( sTip );
+	setToolTip( sTip );
 	setWhatsThis( sWhatsThis );
 
 	clear();
--- trunk/KDE/kdeedu/kstars/kstars/widgets/dmsbox.h #480580:480581
@@ -18,11 +18,10 @@
 #ifndef DMSBOX_H
 #define DMSBOX_H
 
+#include <QFocusEvent>
 #include <klineedit.h>
 
-#include "dms.h"
-//Added by qt3to4:
-#include <QFocusEvent>
+#include "../dms.h"
 
 /**@class dmsBox
 	*A KLineEdit which is capable of displaying and parsing angle values
@@ -49,11 +48,10 @@
 public:
 	/**Constructor for the dmsBox object.
 		*@param parent pointer to the parent QWidget
-		*@param ni the name of the object
 		*@param deg if TRUE use deg/arcmin/arcsec; otherwise 
 		*           use hours/min/sec.
 		*/
-	dmsBox(QWidget *parent, const char *ni=0, bool deg=TRUE);
+	dmsBox(QWidget *parent, bool deg=TRUE);
 
 	/**Destructor (empty)*/
 	~dmsBox();
--- trunk/KDE/kdeedu/kstars/kstars/widgets/kstarsplotwidget.cpp #480580:480581
@@ -28,8 +28,8 @@
 
 
 
-KStarsPlotWidget::KStarsPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name )
- : KPlotWidget( x1, x2, y1, y2, parent, name ),
+KStarsPlotWidget::KStarsPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent )
+ : KPlotWidget( x1, x2, y1, y2, parent ),
    dXtick2(0.0), dYtick2(0.0),
    nmajX2(0), nminX2(0), nmajY2(0), nminY2(0),
    XAxisType(DOUBLE), YAxisType(DOUBLE), XAxisType_0(DOUBLE), YAxisType_0(DOUBLE),
@@ -652,8 +652,8 @@
 
 	bool secondaryYLimits( false );
 	if ( dataHeight2() > 0.0 && ( yb() != y() || yb2() != y2() ) ) secondaryYLimits = true;
-	if ( secondaryYLimits && ( ShowTickLabels && ! XAxisLabel2 ) ) return 3*XPADDING;
-	if ( secondaryYLimits && ( ShowTickLabels || ! XAxisLabel2 ) ) return 2*XPADDING;
+	if ( secondaryYLimits && ( ShowTickLabels && ! XAxisLabel2.isEmpty() ) ) return 3*XPADDING;
+	if ( secondaryYLimits && ( ShowTickLabels || ! XAxisLabel2.isEmpty() ) ) return 2*XPADDING;
 	return XPADDING;
 }
 
@@ -662,8 +662,8 @@
 
 	bool secondaryXLimits( false );
 	if ( dataWidth2()  > 0.0 && ( xb() != x() || xb2() != x2() ) ) secondaryXLimits = true;
-	if ( secondaryXLimits && ( ShowTickLabels && ! YAxisLabel2 ) ) return 3*YPADDING;
-	if ( secondaryXLimits && ( ShowTickLabels || ! YAxisLabel2 ) ) return 2*YPADDING;
+	if ( secondaryXLimits && ( ShowTickLabels && ! YAxisLabel2.isEmpty() ) ) return 3*YPADDING;
+	if ( secondaryXLimits && ( ShowTickLabels || ! YAxisLabel2.isEmpty() ) ) return 2*YPADDING;
 	return YPADDING;
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/widgets/kstarsplotwidget.h #480580:480581
@@ -18,9 +18,9 @@
 #ifndef _KSTARSPLOTWIDGET_H_
 #define _KSTARSPLOTWIDGET_H_
 
-#include <qwidget.h>
-//Added by qt3to4:
+#include <QWidget>
 #include <QPixmap>
+
 #include <libkdeedu/kdeeduplot/kplotwidget.h>
 
 #define BIGTICKSIZE 10
@@ -43,7 +43,7 @@
 public:
 /**Constructor
 	*/
-	KStarsPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 );
+	KStarsPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0 );
 
 /**Destructor (empty)
 	*/
--- trunk/KDE/kdeedu/kstars/kstars/widgets/magnitudespinbox.cpp #480580:480581
@@ -17,13 +17,13 @@
 
 #include "magnitudespinbox.h"
 
-MagnitudeSpinBox::MagnitudeSpinBox( QWidget * parent , const char * name )
-	: KDoubleNumInput( 0.0, 10.0, 0.0, 0.1 /*step*/, 1 /*precision*/, parent, name)
+MagnitudeSpinBox::MagnitudeSpinBox( QWidget * parent )
+	: KDoubleNumInput( 0.0, 10.0, 0.0, parent, 0.1 /*step*/, 1 /*precision*/ )
 {
 }
 
 MagnitudeSpinBox::MagnitudeSpinBox( double minValue, double maxValue,
-	QWidget * parent , const char * name )
-	: KDoubleNumInput( minValue, maxValue, minValue, 0.1 /* step */, 1, parent, name)
+	QWidget * parent )
+	: KDoubleNumInput( minValue, maxValue, minValue, parent, 0.1 /* step */, 1 )
 {
 }
--- trunk/KDE/kdeedu/kstars/kstars/widgets/magnitudespinbox.h #480580:480581
@@ -36,11 +36,11 @@
 
 /**Default Constructor.
 	*/
-	MagnitudeSpinBox( QWidget* parent = 0, const char* name = 0);
+	MagnitudeSpinBox( QWidget* parent = 0 );
 
 /**Constructor.  Set minimum and maximum values for the spinbox.
 	*/
-	MagnitudeSpinBox( double minValue, double maxValue, QWidget* parent = 0, const char* name = 0);
+	MagnitudeSpinBox( double minValue, double maxValue, QWidget* parent = 0 );
 };
 
 
--- trunk/KDE/kdeedu/kstars/kstars/widgets/timespinbox.cpp #480580:480581
@@ -40,15 +40,15 @@
 TimeSpinBox::TimeSpinBox( QWidget *parent, const char *name, bool _daysonly )
 	: QSpinBox ( -41, 41, 1 /* step */, parent, name )
 {
-	setValidator( 0 );
+  //	setValidator( 0 );
 	setButtonSymbols( QSpinBox::PlusMinus );
-	editor()->setReadOnly( true );
+	lineEdit()->setReadOnly( true );
 	setValue( 4 ); //1 second (real time)
 	setDaysOnly( _daysonly );
 
 	//Set width:
 	QFontMetrics fm( font() );
-	int extra = width() - editor()->width();
+	int extra = width() - lineEdit()->width();
 	uint wmax = 0;
 	for ( int i=0; i < maxValue(); ++i ) {
 		uint w = fm.width( "-" + TimeString[i] );
@@ -57,7 +57,7 @@
 	setFixedWidth( wmax + extra );
 
 	connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( reportChange() ) );
-	updateDisplay();
+	//	updateDisplay();
 }
 
 void TimeSpinBox::setDaysOnly( bool daysonly ) {


More information about the Kstars-devel mailing list