Classes

Pages: 12
Damn it just wrote the reply (kinda large) and it had me logged out XD Doh!

But okay I see, yeah I noticed a few times that the compilers can have certain differences. There are so many options to play with, even when you compile Qt from source, I had a go at that.

Then different compilers and again different compiler settings, I don't think I have even scratched the surface!

Well I have tried some of the examples out of the pdf, but the main project is a cryptocoin, much like Bitcoin etc, namely Netcoin. I don't know if you are familiar with all that. My friend is dealing with all the hard core coding and I am just doing the design, I can do certain things, like I put in some scroll pages with buttons etc that open up webpages and whatnot, I did get webkit working too, to a degree. I can do the basic stuff kinda well enough.

I was just trying to be a bit more adventurous.

I can link you to my git if you like, but obviously my current changes are not there, I use git mainly as a checkpointer. Even though the current one on there still needs lots of work doing.
Last edited on
Hmmm well, it would seem I am missing something fundamental here XD... You see I used this code

1
2
QLabel *label999 = new QLabel("Hello Qt!");
label999->show();


Just as a simple experiment... Maybe I am putting it in the wrong place, or something else is going on, but it too opened up in it's own window... I really must be missing something.
You had enough of me now XD Don't blame ya! lol

But, I thought I would come back and share the good news with the world...

I did it!

Took some fiddling but finally! I did it! Feels sooooo good! :)

And the end result is only some plain text on the screen haha, but it is the text I wanted, where I wanted, so over the moon!

Feel like I could crack anything now, multi-threading you say? pfft lol
That's good to hear. The problem you probably were having was you probably made a class derived from a QMainWindow instead of QWidget
Yeah I think that was probably it, though to be fair I couldn't say for sure... 1 thing is for certain, your links were very helpful and I haven't even begin to scratch the surface of them, so thanks for that.

I am getting how to use Qt creator more now too, The pop up suggestions are very helpful to let me know if what I am trying to do is right or not. If you get me.

I am kinda a little miffed here

http://pastebin.com/U7mLHdep

This is a certain page I am trying to adapt, I have done certain bits like give it a fixed background image and whatnot, but there is a border, a grey border... I see on line 23 there is

 
setContentsMargins(0,0,0,0);


This controls everything inside the largest window, what I would call the main area but not the main window. I tried

 
parent->setContentsMargins(0,0,0,0);


As you can see on line 21, I realise this is probably totallu wrong, but it didn't complain at least, at compile time. But didn't do anything either, there is still a grey border.

I would assume line 23 is the same as mine anyway, as in it is specifying the margin of the parent... So if there is still a grey border, would that mean it must be controlled some place else....

Here is a pic, should be easier to see what the hell I'm jabbering on about XD

[IMG]http://i59.tinypic.com/2n200mp.png[/IMG]

In design view this would be the parent widgets layout that controls this... Hmmm... But I also see all the other margin parameters are mostly set to zero... In design mode to see this kind of border I would expect to see (9,9,9,9)... I have searched the project and there is nothing to match that.

Maybe this is just a default border? And if so how do I specify it?

EDIT: Obviously there isn't a Ui page for this one else I would just change it in design mode XD

EDIT: Hmmmm I wonder if it is the size of the main area rather than a border causing it, will have a go with that

EDIT: Managed to move the first drop down over so it is level, so that is a start lol
Last edited on
You can give the QWidget a frameless window flag. It would kind of be like a QDialog then. http://qt-project.org/doc/qt-4.8/qt.html#WindowType-enum

As far as the margins honestly I only spent about a month with Qt and it was about a year ago so I'd have to refresh myself. The only help I can do is to look it up and from doing so it says that it doesn't affect the frame.
void QWidget::setContentsMargins ( int left, int top, int right, int bottom )
Sets the margins around the contents of the widget to have the sizes left, top, right, and bottom. The margins are used by the layout system, and may be used by subclasses to specify the area to draw in (e.g. excluding the frame).
http://qt-project.org/doc/qt-4.8/qwidget.html#setContentsMargins
Ahhhh okay I see, so this one is more for the Qt creator crowd. :)

But thanks for looking it up, that would seem to make sense with what I am seeing, It's odd though as every other page I have no grey frame, so I know you can get rid of it, with no tricks either really, but perhaps you can't with QWidget for some reason.

Again I will take that one to Qt and see what they have to say about it.

Thanks for all your help, and I will have a look through the links before heading off to Qt creator forums.

I think I have quite a list growing for them. Some things have left me scratching my head XD
Topic archived. No new replies allowed.
Pages: 12