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 6553253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:33:35+00:00 2026-05-25T12:33:35+00:00

In a standalone GUI application where I don’t have a windowmanager nor a composite

  • 0

In a standalone GUI application where I don’t have a windowmanager nor a composite manager I want to display a QDialog to the user to ask for values.

The dialog is quite big, so I want to make it translucent so that the user can look through it to see what happens in the application while the dialog is shown.

The problem is that for translucency of X native windows, there needs to be a composite manager. Qt internal widgets can be painted translucent because they don’t correspond to native X windows (aliens) and are completely only known to Qt.

Is there a way to make the background of a QDialog translucent without having a composite manager running? Perhaps making it a normal child widget/alien of the application’s main window? Is there a better alternative to 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-25T12:33:36+00:00Added an answer on May 25, 2026 at 12:33 pm

    I don’t know of any way of turning a QDialog into a normal child widget. Looking at the Qt for X11 code, I can’t figure out a way of not setting the Qt::WindowFlags passed to the QWidget (parent) constructor so that it would be a plain widget and not a window of its own (but I could be wrong, didn’t spend a lot of time on that).

    A simple alternative is to use a plain QWidget as your container, instead of a QDialog. Here’s a sample “PopupWidget” that paints a half-transparent-red background.

    #include <QtGui>
    
    class PopupWidget: public QWidget
    {
     Q_OBJECT
    
     public:
      PopupWidget(QWidget *parent): QWidget(parent)
      {
       QVBoxLayout *vl = new QVBoxLayout;
       QPushButton *pb = new QPushButton("on top!", this);
       vl->addWidget(pb);
       connect(pb, SIGNAL(clicked()), this, SLOT(hide()));
      }
    
     public slots:
      void popup() {
       setGeometry(0, 0, parentWidget()->width(), parentWidget()->height());
       raise();
       show();
      }
    
     protected:
      void paintEvent(QPaintEvent *)
      {
       QPainter p(this);
       QBrush b(QColor(255,0,0,128));
       p.fillRect(0, 0, width(), height(), b);
      }
    };
    

    To show it, call it’s popup() slot which will raise it to the top of the widget stack, make it as large as its parent, and show it. This will mask all the widgets behind it (you can’t interact with them with the mouse). It hides itself when you click on that button.

    Caveats:

    • this doesn’t prevent the user from using Tab to reach the widgets underneath. This could be fixed by toggling the enabled property on your “normal” widget container for example. (But don’t disable the PopupWidget’s parent: that would disable the popup widget itself.)
    • this doesn’t allow for a blocking call like QDialog::exec
    • the widgets in that popup won’t be transparent, you’d have to create custom transparent-background versions for all the widget types you need AFAIK.

    But that’s probably less of a hassel than integarting a compositing manager in your environment.

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

Sidebar

Related Questions

I have a standalone application in which I have to prompt the user with
I have implemented a standalone java application which uses the swing framework for GUI.As
In my standalone GUI application, I will install a Windows Closed handle on the
Which standalone Windows GUI application do you recommend for use for accessing a Subversion
Does MSTest have standalone GUI similar to nUnit that lets me use it and
I have a standalone Java app that has some licensing code that I want
I have some Matlab code and a GUI for it and I want to
Does anyone have experience of rapidly translating an access application into a standalone windows
I want to write a standalone GUI based app for administering one of the
Dear everyone, I am just curious, is it possible to create standalone GUI application

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.