![]() |
QT UI Problems (Button sizes/Config..)
Hi,
I currently porting my fahrplan app to qt and i run into design problems. Here are some of my problems. Thanks in advance for infos about them. - How can i get my QPushButtons thumb sized (they always fingersized) - Is there a way to get QPushButton (or QToolButton) without the hildon theme? The problem is that i need a button which is extremly high (2x thumb size) and with the hildon theme it just repeats the texture. - The Qt buttons support no Markup in the description like the QLabel. so i use (like in the gtk c version) a button and add a label to it which contains the markup. (With setLayout) that worked great with gtk, but with qt the button only fires pressed and no clicked. or release signal. the problem with that is, that the button is inside a scrollbox und if i only have the pressed signal i cant scroll without pressing a button. - The QTMaemoPickerbuttons don't align the text and valuetext well ( in gtk the button text is centred) - In gtk i can set the QTMaemoPickerbuttons style to HILDON_BUTTON_STYLE_PICKER which sets the color of the value text to a an active color rater than grey. (only needed if no selector assignt, i set the value text manualy) - In the QT Designer window i can add a "Line" Element. I tried with QFrame to create a line in my constructor without the .ui file but i had no success. - Whats the "best-practices" to store own config settings with qt? Phil |
Re: QT UI Problems (Button sizes/Config..)
(numbers added for reference)
Quote:
1 - Thumb size must be set manually. source. The last comment there would have been encouraging if not for the fact that Qt is now at version 4.6.3 and that comment was made last year... 2 - The easiest way would probably be with stylesheets. 3 - If you port wwWidgets to Maemo, you can use his QwwRichTextButton, but it would probably be simpler to copy this code from the qtcenter wiki that has a rich text push button implementation. 4 - Use the setValueLayout() property of the QMaemo5ValueButton and set it to "ValueUnderTextCentered" 5 - no clue, sorry. 6 - Perhaps post your code? The following works for me: Code:
from PyQt4 import QtCore, QtGui [edit] Added more answers |
Re: QT UI Problems (Button sizes/Config..)
Thanks, i will try it.
my source is available here: https://garage.maemo.org/plugins/scm...?root=fahrplan |
Re: QT UI Problems (Button sizes/Config..)
Ok most of the problem are solved thanks to aspidites, but the only thing i cant get working is the button size.
if i set the button with setFixedHeight or setMinimumHeight the button gets the desired height, but then the theme of the button is incorrect. happens for push and toolbuttons edit: my workaround is now, to set my buttons which needs a different height a different style (gtkstyle) |
Re: QT UI Problems (Button sizes/Config..)
Quote:
Can you post the code that set the style to GTK style? I have the same repeating problem. |
Re: QT UI Problems (Button sizes/Config..)
QGtkStyle *gtkStyle = new QGtkStyle();
qPushButtonInstance->setStyle(gtkStyle); |
Re: QT UI Problems (Button sizes/Config..)
Hi all
I have the same challenge. How would I have to do it in python (this seems to be c++ code or so). And where to you have to place the code? I generate my UI qith QT Designer and then import the generated python code into my application. Thank you for your help! |
Re: QT UI Problems (Button sizes/Config..)
bug in Qt with PR1.2 where the button height is clipped. You can fix this via a style sheet in qt designer
|
Re: QT UI Problems (Button sizes/Config..)
Quote:
And if i make a style matching the default theme, how will it look when somebody changes the theme? I know that other applications solved that issue, but how? |
Re: QT UI Problems (Button sizes/Config..)
Quote:
Code:
gtkSTyle = QGtkStyle() Edit: If you are using Qt designer to generate your ui, then after running pyuic create a script that imports the generated module and has as class that subclsses both the generated module and the base class Kind of like: Code:
|
All times are GMT. The time now is 16:24. |
vBulletin® Version 3.8.8