Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Slots | Protected Attributes
ScInputDialog Class Reference

A QInputDialog clone with MSpinBox widget. More...

#include <scinputdialog.h>

List of all members.

Public Member Functions

 ScInputDialog (QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~ScInputDialog ()

Static Public Member Functions

static double getDouble (const QString &caption, const QString &label, double num=0, double from=-2147483647, double to=2147483647, int decimals=1, QString suffix="", bool *ok=0, QWidget *parent=0, const char *name=0)

Public Attributes

QLabel * entryLabel
MSpinBox * entrySpin
QPushButton * buttonOk
QPushButton * buttonCancel

Protected Slots

virtual void languageChange ()

Protected Attributes

QGridLayout * ScInputDialogLayout
QVBoxLayout * mainLayout
QHBoxLayout * labelEntryLayout
QHBoxLayout * buttonLayout

Detailed Description

A QInputDialog clone with MSpinBox widget.

Author:
Petr Vanek petr@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo

Definition at line 26 of file scinputdialog.h.


Constructor & Destructor Documentation

ScInputDialog::ScInputDialog ( QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0 
)

Definition at line 19 of file scinputdialog.cpp.

       : QDialog( parent, name, modal, fl )
{
       if ( !name )
              setName( "ScInputDialog" );
       setSizeGripEnabled( TRUE );
       ScInputDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ScInputDialogLayout");

       labelEntryLayout = new QHBoxLayout( 0, 0, 6, "labelEntryLayout");

       entryLabel = new QLabel( this, "entryLabel" );
       labelEntryLayout->addWidget( entryLabel );

       entrySpin = new MSpinBox( this, "entrySpin" );
       entrySpin->setMinimumSize( QSize( 0, 10 ) );
       labelEntryLayout->addWidget( entrySpin );

       buttonLayout = new QHBoxLayout(0, 0, 6, "buttonLayout");
       QSpacerItem* hspacing = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
       buttonLayout->addItem(hspacing);

       buttonOk = new QPushButton( this, "buttonOk" );
       buttonOk->setAutoDefault( TRUE );
       buttonOk->setDefault( TRUE );
       buttonLayout->addWidget( buttonOk );

       buttonCancel = new QPushButton( this, "buttonCancel" );
       buttonCancel->setAutoDefault( TRUE );
       buttonLayout->addWidget( buttonCancel );

       mainLayout = new QVBoxLayout(0, 0, 6, "mainLayout");
       mainLayout->addLayout(labelEntryLayout);
       mainLayout->addLayout(buttonLayout);

       ScInputDialogLayout->addLayout( mainLayout, 0, 0 );
       languageChange();
       //resize( QSize(283, 60).expandedTo(minimumSizeHint()) );
       clearWState( WState_Polished );

       // signals and slots connections
       connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
       connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 32 of file scinputdialog.h.

{};

Member Function Documentation

double ScInputDialog::getDouble ( const QString &  caption,
const QString &  label,
double  num = 0,
double  from = -2147483647,
double  to = 2147483647,
int  decimals = 1,
QString  suffix = "",
bool ok = 0,
QWidget *  parent = 0,
const char *  name = 0 
) [static]

Definition at line 73 of file scinputdialog.cpp.

{
       ScInputDialog *dlg = new ScInputDialog(parent, name, TRUE);
       dlg->setCaption( caption );
       dlg->entryLabel->setText(label);
       dlg->entrySpin->setValues(0.0, 1000.0, decimals, num);
       dlg->entrySpin->setSuffix(suffix);
       dlg->entrySpin->selectAll();

       bool accepted = ( dlg->exec() == QDialog::Accepted );
       if ( ok )
              *ok = accepted;

       double result = dlg->entrySpin->value();

       delete dlg;
       return result;
}

Here is the call graph for this function:

void ScInputDialog::languageChange ( ) [protected, virtual, slot]

Definition at line 63 of file scinputdialog.cpp.

{
       setCaption( tr( "Input Dialog" ) );
       entryLabel->setText( tr( "InputDialog" ) );
       buttonOk->setText( tr( "&OK" ) );
       buttonOk->setAccel( QKeySequence( QString::null ) );
       buttonCancel->setText( tr( "&Cancel" ) );
       buttonCancel->setAccel( QKeySequence( QString::null ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 37 of file scinputdialog.h.

QHBoxLayout* ScInputDialog::buttonLayout [protected]

Definition at line 48 of file scinputdialog.h.

Definition at line 36 of file scinputdialog.h.

Definition at line 32 of file scinputdialog.h.

Definition at line 35 of file scinputdialog.h.

QHBoxLayout* ScInputDialog::labelEntryLayout [protected]

Definition at line 47 of file scinputdialog.h.

QVBoxLayout* ScInputDialog::mainLayout [protected]

Definition at line 46 of file scinputdialog.h.

QGridLayout* ScInputDialog::ScInputDialogLayout [protected]

Definition at line 45 of file scinputdialog.h.


The documentation for this class was generated from the following files: