<div dir="ltr">Hi Sean,<div><br></div><div>I have been using Qt to automate test cases for the different network security applications and Voice over IP products I used to work on for my current company and my last company for the last ten years. I have built a couple GUI apps using both Qt (PyQt4) and Python scripts for these two companies to run automated tests from the GUI drop-down menus, text boxes, buttons, etc. that I designed using Qt 4 Designer. Qt 4 Designer supports all the various GUI components you mentioned above and more, and you can design it the way you wanted. I recommend using Qt 4 Designer. A few pointers to learn Qt/Qt 4 Designer:</div>
<div style><br></div><div style>1. Use Qt 4 Designer to design your GUI to start of instead of trying to write the code yourself. Begin by creating a a button, for instance, and keep building and adding more GUI widgets as you go, and save into a file let's called guiApp.ui. Use pyuic4 batch file to compile and convert your widget file into Python code: pyuic4 guiApp.ui -o guiApp.py</div>
<div style><br></div><div style>2. When you convert your guiApp.ui into guiApp.py, it creates a Python class (e.g Ui_Test_Automation for my apps) with widget objects you need to call to trigger widget actions/signals. You will need to look into guiApp.py Python script to learn to use the objects it creates for various widgets/buttons, drop-down menu, etc. For instance, if you create a push button called RUN_TESTS, pyuic4 will create something like the following: </div>
<div style><br></div><div style>class Ui_Test_Automation(object):</div><div style> def setupUi(self, Test_Automation):</div><div style> self.RUN_TESTS=QtGui.QPushButton(Test_Automation)</div><div style> ....</div>
<div style><br></div><div style>(Google this part as each widget has different actions.signals it can perform)<br></div><div style><br></div><div style>3. For my GUI apps I created, I have another Python script to import guiApp file I created from step 1 above as follows to run my tests: </div>
<div style><br></div><div style>from guiApp import Ui_Test_Automation</div><div style><br></div><div style><br></div><div style>4. When I need to trigger an action for the RUN_TESTS button, the code for that looks something like this:</div>
<div style><br></div><div style>def __init__(self, parent=None):</div><div style> QtGui.QWidget.__init__(self, parent)</div><div style> self.ui = Ui_Test_Automation()</div><div style> QtCore.QObject.connect(self.ui.RUN_TESTS, QtCore.SIGNAL("clicked()"), self.RUN_SELECTED_TESTS)</div>
<div style> ...</div><div style><br></div><div style>def RUN_SELECTED_TESTS():</div><div style> #This method will run all selected tests on the GUI.</div><div style><br></div><div style>5. Google for sample Qt scripts and how to use and trigger Qt button signals. There are a lot of sample codes out there.</div>
<div style><br></div><div style><br></div><div style>I hope this helps.</div><div style><br></div><div style><br></div><div style>Heang Lim</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Dec 31, 2013 at 9:47 AM, John Grant <span dir="ltr"><<a href="mailto:cyrfer@gmail.com" target="_blank">cyrfer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">Hi Sean,<br>
My opinion is that you would be better served learning Qt. In some ways this additional dependency might cloud matters, but for the features you ask for, Qt will make your development streamlined. You can find more information about the Python bindings at:<br>
<a href="https://wiki.python.org/moin/PyQt" target="_blank">https://wiki.python.org/moin/PyQt</a></p>
<p dir="ltr">Good luck,<br>
John</p>
<div class="gmail_quote">On Dec 31, 2013 3:11 AM, "Sean Murphy" <<a href="mailto:mhysnq1964@icloud.com" target="_blank">mhysnq1964@icloud.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all.<br>
<br>
I am very very new to Python. I have read the book on programming for Windows with Python that was released in 2000. The book is very good but doesn't give me the basic information I am seeking. Since I am a beginner programmer.<br>
<br>
I want to create a GUI windows app with Python. The program has to use default Windows 32 or 64 bit objects. I wish to get the following components:<br>
<br>
Menu bar<br>
Listview<br>
Treeview<br>
Richedit or a multiline edit field<br>
A couple of buttons.<br>
All objects must be able to be access by the keyboard. either via tab stops (using the tab or shift tab key) and short cut keys.<br>
<br>
<br>
I have a 70 mb text file that is marked up using YML. I wish to show each section in the edit field. The list view shows the name of each item. The tree view will contain categories.<br>
<br>
I have seen PYGUI which I am not sure if it is easier then using the MSF approach which the book above mentions.<br>
<br>
So I really need assistance to progress this home bobbie project to expand my programming skills. Any wikis, documentations, good code examples with explanations, etc I would love to get my hands on.<br>
<br>
I am reading about 3 or 4 books on Python to get up to speed. But only found one book on Win32 programming. I do not want to have to turn around and learn win32 or MFC. If I have to then please point me towards a good book or resource.<br>
<br>
<br>
Regards<br>
Sean<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
</blockquote></div>
<br>_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
<br></blockquote></div><br></div>