![]() |
#1 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Icon alignment in MessageBox
Is there a way to top-align the icon in MessageBox?
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Write your own message box
![]() Seriously, if you look in message_box.py you will see the message box is just a normal QDialog. The layout of its contents is done using self.gridLayout which is QGridLayout. Changing the alignment of the appropriate cell in that will do the trick. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Well, yes, that's what I'm trying to do, but I can't find how to change the alignment of a cell. I've managed to get the desired result with this:
Code:
box = MessageBox(...) box.gridLayout.addWidget(box.icon_label,0,0,Qt.AlignTop) box.exec_() |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Adding the same widget multiple times is not problem, as when you add a widget it is automatically removed from its previous parent.
What you need is self.gridLayout.setAlignment(box.icon_label, Qt.AlignTop) |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
HR alignment problems | eggheadbooks1 | ePub | 10 | 06-08-2013 09:31 AM |
Is there a way to set font for messagebox details? | meme | Development | 5 | 03-12-2011 10:52 AM |
Text alignment | James_Wilde | iRiver Story | 0 | 10-25-2010 04:22 AM |
left alignment | speakingtohe | Calibre | 2 | 08-13-2010 10:39 AM |
Vertical Alignment | gardefjord | ePub | 2 | 05-25-2010 09:59 PM |