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
1 answer

QT push button to create object

I am trying to create a little game using a pile structure, and im using QT Widget Application, my problem is: i have a class Pile that needs to be initialized with Pile p1(size), and "size" is obtained when the button "Create" is pushed. The…
Ricardo
  • 3
  • 2
-1
votes
1 answer

PyQt5 QPushButton setSyleSheet does not change button color when pressed

After studying various examples in this forum, I tried to change the color of a button when pressed. The button is normally blue, and when it is pressed I want it to turn red. The following code does display a blue button with white text, but it…
ear1
  • 45
  • 5
-1
votes
2 answers

Highlight a single character in qpushbutton pyqt

I want to highlight a single character with color red. Fox example "A" letter in Accounting in qpushbutton in pyqt5.
-1
votes
1 answer

How to assign keys to QPushButtons created in a Loop

Using PYQT5, I have created a grid of buttons using QPushButton, as shown below: self.pads = [] self.binding = ['a','b','c','d','e','f','g','h','i'] #add quota for binding for r in range(3): for c in range(3): …
-1
votes
1 answer

How to show widgets created in another QWidget Class?

I try to create a UI using PyQt5 where a user can create and delete labels, each label being a button (QPushButton) created following a text entry (QLineEdit), and each of these label buttons being accompanied by an associated X-button, which delete…
Marc
  • 29
  • 6
-1
votes
1 answer

Python PyQt5 load Image for QPushButton on QThread

So I have this UI that loads ALOT of buttons, all with Images, problem is, it takes WAY to long, so I tried putting it into a QThread, I had it working, but there was no speed difference, so I tried a different solution, but now the Thread wont…
JareBear
  • 467
  • 9
  • 27
-1
votes
1 answer

Strange autoclicking of qpushbutton

I've been trying to learn c++ and qt framework by doing a point of sale software project.my main window has couple of tabs and with in one tab i have a qpushbutton which open a newpurchase dialog which takes input from user to record a new purchase…
-1
votes
1 answer

Qt5 QPushButton's can't be clicked (?!)

I have an inherited widget game_widget in which I declared 9 QPushButton's that are stored in an array via a method init_ui and a layout widget on which the buttons are supposed to be placed. There is also init_ui function that is called in the…
sweak
  • 1,369
  • 2
  • 6
  • 21
-1
votes
1 answer

Read the input and print factorial in Qt GUI Application using C++

Using QTCreator, I created the design of a GUI Application. I want to read the input entered by the user from lineEdit and when pushButton is clicked, it should print the factorial of that entered number on the same page. I've read some tutorials…
Aiswarya
  • 3
  • 1
-1
votes
2 answers

QGroupBox buttons not showing

So basically I'm trying to make an updating QGroupBox with some QPushButtons inside of it, here's the "updating" method and it is always called right after the list is changed: def repaintList(self): btn_ls = [] for i in…
Henrique Lee
  • 59
  • 1
  • 1
  • 7
-1
votes
4 answers

QPushButton not blinking

Inspired by Label on QToolBar, possible? I'm trying to develop it. But my button do not blink on click, why? I see in the other app looks like the button color gets gray during the click (while pressed) and the normal button gets blue. But my button…
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
-1
votes
1 answer

How to programmatically pass QLineEdit content into QTableView rows using QPushButton

I am trying to programmatically pass the content of a QLineEdit into rows of a QTableView using a QPushButton. I was wondering if there is anyone who can provide some guidance on how to do that. Basically this is the initial situation: and this is…
Emanuele
  • 2,194
  • 6
  • 32
  • 71
-1
votes
2 answers

Slot is not detected when QPushbutton is released

I am currently making a main menu for a game, but when the button is clicked it does not seem to call the relevant slot (The button does not do anything). I have tried to move the button to a thread to ensure that nothing is keeping it from running…
AO1114
  • 3
  • 3
-1
votes
1 answer

Main window not responding after adding QPushButton

I'm currently making an AI to "Snake". After adding QPushButton to my QMainWindow there is no response from window for pressing any key. void MainWindow::keyReleaseEvent(QKeyEvent* event) { g->key_event(event); } That's how I'm injecting…
-1
votes
1 answer

Connect Arduino digital pin to input pin and work as button

In my project I need a push button to perform certain actions using Arduino. But unluckily I cannot buy a push button and I am in a bit of a hurry. Can I use the Arduino's 3.3v output pin and input pin to create a switch? I want to add two jumper…
Ans Bilal
  • 987
  • 1
  • 10
  • 28
1 2 3
41
42