Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Making a floatable widget in Qt
Qt 6.12 LTS is out! See what's new in the release blog

Making a floatable widget in Qt

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 3.6k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on 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
    • ? Offline
      ? Offline
      A Former User
      wrote on 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
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on 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
        • ? Offline
          ? Offline
          A Former User
          wrote on 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
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #6

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

            (Z(:^

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #7

              yes , bottom right corner ..

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #8

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

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on 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
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on 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 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

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt
                      • Unsolved