Hi Sir,
I just want to draw an image or an pixmap on to the QSplitter ..How to do that...I am
Fixed over this issue ,unable to move forward....Please help me out...
Thanks
Hi Sir,
I just want to draw an image or an pixmap on to the QSplitter ..How to do that...I am
Fixed over this issue ,unable to move forward....Please help me out...
Thanks
In the QSplitter, add a custom QWidget which uses a QImage to draw in it's repaint methods.
Last edited by dublet; 3rd March 2006 at 10:58.
What is it exactly you're trying to do?
Are you trying to show an image as one of the widgets handled by a splitter, or customizing the look of the "splitter divider"?
Edit: ..and which version of Qt are you using, by the way?
Last edited by jpn; 3rd March 2006 at 11:00.
Hi,
Yes....I want to customize the look of the "splitter divider in image...
Well, this kind of trick works in Qt 4.
Qt Code:
splitter->setHandleWidth(pixmap.width()); label->setPixmap(pixmap);To copy to clipboard, switch view to plain text mode
Note the index of the handle. The pixmap appears in the top area of the handle, to customize to positioning you can use layouts, of course..![]()
I am using Qt 4.1
hi,
But I am unable to get the Pixmap on to the splitter handle.....
1) Are you sure you are loading the pixmap correctly? Check what pixmap.isNull() returns.
2) Are you sure you are using the correct handle index?
hi,
QVBoxLayout *v=new QVBoxLayout(this);
QLineEdit *l1=new QLineEdit(this);
QLineEdit *l2=new QLineEdit(this);
QPixmap pixmap("Album.png");
QSplitter *splitter=new QSplitter();
splitter->setHandleWidth(pixmap.width());
QLabel* label = new QLabel(splitter->handle(1));
label->setPixmap(pixmap);
splitter->addWidget(l1);
splitter->addWidget(l2);
v->addWidget(splitter);
1.Yes,pixmap is loaded successfully....
The code is shown above...
I want the pixmap to be on the splitter....
Thanks
I'm quite sure it's about the pixmap. Is it in the same dir than the executable is? Did you check what pixmap.isNull() returns? At least for me, the code I posted earlier, works fine.
hi,
The handlewidth is same as that of the image but unable to get the image picture...
Also pixmap.isNull() is returning false....
Thanks...
Bookmarks