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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:44:33+00:00 2026-05-24T18:44:33+00:00

I want to create a personalized UI with my Qt application. For this reason

  • 0

I want to create a personalized UI with my Qt application. For this reason I want to edit the default window frame that you can see at any type of window application.

The application that contains the default window title and frame:
http://0000.2.img98.net/out.php/i12977_with-default-title-and-frame.jpg

The application that edit the window title and frame:
http://0000.2.img98.net/out.php/i12978_without-defualt-title-andframe.jpg

  • 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-24T18:44:33+00:00Added an answer on May 24, 2026 at 6:44 pm

    You need to create a new class derived from QWidget, and pass Qt::FramelessWindowHint argument to QWidget constructor, like this:

    class MyWidget : public QWidget {
    public:
    MyWidget(QWidget* parent) : QWidget(parent, Qt::FramelessWindowHint) {...}
    

    After it you need to reimplement QWidget::paintEvent (QPaintEvent * event) and draw any design you want.

    For example, you have main window design as a PNG image.

    class MyWidget : public QWidget {
    Q_OBJECT
    private:
        QPushButton* button;
        QLabel* label;
        QComboBox* combobox;
        QPixmap pixmap;
    
    public:
        explicit MyWidget(QWidget *parent = 0)  : QWidget(parent, Qt::FramelessWindowHint) {
    
            // Create some controls
            button = new QPushButton();
            label = new QLabel();
            combobox = new QComboBox();
    
            QVBoxLayout* l = new QVBoxLayout();
            l->addWidget(button);
            l->addWidget(label);
            l->addWidget(combobox);
            setLayout(l);
    
            resize (500, 500);
    
            setAttribute(Qt::WA_TranslucentBackground); // enable translucent background
    
            pixmap = QPixmap("./1.png"); // load design picture
    };
    
    protected:
        virtual void paintEvent (QPaintEvent* event) {
             painter.setPen(Qt::NoPen);
             painter.setBrush(QColor(0, 0, 0, 0));
             painter.drawRect(this->rect());
             painter.drawPixmap(this->rect(), pixmap, pixmap.rect());
    };
    

    Since we don’t see a titlebar, we need to implement window drag operation:

    private:
        bool pressed;
        QPoint mousePressPoint;
    
    protected:
        virtual void mousePressEvent ( QMouseEvent * event ) {
            QWidget::mousePressEvent(event);
            if (!pressed) {
                pressed = true;
                mousePressPoint = event->pos();
            }
        }
    
        virtual void mouseMoveEvent ( QMouseEvent * event ) {
            QWidget::mouseMoveEvent(event);
            if (pressed) {move(event->globalPos() - mousePressPoint);}
        }
    
        virtual void mouseReleaseEvent ( QMouseEvent * event ) {
            QWidget::mouseReleaseEvent(event);
            if (pressed) {pressed = false;}
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want create texture atlas(matrix of images) from multiple images.Is their any applescript that
I want create a ruby script that I can run on the command line
I want create timer in my program so that I can cause it to
I Want Create a Win-Form Application Can be Connect to a Digital Camera Attached
I want create subdomains like this: domain.com/type/city An examples: domain.com/restaurants/new_york domain.com/hotels/new_york domain.com/restaurants/chicago I have
I want to use Explorer View for just myself. I can create default views
I want to create a Java application bundle for Mac without using Mac. According
I want to create a function that performs a function passed by parameter on
I want to create a simple http proxy server that does some very basic
I want to create a draggable and resizable window in JavaScript for cross browser

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.