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

  • Home
  • SEARCH
  • 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 9191029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:35:20+00:00 2026-06-17T20:35:20+00:00

My class uses QWidget and I’ve got some QPushButtons there and I’d like to

  • 0

My class uses QWidget and I’ve got some QPushButtons there and I’d like to set a QLabel on top of each button, which are set on the window by move() but QLabel doesn’t want to move…
I use setMargin but it moves it from left to right, but not up or down.
There’s an example of my code:

    self.btn = QPushButton(QIcon(),"Show table", self)
    self.btn.move(360, 10)
    self.btn.resize(100, 20)
    self.btn.clicked.connect(self.doAction)

    self.label = QLabel("Here comes the boom")

    layout_LineEdit = QVBoxLayout()
    layout_LineEdit.addWidget(self.label)
    self.setLayout(layout_LineEdit)
  • 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-06-17T20:35:21+00:00Added an answer on June 17, 2026 at 8:35 pm

    Add a moveEvent to your class and connect move signal to your slot, your slot should be a function that change your widget’s geometry via:

    YourClass::moveEvent(QMoveEvent *ev)
    { 
        emit move(ev->pos());
        QLabel::moveEvent(ev);
    }
    

    your SLOT function:

    void move_label(QPoint *point)
    {
        setGeomtry(0, 0, point->x, point->y);
    }
    

    and connect them as below:

    connect(label_widget, SIGNAL(move(QPoint)), this, move_label(QPoint));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My obj-c class uses a C library (the Chipmunk physics engine), which has an
Class A uses an initializer list to set the member to the paramter value,
I have i python application, which uses PyQt GUI. It application has some I/O
My UITableViewController class uses an .xib. I would like to make the TableView only
In this thread I found some interesting moment, If class uses only as superclass
I have some slot function defined in my class which do some actions. I
I have a class defined in class.cpp and class.h . The class uses some
i know that .NET String class uses such behaviour, but I can't find any
I have a UITableView in a ViewController class. The ViewController class uses a custom
Using Dozer to map two objects, I have: /** /* This first class uses

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.