logo       

Re: Perl QT: Problem using a custom Qt::Validator with a Qt:LineEdit: msg#00001

Subject: Re: Perl QT: Problem using a custom Qt::Validator with a Qt:LineEdit
It might be a bug. Try this:

sub validate {
   my($string, $pos) = @_;
   print "Validate!\n";

   return this->Acceptable;
}

Ashley Winters

--- Stephan Bosch <sirius@xxxxxxxxxxxxxxxx> wrote:

> Hello,
> 
> I am currently using PerlQt-3.008 (using Qt-3.3.3) for a simple
> design. 
> I am trying to build a custom Validator for a special LineEdit I
> need. I 
> have subclassed the Qt::Validator class with a very much empty 
> validate() method (it simply returns Qt::Validator::Acceptable). 
> However, when I have assigned an instance of the new Validator class
> to 
> my LineEdit, the program crashes with a segfault as soon as the text
> in 
> the LineEdit is edited.
> 
> The new validator class is structured as follows:
> 
> package TestValidator;
> use Qt;
> 
> use Qt::isa qw(Qt::Validator);
> 
> sub NEW {
>    shift->SUPER::NEW($_[0]);
> 
>    print "New validator!\n";
> }
> 
> sub validate {
>    my($string, $pos) = @_;
>    print "Validate!\n";
> 
>    return &Qt::Validator::Acceptable;
> }
> 
> 1;
> 
> The validator is assigned to the LineEdit as follows (where 'this' is
> an 
> instance of Qt::Dialog and edtTest is a Qt::LineEdit):
> 
> my $v = TestValidator( this );
> edtTest->setValidator( $v );
> 
> Upon editing the LineEdit the program crashes as follows:
> 
> New validator!
> Validate!
> Use of uninitialized value in subroutine entry at
> /usr/lib/perl5/Qt.pm 
> line 445.
> Segmentation fault
> 
> Unfortunately the Qt::debug feature does not yield any useful data.
> It 
> simply states that the validate method is called.
> 
> Does any of you know what causes this segfault? Is it a bug or am I 
> doing something wrong? A working perl-Qt example regarding custom 
> validators would be very much appreciated.
> 
> Regards,
> 
> Stephan.
> 
> _______________________________________________
> Kde-perl mailing list
> Kde-perl@xxxxxxx
> https://mail.kde.org/mailman/listinfo/kde-perl
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe