Commit 1c806635 authored by Pino Toscano's avatar Pino Toscano

Make kmplot commit with qt4/kde4.

Drawback: crashes at startup.
Will investigate further tomorrow...

svn path=/trunk/KDE/kdeedu/kmplot/; revision=460717
parent 572c8b97
......@@ -632,7 +632,7 @@ void MainDlg::loadConstants()
if ( tmp_constant == " " || tmp_constant == " ")
return;
constant = tmp_constant.at(0).upper().latin1();
constant = tmp_constant[0].upper().latin1();
if ( constant<'A' || constant>'Z')
constant = 'A';
......
......@@ -426,7 +426,7 @@ void View::drawHeaderTable(QPainter *pDC)
if( m_printHeaderTable )
{
pDC->translate(250., 150.);
pDC->setPen(QPen(black, (int)(5.*s)));
pDC->setPen(QPen(Qt::black, (int)(5.*s)));
pDC->setFont(QFont( Settings::headerTableFont(), 30) );
puts( Settings::headerTableFont().latin1() );
QString minStr = Settings::xMin();
......@@ -454,18 +454,18 @@ void View::drawHeaderTable(QPainter *pDC)
pDC->Linev(700, 0, 230);
pDC->Linev(1100, 0, 230);
pDC->drawText(0, 0, 300, 100, AlignCenter, i18n("Parameters:"));
pDC->drawText(300, 0, 400, 100, AlignCenter, i18n("Plotting Area"));
pDC->drawText(700, 0, 400, 100, AlignCenter, i18n("Axes Division"));
pDC->drawText(1100, 0, 400, 100, AlignCenter, i18n("Printing Format"));
pDC->drawText(0, 100, 300, 65, AlignCenter, i18n("x-Axis:"));
pDC->drawText(0, 165, 300, 65, AlignCenter, i18n("y-Axis:"));
pDC->drawText(300, 100, 400, 65, AlignCenter, alx);
pDC->drawText(300, 165, 400, 65, AlignCenter, aly);
pDC->drawText(700, 100, 400, 65, AlignCenter, atx);
pDC->drawText(700, 165, 400, 65, AlignCenter, aty);
pDC->drawText(1100, 100, 400, 65, AlignCenter, dfx);
pDC->drawText(1100, 165, 400, 65, AlignCenter, dfy);
pDC->drawText(0, 0, 300, 100, Qt::AlignCenter, i18n("Parameters:"));
pDC->drawText(300, 0, 400, 100, Qt::AlignCenter, i18n("Plotting Area"));
pDC->drawText(700, 0, 400, 100, Qt::AlignCenter, i18n("Axes Division"));
pDC->drawText(1100, 0, 400, 100, Qt::AlignCenter, i18n("Printing Format"));
pDC->drawText(0, 100, 300, 65, Qt::AlignCenter, i18n("x-Axis:"));
pDC->drawText(0, 165, 300, 65, Qt::AlignCenter, i18n("y-Axis:"));
pDC->drawText(300, 100, 400, 65, Qt::AlignCenter, alx);
pDC->drawText(300, 165, 400, 65, Qt::AlignCenter, aly);
pDC->drawText(700, 100, 400, 65, Qt::AlignCenter, atx);
pDC->drawText(700, 165, 400, 65, Qt::AlignCenter, aty);
pDC->drawText(1100, 100, 400, 65, Qt::AlignCenter, dfx);
pDC->drawText(1100, 165, 400, 65, Qt::AlignCenter, dfy);
pDC->drawText(0, 300, i18n("Functions:"));
pDC->Lineh(0, 320, 700);
......@@ -593,9 +593,10 @@ void View::mouseMoveEvent(QMouseEvent *e)
QPainter painter(this);
QPen pen(Qt::white, 1, Qt::DotLine);
painter.setRasterOp (Qt::XorROP);
#warning setRasterOp (Qt::XorROP)
// painter.setRasterOp (Qt::XorROP);
painter.setPen(pen);
painter.setBackgroundMode (QPainter::OpaqueMode);
painter.setBackgroundMode (Qt::OpaqueMode);
painter.setBackgroundColor (Qt::blue);
painter.drawRect(rectangle_point.x(), rectangle_point.y(), e->pos().x()-rectangle_point.x(), e->pos().y()-rectangle_point.y());
......@@ -737,7 +738,7 @@ void View::mouseMoveEvent(QMouseEvent *e)
}
else
{
setCursor(arrowCursor);
setCursor(Qt::arrowCursor);
setStatusBar("", 1);
setStatusBar("", 2);
}
......@@ -853,7 +854,7 @@ void View::mousePressEvent(QMouseEvent *e)
}
double const g=tlgy*double(xmax-xmin)/(2*double(ymax-ymin));
if( !m_readonly && e->button()==RightButton) //clicking with the right mouse button
if( !m_readonly && e->button()==Qt::RightButton) //clicking with the right mouse button
{
char function_type;
for( Q3ValueVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it)
......@@ -957,7 +958,7 @@ void View::mousePressEvent(QMouseEvent *e)
}
return;
}
if(e->button()!=LeftButton) return ;
if(e->button()!=Qt::LeftButton) return ;
if(csmode>=0) //disable trace mode if trace mode is enable
{
csmode=-1;
......
......@@ -107,7 +107,7 @@ void CDiagr::Skal( double ex, double ey )
void CDiagr::Plot(QPainter* pDC)
{
QPen pen(frameColor, borderThickness);
QPen pen(QColor(frameColor), borderThickness);
if( g_mode != GRID_NONE )
drawGrid( pDC ); // draw the grid
......@@ -227,7 +227,7 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes
if( Settings::showAxes() )
{
pDC->setPen( QPen( axesColor, axesLineWidth ) );
pDC->setPen( QPen( QColor(axesColor), axesLineWidth ) );
pDC->Lineh(PlotArea.left(), b=Transy(0.), a=PlotArea.right()); // x-Achse
if( Settings::showArrows()) // ARROWS
{ int const dx=40;
......@@ -245,7 +245,7 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes
}
}
pDC->setPen( QPen( axesColor, ticWidth ) );
pDC->setPen( QPen( QColor(axesColor), ticWidth ) );
if( Settings::showAxes() )
{
da=oy-ticLength;
......@@ -328,7 +328,7 @@ void CDiagr::drawGrid( QPainter* pDC )
{
int a, b;
double d, x, y;
QPen pen( gridColor, gridLineWidth );
QPen pen( QColor(gridColor), gridLineWidth );
pDC->setPen(pen);
if( g_mode==GRID_LINES )
......
......@@ -227,6 +227,10 @@
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
......
......@@ -88,7 +88,7 @@ void EditFunction::clearWidgets()
{
// Clear the Function page
editfunctionpage->equation->clear();
editfunctionpage->hide->setChecked( false );
editfunctionpage->hideCheck->setChecked( false );
editfunctionpage->customMinRange->setChecked( false );
editfunctionpage->customMaxRange->setChecked( false );
editfunctionpage->min->clear();
......@@ -115,7 +115,7 @@ void EditFunction::setWidgets()
{
Ufkt *ufkt = &m_parser->ufkt[ m_parser->ixValue(m_id) ];
editfunctionpage->equation->setText( ufkt->fstr );
editfunctionpage->hide->setChecked( !ufkt->f_mode);
editfunctionpage->hideCheck->setChecked( !ufkt->f_mode);
editfunctionpage->lineWidth->setValue( ufkt->linewidth );
editfunctionpage->color->setColor( ufkt->color );
......@@ -272,7 +272,7 @@ void EditFunction::accept()
tmp_ufkt.integral_precision = editintegralpage->precision->value();
tmp_ufkt.integral_linewidth = editintegralpage->lineWidth->value();
tmp_ufkt.f_mode = !editfunctionpage->hide->isChecked();
tmp_ufkt.f_mode = !editfunctionpage->hideCheck->isChecked();
if( editfunctionpage->useSlider->isChecked() )
tmp_ufkt.use_slider = editfunctionpage->listOfSliders->currentItem(); //specify which slider that will be used
......
......@@ -85,7 +85,7 @@ Example: f(x)=x^2</string>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>hide</cstring>
<cstring>hideCheck</cstring>
</property>
<property name="text">
<string>&amp;Hide</string>
......
......@@ -239,6 +239,14 @@
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
<customwidget>
<class>KDoubleNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
......
......@@ -48,7 +48,7 @@ KConstantEditor::KConstantEditor(View *v, QWidget *parent, const char *name)
for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() ;++it)
{
str_value.setNum(it->value);
(void) new Q3ListViewItem(varlist, QChar(it->constant), str_value);
(void) new Q3ListViewItem(varlist, QString(it->constant), str_value);
}
}
......@@ -113,7 +113,7 @@ void KConstantEditor::cmdDelete_clicked()
}
}
delete varlist->findItem(QChar(constant), 0); //removes the item from the constant list
delete varlist->findItem(QString(constant), 0); //removes the item from the constant list
}
void KConstantEditor::varlist_clicked( Q3ListViewItem * item )
......@@ -153,7 +153,7 @@ void KConstantEditor::cmdDuplicate_clicked()
}
}
if (!found)
list.append(QChar(i));
list.append(QString(i));
}
QStringList result = KInputDialog::getItemList(i18n("Choose Name"),i18n("Choose a name for the constant:"),list, QStringList(), false, &found);
if (found)
......@@ -168,7 +168,7 @@ void KConstantEditor::newConstantSlot()
{
double dvalue = m_view->parser()->eval(value);
m_view->parser()->constant.append( Constant(constant, dvalue) );
(void) new Q3ListViewItem(varlist, QChar( constant ), value);
(void) new Q3ListViewItem(varlist, QString( constant ), value);
varlist->sort();
}
......@@ -191,7 +191,7 @@ void KConstantEditor::editConstantSlot()
return;
}
Q3ListViewItem *item = varlist->findItem(QChar(constant), 0);
Q3ListViewItem *item = varlist->findItem(QString(constant), 0);
if (item!=0)
item->setText(1,value);
......
......@@ -38,7 +38,7 @@ KEditConstant::KEditConstant(XParser *p, char &c, QString &v, QWidget *parent, c
if ( constant != '0' )
{
txtConstant->setEnabled(false);
txtConstant->setText(QChar(constant));
txtConstant->setText(QString(constant));
txtValue->setText(value);
txtValue->setFocus();
txtValue->selectAll();
......
......@@ -33,6 +33,7 @@
//Added by qt3to4:
#include <Q3ValueList>
#include <q3listview.h>
#include "kminmax.h"
......@@ -179,7 +180,7 @@ void KMinMax::updateFunctions()
else
cmdFind->setEnabled(true);
selectItem();
Q3ListBoxItem *found_item = list->findItem(selected_item,Qt::ExactMatch);
Q3ListBoxItem *found_item = list->findItem(selected_item,Q3ListView::ExactMatch);
if ( found_item && m_view->csmode < 0)
list->setSelected(found_item,true);
}
......@@ -205,7 +206,7 @@ void KMinMax::selectItem()
function +="\'";
}
//kdDebug() << "function: " << function << endl;
Q3ListBoxItem *item = list->findItem(function,Qt::ExactMatch);
Q3ListBoxItem *item = list->findItem(function,Q3ListView::ExactMatch);
list->setSelected(item,true);
if ( !ufkt->parameters.isEmpty() )
......@@ -275,7 +276,7 @@ void KMinMax::cmdFind_clicked()
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function.at(0) = function.at(0).lower();
function[0] = function[0].lower();
}
QString fname, fstr;
......@@ -369,7 +370,7 @@ void KMinMax::list_highlighted(Q3ListBoxItem* item)
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function.at(0) = function.at(0).lower();
function[0] = function[0].lower();
}
QString const sec_function = function.section('(',0,0);
for(Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it!=m_view->parser()->ufkt.end(); ++it)
......@@ -405,7 +406,7 @@ void KMinMax::cmdParameter_clicked()
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function.at(0) = function.at(0).lower();
function[0] = function[0].lower();
}
QString const sec_function = function.section('(',0,0);
......
......@@ -37,6 +37,7 @@
#include <qfile.h>
#include <qtextstream.h>
#include <q3valuelist.h>
#include <q3listview.h>
#include "kparametereditor.h"
......@@ -289,7 +290,7 @@ void KParameterEditor::varlist_doubleClicked( Q3ListBoxItem * )
bool KParameterEditor::checkTwoOfIt(const QString & text)
{
if ( list->findItem(text,Qt::ExactMatch) == 0)
if ( list->findItem(text,Q3ListView::ExactMatch) == 0)
return false;
else
return true;
......
......@@ -47,7 +47,7 @@
#include "ksliderwindow.h"
KSliderWindow::KSliderWindow(QWidget* parent, int num ) :
SliderWindow( parent, "", false, Qt::WStyle_Tool-Qt::WStyle_Maximize ), m_num(num)
SliderWindow( parent, "", false, (Qt::WFlags)(Qt::WStyle_Tool-Qt::WStyle_Maximize) ), m_num(num)
{
setCaption(i18n( "Slider %1" ).arg( num+1 ) );
QToolTip::add( slider, i18n( "Slider no. %1" ).arg( num+1 ));
......
......@@ -482,6 +482,12 @@ Example: sin(t)</string>
</widget>
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
<sender>buttonOk</sender>
......
......@@ -360,6 +360,12 @@ Example: loop(angle)=ln(angle)</string>
</widget>
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
<sender>buttonOk</sender>
......
......@@ -689,6 +689,12 @@
</widget>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
<sender>radioButton1_4</sender>
......
......@@ -118,6 +118,10 @@
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
......
......@@ -267,6 +267,14 @@
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
<customwidget>
<class>KDoubleNumInput</class>
<header location="local">knuminput.h</header>
</customwidget>
</customwidgets>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment