![]() |
2010-03-24
, 09:24
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#2
|
class HelloWindow(QtGui.QMainWindow): def __init__(self, *args): QtGui.QMainWindow.__init__(self, *args) self.exitb = QtGui.QPushButton('Exit', self) self.exitb.move(10, 210) self.connect(self.exitb, QtCore.SIGNAL('clicked()'), self.close) def show_new_window(): appt=QtGui.QApplication(sys.argv) basewin = QtGui.QMainWindow() basewin.show() win=HelloWindow(basewin) win.showFullScreen() sys.exit(appt.exec_()) show_new_window()
The Following User Says Thank You to attila77 For This Useful Post: | ||
![]() |
2010-03-24
, 10:16
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#3
|
... but.... where is this other window you're talking about ? In the code above you just make one. Also, I think what you want to do with the clicked signal is:
self.connect(self.exitb, QtCore.SIGNAL('clicked()'), self.close)
EDIT: So off the top of my head, do you want something like this ?
Code:class HelloWindow(QtGui.QMainWindow): def __init__(self, *args): QtGui.QMainWindow.__init__(self, *args) self.exitb = QtGui.QPushButton('Exit', self) self.exitb.move(10, 210) self.connect(self.exitb, QtCore.SIGNAL('clicked()'), self.close) def show_new_window(): appt=QtGui.QApplication(sys.argv) basewin = QtGui.QMainWindow() basewin.show() win=HelloWindow(basewin) win.showFullScreen() sys.exit(appt.exec_()) show_new_window()
where is this other window you're talking about ?
![]() |
2010-03-24
, 11:11
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#4
|
The Following User Says Thank You to mikec For This Useful Post: | ||
![]() |
2010-03-24
, 11:48
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#5
|
@noobmonkey
...... just hit the back button at the topleftright of second window and it will close and de-stack.
The Following 2 Users Say Thank You to krk969 For This Useful Post: | ||
![]() |
2010-03-24
, 23:18
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#6
|
@noobmonkey
maybe you are confusing hildon stackable windows with qt windows.
if you parent your second window to your main window then Maemo will convert your second window to a hildon stackable for you, and you dont need to mess with close window events, bringing windows to the top etc. just hit the back button at the top left of second window and it will close and de-stack.
as per my code in this thread
http://talk.maemo.org/showpost.php?p=577316&postcount=9
As there is no hildon specific code I am assuming come PR1.2 this will continue to work.
![]() |
2010-03-24
, 23:19
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#7
|
corrected that for you...
*EDIT* QT4.6
set the folllowing attribute Qt::WA_Maemo5StackedWindow as well on both windows to see that nice back button else you will see a cross
![]() |
2010-03-24
, 23:27
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#8
|
![]() |
2010-03-24
, 23:35
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#9
|
![]() |
2010-03-24
, 23:52
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#10
|
corrected that for you...
*EDIT* QT4.6
set the folllowing attribute Qt::WA_Maemo5StackedWindow as well on both windows to see that nice back button else you will see a cross
The Following User Says Thank You to attila77 For This Useful Post: | ||
![]() |
Tags |
fullscreen, pyqt, stackable, window |
|
Managed to get hildon stackables working fine, but my app is qt
I've got to the point where the window loads fine..! Yay! - but on exit of that window, the original' window goes into a loop of hang'y'ness....
So in pseudo my aim is
Load main window
click button
open new window
<allow things to happen>
user clicks exit on that window
close sub window
return to main window...
(Allow user to continue using that window!!!!)
Ok... so in code.....
My button calls this sub
(Note my many attempts to sort out the closing - as the window is full screen at time of pressing exit)
Hope that is enough info
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -