ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#include "PackageProperties.h"
PackageProperties::PackageProperties( QWidget *parent, const char *n) : QVBox(parent, n)
{
filename = new LineInput( "File Name ", this );
name = new LineInput( "Name ", this );
version = new LineInput( "Version ", this );
arch = new ComboInput( "Architecture ", this );
arch->insertItem("i386");
arch->insertItem("i486");
arch->insertItem("i586");
arch->insertItem("i686");
arch->insertItem("noarch");
build = new LineInput( "Build ", this );
int len = arch->promptLength();
//Set the prompt fields to one even length
filename->promptLength(len);
name->promptLength(len);
version->promptLength(len);
arch->promptLength(len);
build->promptLength(len);
}
Now, the text box that says architecture doesn't line up with the rest of the other boxes. Is there a way I can make it line up? Also, do you have any design improvements or suggestions? I'm trying to learn how to program in linux and this is my first program, so please try not to be too harsh.
I think you're a lot better off using Designer to create your interface shells then connecting it to the back end manually. That way you focus on the true value of the interface and not the semantics of making it look like you want it to. I'm a hardcore "manual" coder myself, but even I think it's fairly primitive to manually code a GUI. It's just not natural
ta0kira
I might have to counter-disagree. If you only use the designer (without an IDE) and put only enough code in the generated sources to connect the different components with each other and to the back end, I think that's a lot easier than trying to visualize the entire GUI based solely off of text code. I'd say writing a GUI by hand is more difficult to debug since the designer lets you assemble and preview a GUI in minutes.
ta0kira
Thanks for the suggestions. I did manage to figure out how to make it line up correctly. First inherit from the QWidget class then define a minimum size hint.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.