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
1
vote
1 answer

slots in class where main window has not been declared

The main window is declared in Class1. I am trying to create an object of Class2, create a widget( a push button) and connect it to a slot. import sys from PyQt4 import QtGui,QtCore class Class2(object): def __init__(self,parent): …
sudeepdino008
  • 3,194
  • 5
  • 39
  • 73
1
vote
2 answers

Qt connecting signals and slots

In my Qt project I've a QPushButton and a QLineEdit instances. And I want to set QLineEdit disabled when QPushButton is pressed. I've written this code: this->btn = new QPushButton(this); this->txt = new…
Kolyunya
  • 5,973
  • 7
  • 46
  • 81
1
vote
1 answer

How to disable cache for dynamic information in slots in Symfony 1.4

I'm building a music application in Symfony 1.4 Doctrine 1.2. I'm using slots to customize the facebook api metatags in my layout header. For example, when I browse a song page, the showSuccess for the song will have a slot like the one below,…
frankp221
  • 175
  • 3
  • 11
1
vote
2 answers

Anomaly at the intersection of __slots__, _fields_, and inheritance

When I run this (2.7.3) I get this output: 'Slotted1' object has no attribute 'c' attribute c added to I don't understand the difference in behavior between Slotted1 and Slotted2. Can anyone explain? from ctypes import…
phunctor
  • 599
  • 3
  • 9
1
vote
2 answers

PyQt pass filenames to common function

can I use a return statement from a slot function to provide input to a different 'lambda'd' slot? something along the lines of the following which I know does not work - as X and Y seem to just be boolean: class : mainwindow(QtGui.QMainWindow,…
mike_pro
  • 115
  • 7
0
votes
1 answer

Perl Qt 3.1 and threads

I have a class which isa Qt::Object and has a method that creates a thread. Whenever I attempt to detach or join the thread it seg faults. Also the emit signal is not working. Sample code is: package MyThread; use threads; use Qt; use Qt::isa…
user75898
  • 283
  • 2
  • 4
  • 10
0
votes
0 answers

Can't use connect on a class that inherits from QObject

I've been trying to create a timer that every time it runs out it will add something to a list. To do this i need to add a slot to the signal of the timer running out. #ifndef GAMEMODEL_H #define GAMEMODEL_H #include #include…
0
votes
0 answers

Azure App Service Manage swap slots finishes, but images are not swapped

I am trying to automate my release pipeline to swap slots on my app service. I am swapping my staging slot with the production one. Note: I also have a task before swap slots that restarts the staging slot to take in the new image. The task seems to…
Dave
  • 727
  • 1
  • 9
  • 20
0
votes
0 answers

How does the bootstrap-vue scoped-slot syntax for b-tables work behind the scenes?

When looking at the documentation I see you can insert dynamic content into the table using scoped slots and having access to the parent data. The pattern to archieve this is: v-slot:cell(Delete)="data". I understand that the data are the slot-props…
0
votes
0 answers

Grounds Slots booking in flutter(Get) firebase app

Project: Sports Ground Booking I want to show the date, slots, and rate for a respected date in ground details where the user can book slots respected to date and which slots are booked, those slots will be disabled for booking. And how to add data…
0
votes
0 answers

nextjs13.4 @folder/loading.js not functioning correctly

I am trying to familiarize myself with NEXTJS 13.4 I have this app directory on a local project App dir Screenshot and I have this code on app/platform/layout.tsx "use client"; import { CactusLayout, CactusSection } from…
0
votes
2 answers

Dataclasses and slots causing ValueError: 'b' in __slots__ conflicts with class variable

I don't understand the error message and also couldn't find other SO questions and answers helping me to understand this. The MWE is tested with Python 3.9.2. I'm aware that there is a slots=True parameter in Pythons 3.10 dataclasses. But this isn't…
buhtz
  • 10,774
  • 18
  • 76
  • 149
0
votes
1 answer

Why does slotting work in this component without specifying the slot name?

I have two Web Components made with Stencil.js. A Dropdown and a Card. Inside my Dropdown, I have this: I nest the two child elements like this:
happy_story
  • 1
  • 1
  • 7
  • 17
0
votes
1 answer

Store an array, or a list, of fixed length as a class attribute using slots in python

I have an object that represents a User and a variable measured 20 times. The object will be something like this: class User: user_id: str measures: List[float] #this is a list(or an array) of size 20 Given that I have many users that I…
Pablo
  • 3,135
  • 4
  • 27
  • 43
0
votes
1 answer

Why is ::part() not working for slotted Stencil elements?

My HTML: Inside the my-dropdown…
happy_story
  • 1
  • 1
  • 7
  • 17