Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 348237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:20:45+00:00 2026-05-12T11:20:45+00:00

Is it possible to display translucent and/or irregular-shaped windows with Qt? (I’m assuming it

  • 0

Is it possible to display translucent and/or irregular-shaped windows with Qt?

(I’m assuming it ultimately depends on the capabilities of the underlying GUI system, but let’s assume at least Windows XP / Mac OS X)

If so, how does one accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:20:45+00:00Added an answer on May 12, 2026 at 11:20 am

    Yes, it is possible. The key is the Qt::WA_TranslucentBackground attribute of QWidget

    Here is a simple class that draws a round translucent window with a red background 50% alpha.

    TranslucentRoundWindow.h:

    #include <QWidget>
    
    class TranslucentRoundWindow : public QWidget
    {
        public:
            TranslucentRoundWindow(QWidget *parent = 0);
            virtual QSize sizeHint() const;
    
        protected:
            virtual void paintEvent(QPaintEvent *paintEvent);
    };
    

    TranslucentRoundWindow.cpp:

    #include <QtGui>
    
    #include "TranslucentRoundWindow.h"
    
    TranslucentRoundWindow::TranslucentRoundWindow(QWidget *parent) : QWidget(parent, Qt::FramelessWindowHint)
    {
        setAttribute(Qt::WA_TranslucentBackground);
    }
    
    QSize TranslucentRoundWindow::sizeHint() const
    {
        return QSize(300, 300);
    }
    
    void TranslucentRoundWindow::paintEvent(QPaintEvent *)
    {
        QPainter painter(this);
        painter.setRenderHint(QPainter::Antialiasing);
        painter.setPen(Qt::NoPen);
        painter.setBrush(QColor(255, 0, 0, 127));
    
        painter.drawEllipse(0, 0, width(), height());
    }
    

    If you want to be able to move this window with the mouse, you will have to override mousePressEvent, mouseMoveEvent and mouseReleaseEvent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to display ⇓ entity in ie6? It is being display in
With the DataGridView it is possible to display cells containing some long text. The
Is it possible to have multiple view of the same display object? (e.g. same-computer
Is it possible to animate the change of a UIProgressView such that the display
I wonder if is possible display a dialgo when a unexpected error happend in
is it possible display a 'x' for an html checkbox when we click on
Possible Duplicates: Display possible combinations of string algorithm that will take numbers or words
Is it possible to display a view from another controller? Say for example I
Is it possible to display local times to users without using Javascript when you
Is it possible to display only those statements in console, which are having certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.