[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Re: PyQt4 - Display text on GUI Window:
From:       "M.Chavez" <dunwitch () gmail ! com>
Date:       2009-10-25 20:19:56
Message-ID: 3f73695b0910251319r364461d7raff43714be282ca5 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I think I'm getting closer, here is an updated version with all the SQLite3
taken out. Everything loads fine, but nothing gets sent to the MainWindow.

import sys, random, sqlite3, os
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> from PyQt4 import QtGui, QtCore
> from geodesic import Ui_MainWindow
>
> class gameWindow(QtGui.QMainWindow):
>     def __init__(self, parent=None):
>         super(gameWindow, self).__init__(parent)
>         QtGui.QMainWindow.__init__(self)
>         self.ui = Ui_MainWindow()
>         self.ui.setupUi(self)
>
>         buttonHarvest = QPushButton("Harvest") #Create the harvest button -
> but QT Designer made it?
>         buttonMining = QPushButton("Mining") # Create the mining button -
> but QT Designer made it?
>         self.label = QLabel("Example") # Set the empty label that's not
> showing
>
>         self.connect(buttonHarvest, SIGNAL("clicked()"), self.skillHarvest)
> #Gets from def skillHarvest
>         self.setWindowTitle("Geodesic")
>         # Next
> -------------------------------------------------------------------------------------
>         self.connect(buttonMining, SIGNAL("clicked()"), self.skillMining)
> #Gets from def skillMining
>
>     def skillHarvest(self):
>         harvest = "You find some roots."
>         self.label.setText(harvest)
>
>     def skillMining(self):
>         mining = "You found some gold."
>         self.label.setText(mining)
>
> app = QApplication(sys.argv)
> showWindow = gameWindow()
> showWindow.show()
> app.exec_()
>

[Attachment #5 (text/html)]

I think I&#39;m getting closer, here is an updated version with all the SQLite3 taken out. \
Everything loads fine, but nothing gets sent to the MainWindow.<br><br><blockquote \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: \
1ex;" class="gmail_quote"> import sys, random, sqlite3, os<br>from PyQt4.QtCore import \
*<br>from PyQt4.QtGui import *<br>from PyQt4 import QtGui, QtCore<br>from geodesic import \
Ui_MainWindow<br><br>class gameWindow(QtGui.QMainWindow):<br>    def __init__(self, \
parent=None):<br>  super(gameWindow, self).__init__(parent)<br>        \
QtGui.QMainWindow.__init__(self)<br>        self.ui = Ui_MainWindow()<br>        \
self.ui.setupUi(self)<br>        <br>        buttonHarvest = QPushButton(&quot;Harvest&quot;) \
#Create the harvest button - but QT Designer made it?<br>  buttonMining = \
QPushButton(&quot;Mining&quot;) # Create the mining button - but QT Designer made it?<br>       \
self.label = QLabel(&quot;Example&quot;) # Set the empty label that&#39;s not showing<br><br>   \
self.connect(buttonHarvest, SIGNAL(&quot;clicked()&quot;), self.skillHarvest) #Gets from def \
skillHarvest<br>  self.setWindowTitle(&quot;Geodesic&quot;)<br>        # Next \
-------------------------------------------------------------------------------------<br>       \
self.connect(buttonMining, SIGNAL(&quot;clicked()&quot;), self.skillMining) #Gets from def \
skillMining<br> <br>    def skillHarvest(self):<br>        harvest = &quot;You find some \
roots.&quot;<br>        self.label.setText(harvest)<br>        <br>    def \
                skillMining(self):<br>        mining = &quot;You found some gold.&quot;<br>
        self.label.setText(mining)<br><br>app = QApplication(sys.argv)<br>showWindow = \
gameWindow()<br>showWindow.show()<br>app.exec_()<br></blockquote>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic