From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11385 invoked by alias); 28 Jun 2009 19:14:48 -0000 Received: (qmail 11376 invoked by uid 22791); 28 Jun 2009 19:14:48 -0000 X-SWARE-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.147) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Jun 2009 19:14:42 +0000 Received: by qw-out-1920.google.com with SMTP id 5so1767599qwf.24 for ; Sun, 28 Jun 2009 12:14:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.74.65 with SMTP id t1mr3566710vcj.89.1246216480531; Sun, 28 Jun 2009 12:14:40 -0700 (PDT) Date: Sun, 28 Jun 2009 19:14:00 -0000 Message-ID: <629542d40906281214x73c3b505nfeb7e7eecfb1f708@mail.gmail.com> Subject: Execute code in python pretty printers From: Niko Sams To: gdb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00274.txt.bz2 Hi, I'm writing pretty printers for various Qt classes. For QModelIndex I'd like to show the parent QModelIndex as child. The parent isn't saved in the QModelIndex object direclty - instead QModelIndex asks the model for it's parent. Basically it returns this->model->parent(this). QAbstractItemModel::parent is a virtual function implemented differently in every model. So to find out the parent the method has to be executed. Is this possible? Niko