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

Using class as a placeholder in Python3

Ive seen many tutorials on classes in python, but I'm trying to do something far more basic with them, but somehow it isnt working right. I'm trying to make 3 dimensional points by putting them into the class's placeholder. However when I try to…
0
votes
2 answers

connect() seems to prefix signal with wrong namespace

I'm trying to use signals and slots to pass information to the GUI thread from another thread, as I can't modify a pixmap from any other thread. I'm encountering a runtime error: Object::connect: No such signal QThread::image_change(std::string) in…
dutchgold92
  • 125
  • 1
  • 1
  • 6
0
votes
1 answer

How to create a Tree-based Map with keys

For my intro to computer science class we have a tree based map problem. I'm getting really confused on how to make the tree in the fashion they are asking it. What I have so far: class EmptyMap(): __slots__ = () class NonEmptyMap(): …
Joe Jankowiak
  • 1,059
  • 12
  • 37
0
votes
1 answer

Qt- Simple Signal & Slot Misscommunication

I have a Thread class thats derives from QThread: class Thread : public QThread { Q_OBJECT public: Thread(QObject* parent = NULL); ~Thread(void); virtual void run(); void stop(); public slots: virtual void…
David Menard
  • 2,261
  • 3
  • 43
  • 67
0
votes
1 answer

__slots__ and unbound methods

I need a small help with slots. class bstream(object): __slots__ = ['stream'] stream = string() def __new__(self, stream, encoding=None): if encoding == None: encoding = ENCODING['default'] if isinstance(stream, bytes): …
ghostmansd
  • 3,285
  • 5
  • 30
  • 44
0
votes
1 answer

Get Slot path from url in Google publisher tag

I am working on google publisher tag.Is there any way to get slot path from url • Slot Path: /1111/abc.com.au/xx/xxx Any way to get the value of x's from the url. Please help
gaurav
  • 21
  • 2
0
votes
1 answer

PHP Slots, generating combinations

So I have an array of possible combinations: $faces = array ('Bar', 'Cherry', 'Lemon', 'Seven', 'DoubleBar', 'TripleBar'); And an array of payouts $payouts = array ( 'Bar|Bar|Bar' => '5', 'Double Bar|Double Bar|Double Bar' => '10', 'Triple…
Madmadmax
  • 79
  • 3
  • 10
0
votes
2 answers

Qt: why does connect() work only in the main window class?

Here's a simple code that creates a button and assigns a onclick handler: auto btn = new QPushButton("CLICK ME"); connect(btn, SIGNAL(clicked()), this, SLOT(btn_Click())); private slots: void btn_Click() { alert("clicked!"); } It works as it…
Alex
  • 34,581
  • 26
  • 91
  • 135
-1
votes
1 answer

Slot problems with QT, linker error

Was wanting to ask about a linker error I keep getting. I installed QT and am using it on Visual Studio 2005. Basically whenever i try and declare a slot I get this linker error message. Error 1 error LNK2019: unresolved external symbol "public:…
Bushes
  • 1,010
  • 1
  • 18
  • 37
-1
votes
1 answer

Vue 3 composition api slot multiple level nesting

I wanna write custom vue 3 component for collapse. It has button and collapsible content. But button and collapsible content are not always at the same level in template. For example, Button can be part of an input-group. So, here is multi level…
-1
votes
1 answer

How do advertise networks drive ad to publisher slots by javascript tag embed?

Advertising networks such as Google, Taboola, and others are linking advertisers and publishers as an advertising ecosystem to drive ads to publisher slots (Nativ/HTML5/Banner..ex). by javascript tag...How do ad networks handle and show those ads…
TahaBA
  • 99
  • 2
-1
votes
1 answer

Vue3 passing a slot from parent to grandchild with props

I am trying to pass a custom component as slot from a parent component to grandchild with props that are calculated in child. The grandchild component has a v-for loop in it, and the component that is eventually passed to the it gets its props from…
fnisi
  • 1,181
  • 1
  • 14
  • 24
-1
votes
1 answer

Pass multiples arguments to a slot Qt

I'm using a Qt horizontal slider and I want to connect its valueChanged signal to a slot I defined. However I need to access a specific member inside this slot to modify a variable thanks to the int I set with the slider. Until now, my connect line…
user17429375
-1
votes
1 answer

Static typing for `__slots__` in python

I know that python used duck typing, but I was wondering whether it is possible to enforce type validation for class variables, __slots__ in particular. for example - class Student: def __init__(self, name): self.name = name class Class: …
aaryan
  • 2,229
  • 2
  • 10
  • 15
-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 2 3
20
21