summaryrefslogtreecommitdiffstats
path: root/PerlTQt/lib/Qt/debug.pm
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-01-01 18:29:30 -0600
committerTimothy Pearson <[email protected]>2012-01-01 18:29:30 -0600
commitb2af005db21bd8fd068cb79b2ae700953128af2c (patch)
treeabd0ed633726bf0bbecb57d30e92836c31e02695 /PerlTQt/lib/Qt/debug.pm
parentc1b9383f2032d82db5eb8918dca885e37a901dde (diff)
downloadlibtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.tar.gz
libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.zip
Move PerlQt
Diffstat (limited to 'PerlTQt/lib/Qt/debug.pm')
-rw-r--r--PerlTQt/lib/Qt/debug.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/PerlTQt/lib/Qt/debug.pm b/PerlTQt/lib/Qt/debug.pm
new file mode 100644
index 0000000..a0f4e19
--- /dev/null
+++ b/PerlTQt/lib/Qt/debug.pm
@@ -0,0 +1,36 @@
+package TQt::debug;
+use TQt;
+
+our %channel = (
+ 'ambiguous' => 0x01,
+ 'autoload' => 0x02,
+ 'calls' => 0x04,
+ 'gc' => 0x08,
+ 'virtual' => 0x10,
+ 'verbose' => 0x20,
+ 'all' => 0xffff
+);
+
+sub import {
+ shift;
+ my $db = (@_)? 0x0000 : (0x01|0x20);
+ my $usage = 0;
+ for my $ch(@_) {
+ if( exists $channel{$ch}) {
+ $db |= $channel{$ch};
+ } else {
+ warn "Unknown debugging channel: $ch\n";
+ $usage++;
+ }
+ }
+ TQt::_internal::setDebug($db);
+ print "Available channels: \n\t".
+ join("\n\t", sort keys %channel).
+ "\n" if $usage;
+}
+
+sub unimport {
+ TQt::_internal::setDebug(0);
+}
+
+1; \ No newline at end of file