Is the parentWidget a window or in a layout?
Is the parentWidget a window or in a layout?
J-P Nurmi
No Sir , the parent Widget is not a window .
It is also widget and a child of another QHboxlayOut Object.
Last edited by sonu; 27th October 2007 at 13:53. Reason: It is also widget and a child of another QHboxlayOut Object.
It would be helpful if you post a minimal compilable piece of code, highlighting the problem, as far as it is possible to rip that part out of the program and still reproduce the same result. Otherwise give us at least the class where the above code is defined.
Sir i can't understand your reply .please explain it clearly.![]()
It's hard to draw conclusions without seeing more code.
I am still having difficulty to understand what exactly is not working for you.
Try out this code. Does that work for you?
Qt Code:
#include <QApplication> #include <QtGui> int main(int argc, char* argv[]) { // Image Label imageLabel->setScaledContents(true); // Loading Image imageLabel->setPixmap(fileName); // CentralWidget // Layout lo->addWidget(imageLabel); cw->setLayout(lo); // Instantiating and showing mainwindow QMainWindow mw; mw.setCentralWidget(cw); mw.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
Last edited by momesana; 28th October 2007 at 08:38.
Thanks Sir , But my problem is that i can't resize layout widget .
I mean that i m using hierarchy of layouts . and in the child widget of Parent layout also contain another layout And I want to resize this layout .
If you can do something ,give reply
thanks for your suggestion ..........
Could you clearly state what you want? Keep in mind that we don't know anything about your project.
Well, actually you don't resize by hand anything that is managed by a layout manager. It is layout managers responsibility to maintain geometries of widgets added to it. There are a few ways (size policies, stretch factors..) to fine tune how this is done. Recommended reading: Layout Classes.
J-P Nurmi
Sir, I m trying this but it is not helpful.
Sir in actual i have a parent widget which contain a HBoxLayout with three child widget. Now I m adjust another QHBoxLayout in one of this child widget. But it does not resize acc. to given Geometry.
So please if u have any idea about it give reply....
thanks.........
Bookmarks