signals

pyQt signals/slots with QtDesigner

别说谁变了你拦得住时间么 提交于 2019-12-05 21:21:03
I'm trying to write a program that will interact with QGraphicsView. I want to gather mouse and keyboard events when the happen in the QGraphicsView. For example, if the user clicks on the QGraphicsView widget I will get the mouse position, something like that. I can hard code it rather easily, but I want to use QtDesigner because the UI will be changing frequently. This is the code that I have for the gui.py. A simple widget with a QGraphicsView in it. from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui

IR Remote control app

纵然是瞬间 提交于 2019-12-05 21:17:43
I'm making a remote control app with 6 buttons which works with samsung tv's. For kitkat I used the new api ConsumerIRmanager but I want the app to work with jellybean also so the app works great for kitkat version but it won't start on jellybean here is the code: public class MainActivity extends Activity { Object irdaService; Method irWrite; SparseArray<String> irData; TextView mFreqsText; ConsumerIrManager mCIR; ImageButton power; SeekBar sBar; @Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState);

Getting Signal Strength RSCP and Ec/Io from a phone served by a HSPA network

一个人想着一个人 提交于 2019-12-05 21:13:43
I am trying to capture Signal Strength and Ec/Io from my Android app on a phone that's on at&t network. When a phone is being served on WCDMA / HSDPA network, the pertinent RF measurements are RSCP and Ec/Io. How do I obtain the current RSCP and Ec/Io? The GSM Signal Strength and GSM Bit Error Rate are not applicable when the phone is camping on 3G (UMTS/HSDPA/HSPA/HSUPA) network. Thanks. Dillon ShutterBC The signal strength indicator uses the following: [android.telephony.PhoneStateListener][1] If you're using an i9000 based modem, you can dial the following: * #0011# This will give you the

No overload matches this call. Type 'string' is not assignable to type 'Signals'

允我心安 提交于 2019-12-05 21:12:03
问题 I am using typescript to build a micro service and handling signals as well. The code was working fine till few days ago but recently it started throwing error. Couldn't find a fix for the issue. code for handling signals. It is just part of the file. src/main.ts enum signals { SIGHUP = 1, SIGINT = 2, SIGTERM = 15 } const shutdown = (signal, value) => { logger.warn("shutdown!") Db.closeAll() process.exit(value) } Object.values(signals).forEach(signal => { process.on(signal, () => { logger

Qt - How to disable QCheckBox while retaining checked state?

荒凉一梦 提交于 2019-12-05 20:03:34
I have a dialog with two checkboxes, let's call them A and B. When A is NOT checked, B should be able to be toggled as the user desires. When A IS checked, B should not be able to be toggled. Right now I have the following in my constructor function for the dialog: connect(ui->A, SIGNAL(toggled(bool)), this, SLOT(setBCheckable(bool))); ...and then I have that function as this: void MyClass::setBCheckable(bool AChecked) { if(AChecked) { ui->B->setCheckable(false); } else { ui->B->setCheckable(true); } } However, when I do this, I've noticed that when I click A, B will APPEAR to retain it's

How to get user data for aio signal handler in Mac OS X

假装没事ソ 提交于 2019-12-05 17:59:31
I am attempting to use the aio_* functions for asynchronous file IO under Mac OS X, but I am having problems with getting some form of user data into the signal handler. This is the code that sets up an operation: class aio_context { public: aio_context(int fildes, boost::uint64_t offset, const MyBufferClassPtr &buffer) { // The aiocb struct must be zeroed memset(&m_aiocb, 0, sizeof(struct aiocb)); // Set what to do m_aiocb.aio_fildes = fildes; m_aiocb.aio_buf = buffer->data(); m_aiocb.aio_nbytes = buffer->size(); m_aiocb.aio_offset = offset; // Set notification m_aiocb.aio_sigevent.sigev

GTK+ (2.0) - signal “clicked” on GtkEntry?

坚强是说给别人听的谎言 提交于 2019-12-05 16:58:04
I'm testing some signals with GTK+ 2.0. I'm looking for a way to get a signal emitted when I click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry ( widgets_info[i].text ) and i want this text to disappear if the user click on my GtkEntry. Does someone know what is this signal? (Sorry for my English) Try focus-in-event , note that you must enable focus

Sending SIGINT from keyboard to piped commands in bash

旧城冷巷雨未停 提交于 2019-12-05 16:11:39
问题 If in bash I run a | b | c | d on the command line and then press ^C , which process gets the signal? 回答1: In short, they all do. When setting up a pipeline, the shell creates a process group . ^C is interpreted by the kernel's line discipline as the user's request to interrupt the process group currently running in the foreground. Sending a signal such as SIGINT to a process group automatically delivers the signal to all processes in the group. 回答2: I like experimentation better: #!/bin/bash

Is it possible to send a signal to process that belongs to different user?

大城市里の小女人 提交于 2019-12-05 16:08:11
I need to send a signal to different process for some real-time communication, however the process belongs to different user. For example PID user group 1234 foo foobar 4321 bar foobar I want process 1234 and 4321 to be able to send signals to each other? If I was using sockets or pipes I could set their mask to rw-rw-r-- and communication would work. However I need to do the communication using signals (ordinary or real time, not important). Is there a way to do it? Quote from kill(2): For a process to have permission to send a signal it must either be privileged (under Linux: have the CAP

How do I trigger the default signal handling behavior?

青春壹個敷衍的年華 提交于 2019-12-05 15:41:21
In my Java application I want to capture SIGINTs, do some pre-processing, and then let the default behavior (process termination) run. I would think I could do something like this: Signal.handle(new Signal("INT"), new SignalHandler() { @Override public void handle(Signal signal) { // preprocessing // ... // now do default behavior SignalHandler.SIG_DFL.handle(signal); } }); However when I send at SIGINT to this application, I get a SEGV : # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000000000000000, pid=10261, tid=21507 # # JRE version: Java