qt

How to call defined slots from keypress event in qt / How to connect keypressed event with QPushbutton on gui?

冷暖自知 提交于 2021-02-11 04:56:43
问题 I am beginner to qt. I was working on calculator gui application, I have already defined slots like numPressed() when any of the number pushbutton is pressed on the calculator that will be displayed on the lineEdit. void Calculator::numPressed(){ QPushButton *button = (QPushButton *)sender(); QString buttonValue = button->text(); Qstring display = ui->lineEdit->text(); Qdouble ProcessedValue = previousValue + buttonValue.toDouble(); . . . ui->lineEdit->setText(QString::number(ProcessedValue))

How to call defined slots from keypress event in qt / How to connect keypressed event with QPushbutton on gui?

情到浓时终转凉″ 提交于 2021-02-11 04:53:04
问题 I am beginner to qt. I was working on calculator gui application, I have already defined slots like numPressed() when any of the number pushbutton is pressed on the calculator that will be displayed on the lineEdit. void Calculator::numPressed(){ QPushButton *button = (QPushButton *)sender(); QString buttonValue = button->text(); Qstring display = ui->lineEdit->text(); Qdouble ProcessedValue = previousValue + buttonValue.toDouble(); . . . ui->lineEdit->setText(QString::number(ProcessedValue))

How to call defined slots from keypress event in qt / How to connect keypressed event with QPushbutton on gui?

折月煮酒 提交于 2021-02-11 04:52:57
问题 I am beginner to qt. I was working on calculator gui application, I have already defined slots like numPressed() when any of the number pushbutton is pressed on the calculator that will be displayed on the lineEdit. void Calculator::numPressed(){ QPushButton *button = (QPushButton *)sender(); QString buttonValue = button->text(); Qstring display = ui->lineEdit->text(); Qdouble ProcessedValue = previousValue + buttonValue.toDouble(); . . . ui->lineEdit->setText(QString::number(ProcessedValue))

C++ - QListWidget select first item

落花浮王杯 提交于 2021-02-11 04:33:55
问题 In my QMainWindow Constructor I read a database and fill my QListWidget with the items. Apparently there is no item selected so I have to do it on my own. I also have a slot which will be called when I click on an item in the list. I tried setCurrentRow( const int ) but if I do so the slot won't be called. I've seen the function setCurrentIndex( const QModelIndex & ) but I'm not familiar with the QModelIndex. How do I tell my QListWidget to select the first item and call the on_list_clicked

C++ - QListWidget select first item

北慕城南 提交于 2021-02-11 04:33:45
问题 In my QMainWindow Constructor I read a database and fill my QListWidget with the items. Apparently there is no item selected so I have to do it on my own. I also have a slot which will be called when I click on an item in the list. I tried setCurrentRow( const int ) but if I do so the slot won't be called. I've seen the function setCurrentIndex( const QModelIndex & ) but I'm not familiar with the QModelIndex. How do I tell my QListWidget to select the first item and call the on_list_clicked

C++ - QListWidget select first item

回眸只為那壹抹淺笑 提交于 2021-02-11 04:30:51
问题 In my QMainWindow Constructor I read a database and fill my QListWidget with the items. Apparently there is no item selected so I have to do it on my own. I also have a slot which will be called when I click on an item in the list. I tried setCurrentRow( const int ) but if I do so the slot won't be called. I've seen the function setCurrentIndex( const QModelIndex & ) but I'm not familiar with the QModelIndex. How do I tell my QListWidget to select the first item and call the on_list_clicked

C++ - QListWidget select first item

我的梦境 提交于 2021-02-11 04:30:24
问题 In my QMainWindow Constructor I read a database and fill my QListWidget with the items. Apparently there is no item selected so I have to do it on my own. I also have a slot which will be called when I click on an item in the list. I tried setCurrentRow( const int ) but if I do so the slot won't be called. I've seen the function setCurrentIndex( const QModelIndex & ) but I'm not familiar with the QModelIndex. How do I tell my QListWidget to select the first item and call the on_list_clicked

C++ - QListWidget select first item

瘦欲@ 提交于 2021-02-11 04:30:13
问题 In my QMainWindow Constructor I read a database and fill my QListWidget with the items. Apparently there is no item selected so I have to do it on my own. I also have a slot which will be called when I click on an item in the list. I tried setCurrentRow( const int ) but if I do so the slot won't be called. I've seen the function setCurrentIndex( const QModelIndex & ) but I'm not familiar with the QModelIndex. How do I tell my QListWidget to select the first item and call the on_list_clicked

Prevent tab cycling with Ctrl+Tab by default with QTabWidget

帅比萌擦擦* 提交于 2021-02-10 23:48:06
问题 I have the following example code that makes a three tab layout (with buttons on the third tab). By default, I can Ctrl + Tab / Ctrl + Shift + Tab to cycle between the tabs. How do I disable this functionality? In my non-example code, this is not desired behaviour. from PyQt4 import QtGui import sys def main(): app = QtGui.QApplication(sys.argv) tabs = QtGui.QTabWidget() push_button1 = QtGui.QPushButton("QPushButton 1") push_button2 = QtGui.QPushButton("QPushButton 2") tab1 = QtGui.QWidget()

Trouble in retrieving window size and widget size

南笙酒味 提交于 2021-02-10 23:27:59
问题 Here is the code for a camera surveillance system. In the configuration_page.py file I'm getting the size of the window as 100x30 despite using self.showMaximized() and resizeEvent() . The widgets present in it are also showing the size as 640x480 . I'm particularly interested in retrieving the size of a widget named self.mid_frame in CameraDisplay class present in config.py file. Earlier I was facing the same issue in dashboard.py file but I found a workaround by explicitly passing width and