[PyQt] problem with mouseDoubleClickEvent on QTreeView 1

laurlaur tmlazarmarius at gmail.com
Sun Jun 21 18:59:44 BST 2009


Just for a better view
Hi,
I'm new in PyQt programing so please have mercy :)
I want to display the directories content and to catch the event
mouseDoubleClickEvent , but it seems that I have some problems chatching
this event. Eventualy if someone have a better ideea how to do this I'm open
to suggestions.
Below is my code. 

import sys
from PyQt4.QtCore import *
from PyQt4.QtNetwork import *
from PyQt4 import QtGui




class miniframe():
    def __init__(self, parent =None):

        self.tree = QtGui.QTreeView()
        self.model = QtGui.QDirModel()
        self.tree.setModel(self.model)
        self.tree.setGeometry(10,750,400,200)
        self.tree.show()

    def mouseDoubleClickEvent(self, event):
        print "event"

if __name__ =="__main__":
    app = QtGui.QApplication(sys.argv)
    x =miniframe()
    x.show()

    sys.exit(app.exec_())
-- 
View this message in context: http://www.nabble.com/problem-with-mouseDoubleClickEvent-on-QTreeView-1-tp24135153p24135153.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list