qt-slot

Automatically create QStackedWidget pages based on Tuple

独自空忆成欢 提交于 2019-12-11 16:28:45
问题 I'm fairly new to python, and I feel this is an advanced question, with that in mind it might be out of the scope of Stack Exchange. Please bear with me. I have a QTreeWidget and QStackedWidget. I have populated the QTreeWidget using a tuple TreeList = ({ 'Header1': (( 'Item11', 'Item12', )), 'Header2': (( 'Item21', 'Item22' )) }) for key, value in TreeList.items(): root = QTreeWidgetItem(self.QTreeWidget, [key]) for val in value: root.addChild(QTreeWidgetItem([val])) I would like to use this

Why a new signal for socket::readyRead() is executed, even when its earlier slot is still processing?

☆樱花仙子☆ 提交于 2019-12-10 13:24:31
问题 According to following post an emitted signal is served, only once the currently executing slot completes. Wait for a SLOT to finish the execution with Qt I have a client-server communication app based on ssl socket, which is single threaded. connect(socket, &QSslSocket::readyRead, [&]() { myObject.Read(); }); Client & server send each other some custom messages. Whenever a message is sent or received by either, they send ACK bytes (00). Most of the times, I notice that when the Read() is in

My signal / slot connection does not work

久未见 提交于 2019-11-26 00:38:21
问题 I repeatedly see people having problems with slots not being called. I would like to collect some of the most common reasons. So maybe I can help people and avoid a lot of redundant questions. What are reasons for signal / slot connections not working? How can such problems be avoided? 回答1: There are some rules that make life with signals and slots easier and cover the most common reason for defective connections. If I forgot something please tell me. 1) Check the debug console output: When

Passing an argument to a slot

早过忘川 提交于 2019-11-25 23:44:33
问题 I want to override mouseReleaseEvent with a bunch of QActions and QMenus... connect(action1, SIGNAL(triggered()), this, SLOT(onStepIncreased())); connect(action5, SIGNAL(triggered()), this, SLOT(onStepIncreased())); connect(action10, SIGNAL(triggered()), this, SLOT(onStepIncreased())); connect(action25, SIGNAL(triggered()), this, SLOT(onStepIncreased())); connect(action50, SIGNAL(triggered()), this, SLOT(onStepIncreased())); So I want to pass an argument to the slot onStepIncreased (as you