Logo Search packages:      
Sourcecode: qcomicbook version File versions  Download package


 * This file is a part of QComicBook.
 * Copyright (C) 2005-2006 Pawel Stolowski <yogin@linux.bydg.org>
 * QComicBook is free software; you can redestribute it and/or modify it
 * under terms of GNU General Public License by Free Software Foundation.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY. See GPL for more details.

#include "pagenumberedit.h"
#include <qvalidator.h>

using namespace QComicBook;

PageNumberEdit::PageNumberEdit(QWidget *parent, int val, int max): QLineEdit(parent)
      validator = new QIntValidator(1, max, this);
      if (val<1)
            val = 1;
      else if (val>max)
            val = max;
      connect(this, SIGNAL(returnPressed()), this, SLOT(onReturn()));


void PageNumberEdit::setMax(int n)

void PageNumberEdit::onReturn()
      emit pageSelected(pageNumber());

int PageNumberEdit::pageNumber() const
      return text().toInt() - 1;

void PageNumberEdit::selectAll()
      //do nothing - just override default QLineEdit behavior

Generated by  Doxygen 1.6.0   Back to index