Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Making a floatable widget in Qt
Forum Updated to NodeBB v4.3 + New Features

Making a floatable widget in Qt

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BibekKumar
    wrote on 9 Jul 2012, 05:42 last edited by
    #1

    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 ..

    Can anyone give any idea how to implement this thing

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 9 Jul 2012, 06:12 last edited by
      #2

      A QLabel seems to be a good candidate, if you apply some QSS styles or custom painting.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BibekKumar
        wrote on 9 Jul 2012, 06:20 last edited by
        #3

        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 ??

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 9 Jul 2012, 06:31 last edited by
          #4

          Take a look at "QFrame":http://qt-project.org/doc/qt-4.8/qframe.html it might give you a lot of styling options. QLabel inherits from QFrame.

          Example? I'm kind of not in the mood for that, and quite busy, too. So just a quick, untested prototype:
          @
          QLabel *mylab = new QLabel(this);
          mylab->setText("Blah blah");
          mylab->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
          mylab->setStyle("background: yellow"); // I don't remember inlined QSS syntax here, check docs for that
          mylab->move(someX, someY); // Or use layouts, or modality, but that would be tricky and requre testing
          @

          (Z(:^

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BibekKumar
            wrote on 9 Jul 2012, 06:58 last edited by
            #5

            is there any functionality to know the coordinate of the laptop screen (right hand side bottom ) ?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 9 Jul 2012, 07:05 last edited by
              #6

              I don't know. I thought you meant bottom right corner of your window.

              (Z(:^

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BibekKumar
                wrote on 9 Jul 2012, 07:19 last edited by
                #7

                yes , bottom right corner ..

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on 9 Jul 2012, 13:26 last edited by
                  #8

                  How about using [[doc:QDesktopWidget]] for information like that?

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    BibekKumar
                    wrote on 10 Jul 2012, 03:45 last edited by
                    #9

                    through QDesktopWidget we can know the coordinates of the bottom right corner of the desktop ..
                    is there any way to know the coordinates of bottom right corner of the application ?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sierdzio
                      Moderators
                      wrote on 10 Jul 2012, 05:25 last edited by
                      #10

                      Are you serious?

                      Just take x() + width() and y() + height()... or make use of QWidget::geometry().

                      (Z(:^

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andre
                        wrote on 10 Jul 2012, 06:04 last edited by
                        #11

                        Use QWidget::frameGeometry() to get the size and position of the window including the surrounding decorations.

                        1 Reply Last reply
                        0

                        1/11

                        9 Jul 2012, 05:42

                        • Login

                        • Login or register to search.
                        1 out of 11
                        • First post
                          1/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved