Questions tagged [slots]

`__slots__` is a python language feature to reduce size of object instances by dropping the builtin dictionary every python instance normally features in order to support dynamic assignment of attributes and replacing it with a fixed set of attributes (the 'slots').

__slots__ is a python language feature to reduce size of object instances by dropping the builtin dictionary every python instance normally features in order to support dynamic assignment of attributes and replacing it with a fixed set of attributes (the 'slots'). See: https://docs.python.org/2/reference/datamodel.html#slots

306 questions
0
votes
2 answers

Qt Signals and Slots - nothing happens

I'm currently trying to connect a QML Signal to a C++ Slot unsuccessfully. I just had a look on several other examples but I think i didn't got it with how to get the root object of a qml document... My problem is, it seems like the signal will be…
DragonHawk
  • 39
  • 7
0
votes
2 answers

Qt moving slots function to another cpp file

I have a Qt project made by Qt creator. I let the creator itself generate a private slots function fx. on_pushbutton_clicked(). This function is declared in header, the function itself is in the cpp file created by the Qt creator. When I move the…
Gweana
  • 3
  • 3
0
votes
1 answer

setting fields by name on a class that have __slots__

i have a python class that is defined using __slots__, like so: class TheClass: __slots__=['foo','bar'] I would like to sets it values by name, like so the_object=TheClass() for x in ['foo','bar']: the_object[x]=x+x is that possible?
yigal
  • 3,923
  • 8
  • 37
  • 59
0
votes
1 answer

Qt window wont close using "this->close()" from other class

I will start off by explaining my main goal. I have a main window with 7 buttons on it(amongst other things), when you hit each button, it closes out the current window and opens up a new window. All the windows will have the same 7 buttons, so you…
user2494298
  • 299
  • 3
  • 7
  • 23
0
votes
1 answer

Connecting buttons to mainwindows slot

I tried to do a bunch of research on how to solve this problem, and everything is slightly different than my situation, or didn't work to fix my problem. I will start off by explaining my main goal. I have a main window with 7 buttons on it(amongst…
user2494298
  • 299
  • 3
  • 7
  • 23
0
votes
3 answers

Regarding already defined slots in arraylists

I'm wondering if it's possible to prefill the slots for an arraylist? For example, it is possible to fill out the st array by the assignment operation like this: student [] st = new student[3]; st[0] = new student("214365879","eric banner",…
user3034812
  • 1
  • 1
  • 1
0
votes
2 answers

why a connection's signal have argument but slot doesn't have one?

Qt 4.8.1,The original code just like this: connect(this->m_CodeMemoryComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateCodeMemoryFormate())); This really confuse me,[question]Can I pass an argument to the slot function when…
Zhang LongQI
  • 494
  • 1
  • 11
  • 25
0
votes
2 answers

How to call c++ function from qml and change the lable text

I'm new to Blackberry 10 development. I've created simple BB 10 cascades project. I want to change the text of a label through c++ function. main.qml import bb.cascades 1.0 Page { content: Container { id:…
Suresh Basina
  • 185
  • 1
  • 6
  • 14
0
votes
1 answer

Qt signals and slots in xml

I have been playing with Qt for some months now. I am teaching myself through coding and recreating code in various versions; QML, XML, C++, Gui. This approach is giving me a lot of insight. But I am stuck, The code below is mainly to do it all in…
0
votes
1 answer

Assign three slots to one signal

I want to assign three button's slot to a signal. namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QSignalMapper…
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117
0
votes
1 answer

itemDoubleClicked signal for subclass of QListWidgetItem

I have tried everything I know of (which admittedly isn't very much) and searched google for about an hour but I just can't figure this out. I have a class called PlaceHolder, which inherits from QListWidgetItem. I want to be able to register double…
KFox
  • 1,166
  • 3
  • 10
  • 35
0
votes
3 answers

assistance with slots program in java

public class slots { public static void main(String[]args) { public String pull() { int rand = (int)(Math.random()*3+1); if(rand == 1) return "cherries"; else if(rand == 2) return "bar"; …
eflam117
  • 23
  • 3
0
votes
1 answer

Qt - register multiple signals that when they've all emitted produce a giant signal connected to one slot

In my application I have the following situation: an object emits signal removeCharacter removeCharacter has a part A and B, and after part A is done it fires signal removePath slot onRemovePath is connected to signal removePath and will remove the…
mpellegr
  • 3,072
  • 3
  • 22
  • 36
0
votes
2 answers

Python __Slots__ (Making and Using)

I don't really get making a class and using __slots__ can someone make it clearer? For example, I'm trying to make two classes, one is empty the other isn't. I got this so far: class Empty: __slots__ =() def mkEmpty(): return…
Ecco
  • 27
  • 6
0
votes
1 answer

How to get the names of attributes when classes in Python use __slots__?

When I define a new-style class in Python, I can get the defined attributes (names and values) by using the __dict__-Attribute, that contains a dictionary of the things. I'd like to use slots in my classes and their subclasses, because I will…
AME
  • 2,499
  • 5
  • 29
  • 45