Visit Jeremy's Blog.
Go Back > Blogs
User Name



Handle segmentation faults in try-catch block

Posted 05-06-2012 at 12:52 AM by rainbowsally
Updated 05-06-2012 at 05:19 AM by rainbowsally (updated code for 32 and also 64 bit arch)

May 6, 2012 (second edit)
Tested 64 bit code (and also 32), corrected close brace in function that got lost in the #if-#else-#endif mixup (with extern "C" close brace)... nevermind. It works now.

  • catch segmentation faults and continue normally

Don't underestimate this concept. We'll be using it in the GUI-Interactive interpreter.

This is a highly simplified version of the SEH for linux experiment posted...
Posted in Uncategorized
Views 1666 Comments 0 rainbowsally is offline

GUI-Interactive: Display a list of QT4 classes

Posted 05-05-2012 at 04:51 AM by rainbowsally
Updated 05-05-2012 at 05:00 AM by rainbowsally

Today's features:
  • A stand alone executable to list all of QT4's classes.
  • A first function for an interactive interpreter for QT funcs and classes
  • Another simple but interesting parse job.

  • the libLQ download (or your own work-alike hack)

We are delving into QT's system for reasons explained in earlier blog entries. When I tried early...
Posted in Uncategorized
Views 431 Comments 0 rainbowsally is offline

QT4 Event preemption: mouse click to get object name

Posted 05-03-2012 at 11:30 AM by rainbowsally
Updated 08-06-2014 at 10:15 AM by rainbowsally

See also the experiment to dump properties.

Now that we have event preemption ability, let's get simple again and create ui application that can tell the name of a widget by clicking on it.

[It's simpler than you think but I have uploaded the sources and makefile in case my description of this process is too complicated or confusing.]
Posted in Uncategorized
Views 597 Comments 0 rainbowsally is offline

GUI Programming: QT4 Event Preeption Part 2-B (temp)

Posted 05-02-2012 at 08:38 PM by rainbowsally

Here's the code to run the examples and create a subclass of QApplication customized for our event preeption test. (See part 2-A)

file: src/utils.h
// utils.h

#ifndef utils_h
#define utils_h

#include <QObject>

// See explanation in utils.cpp
int lq_hash32(const char* name);

// See explanation in utils.cpp
typedef struct 
  int hashid; // computed once
Posted in Uncategorized
Views 435 Comments 0 rainbowsally is offline

GUI Programming: QT4 Event Preeption Part 2-A (temp)

Posted 05-02-2012 at 08:32 PM by rainbowsally
Updated 05-04-2012 at 11:33 AM by rainbowsally (QA check failed ;-))

[Corrected hash algorithm to return -1 for null string (aka "") input. May 4, 2012]

Today's features
  • conditional compilation (OLD_SCHOOL vs. ?)
  • discovery of a potential recursion problem in preemptive event handling (QTextEdit)

This example is complicated enough to be but actually is not quite ready for prime time, but I do want to point out the advantage of creating hash values for speeding up text searches in tables of data. See the utils.cpp implementation...
Posted in Uncategorized
Views 6305 Comments 2 rainbowsally is offline


All times are GMT -5. The time now is 01:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration