Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: raised view of Widgets.

  1. #1
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default raised view of Widgets.

    hi,
    i have a small query regarding the look and feel of the widget that appear.
    In application we need to have a facility of showing the windows as raised one compared to its back ground.
    in a sense the window that appears on another one should be as if it was stacked over it.
    did any one implemented some thing similar.
    also ,once a window is obtained its status is shown in the status bar at the base.how to access this bar and make the words appering on it in bold.

    thanks in advance.
    regards,
    krishna.

  2. #2
    Join Date
    Aug 2006
    Location
    banglore
    Posts
    21
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: raised view of Widgets.

    statusBar()->message(""<b>Loading....</b>");

    I hope this will help you...........


    Mani..

  3. #3
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Thank you can you send any help on how to make a window to have raised look compared to its back ground window?

  4. #4
    Join Date
    Aug 2006
    Location
    banglore
    Posts
    21
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: raised view of Widgets.

    You can just play with frameShape and frameShadow properties... to change your widgets appearance.. You only need to manaully change ur child widgets property .. qt will not do automatically...

    Mani

  5. #5
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Thanks for the info. If possible can you send a piece of code?

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: raised view of Widgets.

    Quote Originally Posted by krishna.bv View Post
    In application we need to have a facility of showing the windows as raised one compared to its back ground.
    in a sense the window that appears on another one should be as if it was stacked over it.
    did any one implemented some thing similar.
    Could you post a screenshot of something similar? I have difficulties understanding what do you mean by this. Are you talking about raised child widgets inside a window, or about two separate top level windows?
    J-P Nurmi

  7. #7
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Yes we need to have a raised view of widgets(basically objects of QMainWindow) inside QMainWindow. But the child windows need to be like elevated portions when compared with the back ground.

    i am unable to find a function in QMainWindow which will get the things done like the one we have in QFrame.

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: raised view of Widgets.

    Quote Originally Posted by krishna.bv View Post
    Yes we need to have a raised view of widgets(basically objects of QMainWindow) inside QMainWindow. But the child windows need to be like elevated portions when compared with the back ground.

    i am unable to find a function in QMainWindow which will get the things done like the one we have in QFrame.
    I still don't understand..

    The underlying window manager or operating system handles frames and title bars of top level widgets, aka. windows. Why would you put several main windows inside each other? You would end up having several menubars and such.

    Could you please try to for example use designer and your favourite painting program to provide an image to explain the situation?
    J-P Nurmi

  9. #9
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    We are basically designing MDI application. the child windows broaders should be some what bulged and raised when compared with the back ground.
    please let me know if i am clear now.

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: raised view of Widgets.

    Have you noticed QWorkspace? If that is no option, you could also take a look at Qt Designer, and how does it do the window handling in it's multi window user interface mode.
    J-P Nurmi

  11. #11
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    But there is no member function in QWorkspace that does this. it is in QFrame only.

  12. #12
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Our application is similar to mdi example given in examples.
    the windows that we get from new->file option should have thick frame which should have raised view.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: raised view of Widgets.

    I think the goal here is to have a QMainWindow subclass with a pseudo-3d look using the same mechanism i.e. frames and push buttons use (by colouring part of the border in dark shades and the opposite in light shades). But then maybe it's enough to inherit QFrame instead of QMainWindow? Do you really need QMainWindow functionality there?

  14. #14
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    yes we need to have QMainWindow functionality there. please a small snippet of code i have done to get some thick boarders where am i going wrong.
    Attached Files Attached Files

  15. #15
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: raised view of Widgets.

    Painting using a QPainter on a QWidget can only take place in a QWidget::paintEvent().
    J-P Nurmi

  16. #16
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Hi,Thanks for the info.
    please find the implementation.
    though i am able to get various colours., my purpose still is not done,.

    please find attached my code and snapshot of what i got and what i need to obtain.
    Attached Images Attached Images
    Attached Files Attached Files

  17. #17
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: raised view of Widgets.

    Quote Originally Posted by krishna.bv View Post
    please find attached my code and snapshot of what i got and what i need to obtain.
    I still have problems understanding what is the goal. How do you want it to look like?

    Maybe you could simply use a QFrame as the central widget of the QMainWindow? QFrame has various properties to adjust the look and feel of the frame. You can change the color of the frame by using style sheets or QPalette.
    J-P Nurmi

  18. #18
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Hi,
    please find the image attached that contains the part of my window i need to paint.
    is it so tricky to do and beyonds the capabilities of Qt.
    Attached Images Attached Images

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: raised view of Widgets.

    Qt Code:
    1. void MyWidget::paintEvent(QPaintEvent *e){
    2. QPainter p(this);
    3. QPen pen = p.pen();
    4. pen.setWidth(10);
    5. pen.setColor(Qt::red);
    6. p.setPen(pen);
    7. p.drawRect(rect());
    8. QWidget::paintEvent(e);
    9. }
    To copy to clipboard, switch view to plain text mode 

    Doesn't this work?

  20. #20
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: raised view of Widgets.

    Thank you very much!
    It worked only in the interior of wndow. i actually want the frame to be drawn. the frame which holds the windows.
    Also how to draw the frame in different colours. please see the out put that i have obtained with your code, Wysota.

    the painted red rectangle is now movable with the window. but any mouse event is repainting the window and the red rectangle is disappearing. how to over come this?
    Attached Images Attached Images

Similar Threads

  1. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  2. Replies: 11
    Last Post: 7th July 2006, 13:09
  3. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  4. Replies: 6
    Last Post: 20th April 2006, 10:23
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.