PDA

View Full Version : Trouble creating an extra Widget (or Window or whatever really)



trasp
11th September 2011, 12:19
Hey... I fear that I soon won't have no hair left so I really have to ask someone.

I'm trying to open a new widget like an extra window, but whatever I do the windows borders stays gray and I can't do anything with the window except from minimize it (along with my mainwindow)... Everything went so well until I hit this problem a long while ago now and it's extra annoying because I'm almost done with the application otherwise... Anyone care to help a newbie that has been grinding code for over 24 hours?



from PyQt4 import uic
from PyQt4.QtCore import *
from PyQt4.QtGui import *

(Ui_padlockgui, QMainWindow) = uic.loadUiType(os.path.join(os.path.dirname(os.pat h.abspath(__file__)),"data","padlockgui.ui"))
(Ui_helpwindow, QWidget) = uic.loadUiType(os.path.join(os.path.dirname(os.pat h.abspath(__file__)),"data","helpwindow.ui"))

class helpwindow(QWidget,Ui_helpwindow):
"""helpwindow inherits QWidget"""
def __init__(self):
QWidget.__init__(self)
self.setupUi(self)
def __del__ (self):
self = None

class padlockgui (QMainWindow):
"""padlockgui inherits QMainWindow"""
def __init__ (self, parent = None):
QMainWindow.__init__(self, parent)
self.ui = Ui_padlockgui()
self.ui.setupUi(self)
self.connect(self.ui.helpButton, SIGNAL('clicked()'), SLOT('helpbutton()'))
def __del__ (self):
self.ui = None
@pyqtSlot()
def helpbutton(self):
self.hw = helpwindow()
self.hw.setWindowTitle('Wallet Padlock Help')
self.hw.show()


Anyway, best regards!

Edit: Just quote it in C/C++, I'll manage to figure it out from that...