473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

thumbnails in Qfilediloug using pyqt

14 New Member
hey folks;

i am working on my program using python and PYQT that is suppose to load digital photos into the main interface of my program and perform few action on them. i have here the codes that will prompt me to brows to the system directory and show the system files and any other files. any way the codes here deal only with text files and loads only one file at the time. my question how can i alter the code to deal with digital photos and be able to load photos to the system in thumbnails.


thanks in advance

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python
  2.  
  3. # openfiledialog.py
  4.  
  5. import sys
  6. from PyQt4 import QtGui
  7. from PyQt4 import QtCore
  8.  
  9.  
  10. class OpenFile(QtGui.QMainWindow):
  11.     def __init__(self, parent=None):
  12.         QtGui.QMainWindow.__init__(self, parent)
  13.  
  14.         self.setGeometry(300, 300, 350, 300)
  15.         self.setWindowTitle('OpenFile')
  16.  
  17.         self.textEdit = QtGui.QTextEdit()
  18.         self.setCentralWidget(self.textEdit)
  19.         self.statusBar()
  20.         self.setFocus()
  21.  
  22.         exit = QtGui.QAction(QtGui.QIcon('open.png'), 'Open', self)
  23.         exit.setShortcut('Ctrl+O')
  24.         exit.setStatusTip('Open new File')
  25.         self.connect(exit, QtCore.SIGNAL('triggered()'), self.showDialog)
  26.  
  27.         menubar = self.menuBar()
  28.         file = menubar.addMenu('&File')
  29.         file.addAction(exit)
  30.  
  31.     def showDialog(self):
  32.         filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',
  33.                     '/home')
  34.         file=open(filename)
  35.         data = file.read()
  36.         self.textEdit.setText(data)
  37.  
  38. app = QtGui.QApplication(sys.argv)
  39. cd = OpenFile()
  40. cd.show()
  41. app.exec_()
Dec 12 '08 #1
1 2963
QwertyManiac
2 New Member
On Windows and Mac, QFileDialog generally starts up the native File dialog, in which these features are present. The same is also possible for GNOME when using QGtkStyle.

There, however, is no direct way to implement the file previewer in Qt 4.4. You may look at the Qt 3 support classes Q3FilePreview and Q3FileDialog both to implement this.
Dec 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2861
by: Ilya Knizhnik | last post by:
Dear All, I am fairly new to Python. I have found it an easy language to learn and a very usefull one for many tasks. Currently I am working on a python project that involves a GUI and it was suggested that PyQt is the best way to design that GUI. However since PyQt is rather new, I have not found much documentation on it, or examples in it. The only useful tutorial/book I have found is at www.opendocspublishing.com/pyqt/ but it is...
35
7767
by: Vamsi Mudrageda | last post by:
I am kind of new to Python, and after trying and using wxPython, I found it kind of lacking in easy-to-read documentation, speed at loading, and GUI response-time. So I am looking for an another GUI toolkit that is cross-platform for Python, and am leaning toward PyQt (PyGTK is kind of dull looking in comparison). Unfortunately, although TrollTech says Qt is cross-platform, its license strategy has me a bit confused. So here is to...
8
4853
by: simo | last post by:
OK, so I'm at the stage where I want to make a choice between wxPython and PyQt. Currently I'm using wxPython mainly due to the fact that it has GPL Linux and Windows versions. I prefer Qt to wxWindows, but am confused with all the Windows licensing issues. For the moment this is just for my own tinkering and utility apps, but
3
2072
by: Fabio | last post by:
Hi all, I'm about to write an application, and I'd like to use PyQt, but before choosing this toolkit I would like to clarify some particular licensing issues; if some user has already touched these, I would like to hear from his experiences. This app should be cross-platform, so, given qt licensing policies, I would buy a commercial PyQt license and a commercial Qt license. Could I license the application under the GPL for Gnu/Linux...
3
2281
by: Kenneth McDonald | last post by:
If this is not an appropriate newsgroup for this type of posting, please let me know and (if possible) suggest an alternative. I've done a fair bit of research on the net, but information is scattered all over the place and I haven't been able to find mailing lists relating specifically to python and UIs. I'd like to start using Python for some GUI programming again. I'd like to use Tk, but it seems to be dying a slow death, so it's...
6
4759
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the size of a thumbnail and set the sizemode to Stretch -- I get one thumbnail. I want to retrieve all the picture files (jpg, bmp) in a directory into an array list and then display this list as thumbnails on my form dynamically. So my question is...
3
2073
by: Phil Thompson | last post by:
Riverbank Computing is pleased to announce the release of PyQt v4.0beta1 available from http://www.riverbankcomputing.co.uk/pyqt/. PyQt is a comprehensive set of Qt bindings for the Python programming language and supports the same platforms as Qt (Windows, Linux and MacOS/X). Like Qt, PyQt is available under the GPL and a commercial license. PyQt v4 supports Qt v4 (http://www.trolltech.com/products/qt/index.html). PyQt v3 is still...
1
6086
by: Peter TB Brett | last post by:
Hi folks, Although the PyQt documentation indicates that QGLWidget & friends have been ported to Python for the PyQt bindings, I'm not entirely sure what's necessary to make the normal OpenGL/GLUT interface available. Does PyQt work okay with PyOpenGL? Or is a more complicated workaround needed? If anyone has experience with working with Python/Qt/OpenGL and can offer
5
4247
by: Alex Teiche | last post by:
Hello, I am pretty new to Python, and have never learned C++. I am trying to implement the following thing into my python application: http://doc.trolltech.com/4.3/qsystemtrayicon.html Through PyQt. I have been using PyQt for awhile and I know how do use it, but I could not get this specific thing to work. Can someone give me some hints as to get it working in Python?
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.