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 - #!/usr/bin/python
-
-
# openfiledialog.py
-
-
import sys
-
from PyQt4 import QtGui
-
from PyQt4 import QtCore
-
-
-
class OpenFile(QtGui.QMainWindow):
-
def __init__(self, parent=None):
-
QtGui.QMainWindow.__init__(self, parent)
-
-
self.setGeometry(300, 300, 350, 300)
-
self.setWindowTitle('OpenFile')
-
-
self.textEdit = QtGui.QTextEdit()
-
self.setCentralWidget(self.textEdit)
-
self.statusBar()
-
self.setFocus()
-
-
exit = QtGui.QAction(QtGui.QIcon('open.png'), 'Open', self)
-
exit.setShortcut('Ctrl+O')
-
exit.setStatusTip('Open new File')
-
self.connect(exit, QtCore.SIGNAL('triggered()'), self.showDialog)
-
-
menubar = self.menuBar()
-
file = menubar.addMenu('&File')
-
file.addAction(exit)
-
-
def showDialog(self):
-
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',
-
'/home')
-
file=open(filename)
-
data = file.read()
-
self.textEdit.setText(data)
-
-
app = QtGui.QApplication(sys.argv)
-
cd = OpenFile()
-
cd.show()
-
app.exec_()
1 2963
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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
|
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...
|
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...
| |
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...
|
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...
|
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
|
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?
|
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...
|
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,...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |