TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #62 · 4 апр.

Когда разрабатываете свой GUI с помощью PyQt для какого-либо софта бывает необходимо позаимствовать цвета из текущего стиля интерфейса. Например, чтобы правильно раскрасить свои виджеты, подогнав их по цвету. Ведь бывает, что ваш GUI используется в разных софтах. Причём некоторые со светлой темой а другие с тёмной. По умолчанию стили наследуются, но если вы задаёте какую-либо раскраску для части виджета через свой styleSheet, то требуется ссылаться на цвета текущего стиля. Как это сделать? Как получить нужный цвет из палитры имеющегося стиля? Это достаточно просто, нужно использовать класс QPalette и его роли. Например, мне нужно достать цвет текста из одного виджета и применить его в другом как цвет фона (не важно зачем именно так, просто захотелось😊). Получаем палитру виджета и сразу достаём нужный цвет, указав его роль. from PySide2.QtGui import QPalette color = main_window.palette().color(QPalette.Text) теперь можем использовать этот цвет в стилях my_widget.setStyleSheet(f'background-color: {color.name()};') Готово, мы динамически переопределили дефолтный стиль используя текущий стиль окна! На самом деле есть запись покороче, в одну строку и без лишних переменных. Не очень-то по правилам CSS, но Qt это понимает. my_widget.setStyleSheet('background-color: palette(Text);') Этот способ не подходит если вам нужно как-то модифицировать цвет перед применением в своих стилях. В этом случае потребуется первый способ. Зато он прекрасно сработает в файле .qss, то есть не придётся в коде прописывать раскраску отдельных элементов через ссылки на палитру, всё красиво сохранится в отдельном файле .qss! QListView#my_widget::item:selected { background: palette(Midlight); } Про имеющиеся роли можно почитать здесь🌍 #qt#tricks

Hashtags

Резултати

Пронајдени 375 слични објави

Пребарај: #dinner

当前筛选 #dinner清除筛选
Dishes.Cooking.Food

@cookingdish · Post #1060 · 30.12.2025 г., 19:43

Halal Cart Style Chicken & Rice with White Sauce 🍗🍚🥗 — Chicken — 🍗 8 boneless skinless chicken thighs 🥛 1/4 cup plain yogurt 🧄 1 tbsp garlic paste 🫚 1 tbsp ginger paste 🧄 1 tbsp garlic powder 🧅 1 tbsp onion powder 🌶 1 tbsp paprika 🌿 1 tsp cumin 🌿 1 tsp coriander ⚫️ 1 tsp black pepper 🌶 1 tsp chili flakes 📦 1 packet sazon 🍋 3 tbsp lemon juice 🧅 1 large onion (sliced) 🧂 2 tsp salt 🫒 1/2 cup olive oil (drizzle before baking) — Rice — 🫒 1/3 cup olive oil 🍚 3 cups basmati rice (washed & soaked) 🥣 1 tbsp chicken bouillon/vegeta 🌿 1/2 tsp turmeric 🌿 1 tsp cumin 🧂 2 tsp salt 📦 1 packet sazon 🍗 3 cups chicken stock/broth — Salad — 🧅 1/2 red onion 🥒 3 mini cucumbers 🍅 1 cup cherry tomatoes 🌿 Handful parsley (chopped) 🍋 Juice of 1/2 lemon 🧂 1/2 tsp salt 🥬 Shredded lettuce (side) — White Sauce — 🥛 1/2 cup plain yogurt 🍶 1/2 cup mayonnaise 🍋 2 tbsp lemon juice 🍶 2 tbsp white vinegar 🍬 1 tsp sugar 🌿 1 tsp dried parsley 🧂 1/2 tsp salt 💧 3 tbsp water (thin out) #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1059 · 29.12.2025 г., 16:13

Croissant French Toast Bake with Berries, Nutella & Pistachio Cream 🥐🍓🫐🍫 — Casserole — 🥐 4 large croissants 🫐 1/2 cup blueberries 🍓 1/2 cup sliced strawberries 🧈 Butter or cooking spray — Custard — 🥛 1 cup milk 🥛 1/2 cup heavy cream 🥚 3 eggs 🍨 2 tsp vanilla extract 🌿 1 tbsp cinnamon 🌰 1/8 tsp nutmeg 🧂 1/8 tsp salt 🍬 1/4 cup sugar — Toppings — 🫐 Fresh blueberries 🍓 Fresh strawberries 🍫 Nutella 🌰 Pistachio cream ❄️ Powdered sugar 🍯 Maple syrup #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1058 · 28.12.2025 г., 15:33

Beef Kofta with Tomato Salad & Garlic Tahini Mayo 🥙🍅🧄 — Kofta Ingredients — 🥩 2 lbs ground beef (90/10) 🌶 1 tbsp pepper paste 🫑 1 bell pepper (red/orange/yellow, finely diced) 🧅 1 onion (finely diced) 🧄 2 garlic cloves (minced) 🌿 1/3 cup parsley (chopped) 🌶 1 tsp paprika 🧄 1 tsp garlic powder 🧅 1 tsp onion powder 🌱 1/2 tsp cumin 🌱 1/2 tsp coriander ⚫️ 1/2 tsp black pepper 🌶 1/2 tsp chili flakes 🧂 1 tbsp salt (or to taste) 🥤 1 tsp baking soda 🫒 Olive oil (for searing) — Tomato Salad — 🍅 1 large tomato (diced/sliced small) 🧅 1/2 red onion (diced/sliced small) 🌿 1/4 cup parsley (chopped) 🍋 Juice of 1/2 lemon 🫒 1–2 tbsp olive oil 🧂 1/4 tsp salt (or to taste) — Tahini Mayo — 🥄 1/2 cup mayonnaise 🥄 1 tbsp tahini 🧄 1–2 garlic cloves (minced) 🍋 Juice of 1/2 lemon 🧂 Pinch of salt — Other — 🥙 Pita bread 🥬 Lettuce #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1057 · 27.12.2025 г., 13:42

Garlic Parmesan Chicken Loaded Potatoes 🥔🧄 Ingredients: * 1 pack chicken strips * 5 medium potatoes * 40 g cream cheese * 50 g Parmesan * Mozzarella * 120 ml milk * Olive oil * Salt, paprika, mixed herbs * Garlic powder, minced garlic * Onion powder/granules #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1056 · 26.12.2025 г., 14:04

Choc Chip Banana Bread ✨🍌🤎 Ingredients: * 3 large ripe bananas (360–380 g) * 130 g unsalted butter (will reduce to \~115 g once browned) * 180 g dark brown sugar (+ 1–2 tbsp for topping) * 2 large eggs * 250 g plain flour * 1 tsp baking soda * ½ tsp salt * ½ tsp cinnamon * 70–100 g dark chocolate, chopped * Optional: chopped nuts #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1055 · 25.12.2025 г., 14:02

My Kind of Girl Dinner 😮‍💨🍚🥒 Ingredients: For the salmon: * 2 salmon fillets (skin removed, cut into cubes) * 2 tbsp soy sauce * 1 tbsp oyster sauce * 1 tsp brown sugar * 2 tsp minced garlic * 1 tbsp sriracha * ¼ tsp chili flakes For the rice & toppings: * 100 g sushi rice (cooked) * 1 tsp apple cider vinegar * ½ tsp salt * ½ tsp sugar * Pinch of chili flakes * ¼ cucumber, thinly sliced * ¼ small onion, thinly sliced * Handful of edamame (cooked) * Black & white sesame seeds, for topping #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1054 · 24.12.2025 г., 22:31

Halloumi Wraps ✨🌯 Ingredients: * 2 medium chicken breasts * 2 tsp smoked paprika * 2 tsp garlic powder * 1 tsp oregano * Salt & pepper to taste * 1 tbsp olive oil * 1 tbsp tomato purée * ½ block halloumi * 1.5 tbsp soft cheese * Lettuce * Red onion * 4 tortillas #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1053 · 23.12.2025 г., 14:03

Crispy Sweet & Spicy Roasted Brussels Sprouts 🥬🔥🍯 —Ingredients— 🥬 2 lbs Brussels sprouts (washed, trimmed, halved) 🫒 1/4 cup olive oil 🧂 1/2 tsp salt 🧈 4 tbsp unsalted butter 🧄 4 cloves garlic (minced) 🌶 2 tbsp Calabrian chili pepper (or preferred chili) 🌶 1 tsp paprika 🍯 1/4 cup honey #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1052 · 22.12.2025 г., 13:04

Creamy Green Bean Casserole 🥗🧄 —Ingredients— 🥬 1 lb green beans (washed, trimmed, cut in half) 🧈 3 tbsp unsalted butter 🧅 2–3 shallots (diced) or 1 large onion 🧄 5 cloves garlic (minced) 🧂 1/2 tsp salt ⚫️ 1/2 tsp black pepper 🌿 1/2 tsp thyme 🌶 1/8 tsp cayenne pepper 🌾 2 tbsp flour 🥛 1.5 cups heavy cream 🥛 1 cup milk 🧀 1 block Boursin cheese (garlic & fine herbs) 🧀 1 cup shredded Parmesan cheese 🧅 2.5 cups crispy fried onions #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1051 · 21.12.2025 г., 13:05

Mashed Potatoes with Homemade Gravy 🥔🧄 —Mashed Potatoes Ingredients— 🥔 5 lbs russet or Yukon gold potatoes 🧄 1 whole head garlic (peeled) 🧂 1/2 tbsp salt (for boiling) 🍗 6–8 cups chicken broth or stock (enough to cover potatoes) 🧈 1 stick unsalted butter 🥛 1 cup heavy cream 🥄 1/2 cup sour cream ⚫️ 1/2 tsp white or black pepper 🧂 1/4 tsp salt (to taste) —Gravy Ingredients— 🧈 4 tbsp butter 🧅 1 shallot (finely diced) 🧄 2 cloves garlic (minced) 🌾 1/4 cup flour 🍗 3.5 cups chicken broth or stock (reserved from potatoes) 🥄 1 tsp Dijon mustard ⚫️ 1/4 tsp black pepper 🧂 Sprinkle of salt #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1050 · 20.12.2025 г., 13:02

Delicata Squash Stuffing 🍞🎃 —Ingredients— 🍞 1 loaf Rustic Italian bread (cubed and dried) or 8–10 cups boxed bread cubes 🎃 1 Delicata squash 🧈 2 sticks unsalted butter 🥬 3 celery stalks 🧅 1 medium onion 🧂 1/4 tsp salt ⚫️ 1/4 tsp black pepper 🧄 5 garlic cloves 🌿 2 sprigs rosemary 🌿 3 sprigs thyme 🌿 1/2 cup chopped parsley 🥫 2 cans (10.5oz) Campbell's® Cream of Chicken Soup 🍗 3 cups chicken broth #dinner @dishes

Hashtags

Dishes.Cooking.Food

@cookingdish · Post #1049 · 18.12.2025 г., 13:05

Quick and Easy Snack or Appetizer 🥖✨ —Ingredients— 🥖 Baguette (sliced) 🫒 Extra virgin olive oil 🍶 Labneh 🫐 Olive tapenade 🍎 Pomegranate seeds #dinner @dishes

Hashtags

123•••10•••20•••303132
ПретходнаСтраница 1 од 32Следна