Questions tagged [qpushbutton]

QPushButton is a Qt library class that represents ordinary push buttons, and gives the API to manipulate them.

QPushButton offers a set of functions to manipulate the button's appearance and behavior.

A minimalistic QPushButton example will look like this:

#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a( argc, argv );
    QPushButton * myButton = new QPushButton("Hello, World!");
    myButton->show();
    return a.exec();
}

One of QPushButton's most notable properties is Checkable, which can be accessed via setCheckable( bool ) function. If this option is set to true, the QPushButton becomes a toggle button which can be toggles on and off, and will stay in the corresponding state until toggled again.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

631 questions
-1
votes
3 answers

How to move a QPushButton inside gridLayout?

I have just tried a simple thing, in designer I created one push button, inside grid layout. The problem is geometry option got disabled in Property box, and I am not able to change the cordinates. In this situation how should I move the push button…
Nikhil Singh
  • 81
  • 10
-1
votes
1 answer

How to rotate PyQt5 QPushButton without using paintEvent?

Or just text in it. Is it possible? I found implementation with paintEvent How to rotate a QPushButton?, but it's not very 'pythonic' in my opinion.
JogSottot
  • 1
  • 1
-1
votes
1 answer

QT Jumping back to main screen

I m new to qt. I have one application in which there is one QPushButton as settings. When settings is pressed, it shows list of buttons say A B C D E and each button has one screen linked to it. Also each screen have back button. Means when A is…
-1
votes
1 answer

How do I change back and forth between two functionalities of a QPushbutton?

I have been quickly coding a simple QDialog with a QVBoxLayout with the functionality to enable an Arduino project of mine and I really want to update a QPushButton I have placed to make it go from 'start' to 'stop' and back every time. The…
K.C Karthik
  • 53
  • 1
  • 7
-1
votes
1 answer

Apply image on mouse hover event on Thumbnail button?

I am working in Qt on Mac OSX. I have set a thumbnail image on a QPushbutton. Then I want to apply a 2nd image over the thumbnail image on mouse hover event. I have tried this, but on mouse hover event my first image is hidden and only the 2nd image…
Ashish
  • 219
  • 2
  • 6
  • 22
-1
votes
1 answer

Tutorial for QPushButton graphics

Does anyone know some good tutorial to learn how to do some graphics/animation/design for the Qt QPushButton? I've been looking for one suitable for me, but I find none really interesting or well explained. I've read the documentation, but I want…
Chax
  • 1,041
  • 2
  • 14
  • 36
-2
votes
1 answer

Change a label after a specified time

I am trying to change a label on a button click and then after 3 seconds I want it to change back to nothing ("") my code is this: def apply_click(self): ui.label_ischanged.setText("Applied!") and I connected it to my button then I used…
-2
votes
1 answer

pyqt5 How to recognize which qpush_button activates the function in this function?

Like in topic. I looking for a way to recognize which qpush_button activates the function in this function.
ffg
  • 13
  • 1
  • 5
-2
votes
1 answer

QPushButton is not clicked on the first click

I have Qt 5.6 and I'm using the pressed signal of a button witch then shows a dialog. unfortunately the button of dialog is not clicked in the first time but the second click is working perfectly. you can test this situation by showing a…
a.tabatabaei
  • 304
  • 3
  • 16
-2
votes
2 answers

How can I change the information from my window in QT after clicking a push button

I want to have two buttons PREVIOUS and NEXT and I would like to have the same window but every time the NEXT button is clicked I want the information to be changed and something new to appear. How can I do something like this?
aB61
  • 17
  • 1
  • 6
-2
votes
1 answer

Qt Custom Slot QWebView

I'm fairly new to Qt and I'm trying to work with Signals and Slots and I'm having a bit of trouble creating custom Slots: public slots: void resetUrl(){ this->load(QUrl("http://www.google.com")); } (Then, in my main.cpp) #include…
Connor M
  • 331
  • 3
  • 5
  • 18
-3
votes
2 answers

Customization of pushbutton in qt (c++)

I am trying to customize a pushbutton in such a way that when the pushbutton is clicked and held the process will be executed once released the process is stopped ? Since I am new to qt any help would be appreciated.
-3
votes
1 answer

Two Buttons in Qt Gui

I've written a program with different functions in Qt. Now I want to make a Gui. For example I have two buttons, button1 and button2. I open the application, i see button1 first. Then I click button1, it executes its function (like "start") and…
pjs
  • 39
  • 1
  • 4
-5
votes
1 answer

writing a gui application that acts a cash register in Qt

Please help me answer the following question: Write a gui that acts as a cash register. In other words, a client brings a basket of items, their bar-codes are scanned, and their total is calculated. The main window should have a menu bar with two…
-8
votes
1 answer

Construct QPushButton with QIcon alignleft and text center align

I would like to create QPushButton with QIcon left align (not to the center as default) and text center align. I don't want to use a style sheet. I know that might be possibly using QPainter but I wasn't able to do it. I had little clue and tried…
mumulala
  • 1
  • 5
1 2 3
41
42