Results 1 to 11 of 11

Thread: Making a floatable widget in Qt

  1. #1
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Making a floatable widget in Qt

    In my aplication when there shall be some validation happens, i need a widget or messagebox kind of concept which will pop up in the RIGHT HAND SIDE BOTTOM of my application for some time (for 5-10 sec) , after that specific time it should disapper ..

    for eg- when we are getting a mail in outlook some indication is being displayed in the rigt side corner .. i have to implment the same in my application ...
    could you please give a small example on this ??
    Last edited by riarioriu3; 9th July 2012 at 07:22.

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Making a floatable widget in Qt

    Base your class on QWidget or QDialog.
    Include in it a QTimer variable.
    In the constructor link the timer's timeout() signal to whatever action you wish (close, hide, move...).
    Start your timer with your desired time value (timer->start(millisecs)).
    Etc...

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Making a floatable widget in Qt

    Why not just use a QToolTip ?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Making a floatable widget in Qt

    But QToolTip cant be control by us right . when we are moving on that specific control only at that time QTollTip will be shown . But what i want is when some condition is satisfied , there shall be some thing happen which give some useful information to teh user ..(like outlook)

    Please refer to the question being asked .

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Making a floatable widget in Qt

    But QToolTip cant be control by us right .
    Wrong.
    when we are moving on that specific control only at that time QTollTip will be shown .
    You can show a tool tip any time you want.

    Please refer to the question being asked .
    I have.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Making a floatable widget in Qt

    is there any way to set stylesheet to tooltip ?

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Making a floatable widget in Qt

    EDIT:
    Yes you can:
    http://doc.qt.nokia.com/4.7-snapshot...reference.html

    But I still don't understand what is the problem you are having?
    You can show any kind of widget at any given time anywhere on the screen.
    So what exactly is the difficulty you are facing?
    i need a widget or messagebox kind of concept which will pop up in the RIGHT HAND SIDE BOTTOM of my application for some time (for 5-10 sec) , after that specific time it should disapper ..
    Ok, this is what you want to achieve.
    But what is the problem?
    Is it showing a widget?
    Is it having it close after specific time?
    Try to be clear about your problem.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Making a floatable widget in Qt

    I can make you understand through the following example ,

    e.g- In microsoft outlook when we are getting one mail at that time there is some notification message will pop up ( at the right hand side corner ) indicating that we have received one mail ...
    The same thing i have to implement in my application .. In my application whenever the user is doing something wrong , i have to notify the user by giving one notification message ,in the same way i have mentioned above ..According to the customer requirement i cant use any messagebox here . i have to implement the same way it is being implemented in the microsoft outlook ..

    I think now you can understand my problem statement ...

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Making a floatable widget in Qt

    I think now you can understand my problem statement ...
    No, because you are not explaining what your problem is, you are describing what you have to implement.
    Again, what is the problem you are experiencing?
    The problem is NOT what you want to implement, but what you tried and didn't work (for example).
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Making a floatable widget in Qt

    here my problem is , since i am new to Qt i dont know how to implement the above concept ..
    Please give some help as soon as possible , so that it will be helpful for me ...


    thankx in adv ...

  11. #11
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Making a floatable widget in Qt

    here my problem is , since i am new to Qt i dont know how to implement the above concept
    We can't help you with that.
    We can help you with problem you encounter, we can't teach you what you should already know when asking questions here.
    http://www.catb.org/~esr/faqs/smart-....html#explicit

    RTFM, and then try to implement it.
    When you have tried and encounter problems, come back and ask.

    Please give some help as soon as possible
    http://www.catb.org/~esr/faqs/smart-...ns.html#urgent
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Keep making a widget as always on top
    By nackasha in forum Newbie
    Replies: 8
    Last Post: 28th October 2011, 06:55
  2. making widget back from fullscreen
    By anoar in forum Qt Programming
    Replies: 2
    Last Post: 22nd September 2009, 17:13
  3. Drag widget example not making right
    By di_zou in forum Newbie
    Replies: 2
    Last Post: 16th September 2009, 11:14
  4. QWidgetDock + floatable
    By gucio1414 in forum Qt Programming
    Replies: 2
    Last Post: 25th July 2009, 23:04
  5. Making QT believe a widget is bigger
    By drhex in forum Qt Programming
    Replies: 2
    Last Post: 23rd September 2006, 13:17

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.