Hi all,
probably my question is very platform dependent but I'd like to know how can I have a skinned frame for my dialogs, just like Microsoft Messenger.
Thanks for any tips on that
Bye
Hi all,
probably my question is very platform dependent but I'd like to know how can I have a skinned frame for my dialogs, just like Microsoft Messenger.
Thanks for any tips on that
Bye
This is not platform specific - try to subclass QStyle. The style example shows how to implement norwegian wood, try starting from that.
thanks, I already use QStyle for customize widgets but I guess there's no way to customize application frame.
There is a way. U have to use native support and in there draw primitive element PE_CustomBase and than in drawPrimitive draw anything on it.
thanks for answering, this sounds very interesting to me, but I cannot figure it out how to do that.
One way could be to draw my window frameless and the draw by myself the window caption, but maybe there's a better way to do that
thanks,
bye
This is how microsoft does it. (Windows media player, Live messenger, Office 12, etc). So still a dirty hack, but now endorsed by microsoft!One way could be to draw my window frameless and the draw by myself the window caption, but maybe there's a better way to do that
Thanks for your answer, I'll try to do that. However I thought there someone had already tried to have such kind of dialogs in Qt.
Bye
Hi, Did you find a solution, im trying to do the same thing, with resizing support?
Any example that i could find to do this?
Making your dialogs frameless, then drawing your own frame, is the best way. I have never done this directly, but I have done similar things writing an X11 window manager. Here's a brief overview:
1) Create a widget called WindowFrame
2) Give it a 3x3 grid layout
3) Put your dialog in the center
4) In WindowFrame:aintEvent(), draw corner pixmaps in the corner, and tilable edge pixmaps on the edges
5) To make it resizable, implement mousePressEvent() and mouseMoveEvent()
The inclusion of titlebar and title buttons I leave an an exercise to the reader.
Hi, Thanks for the suggestions. I did what you say and it work.
The only problem that i had now is clipping the transparent part of the borders, so its actually round, and not black(it show transparent color as black)
I read that i can accomplish this with a mask, but i don't know how to add a mask to the widget, just to the particular corners.
All the different borders are separate images, and i have to join them some how, and then apply the mask to the widget
Any help with this???
thanks in advance!
CJC
Someone can help on this plz?![]()
I thanks, i had try this but i dont know why is not working.
I create a widget and add 9 frames, 8 for all the borders and 1 for the widget.
Then I set the borders as background images to their specific frame.
Then I try to create my pixmap buffering all the borders
Here is my code.
Qt Code:
painter.drawPixmap(_uiMainWidget->upperLeftFrame->frameRect(), QPixmap(":pics/bg/upperLeftFrame.png"), _uiMainWidget->upperLeftFrame->frameRect()); ... painter.drawPixmap(_uiMainWidget->leftFrame->frameRect(), _uiMainWidget->leftFrame->frameRect());To copy to clipboard, switch view to plain text mode
THe result here is that all my border images are drawn staked in the upper left side of the pixmap. And not in the correct position where the frames are.
Where could be wrong here? Are im using wrong the drawpixmap funtionality or missing something?
Any help will be much appreciated
Thanks
CJC
Have you tried Style sheets?
How can sc help with the problem of the images? that i specified before?
HI, i kind of fix my issue.
I should use .geometry and not frameRect()
Thanks for all the help
CJC![]()
could anyone post the code for resizing the frameless widget?
i tried this, but till today i've no idea how to implement this by myself...
thanks
one question: with qsizegrip ic can only resize to bottom-left, how can i let it resize to left or right or bottom only?
Bookmarks