Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Text Shadow Problem

Text Shadow Problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 658 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jondoeJ Offline
    jondoeJ Offline
    jondoe
    wrote on last edited by
    #1

    Hello,
    I want to do shadow for my label's and I using QGraphicsDropShadowEffect for this but my program crashing. Where is the problem ? Help me please.

    My codes

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QGraphicsDropShadowEffect>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect;
    effect->setBlurRadius(5);
    effect->setXOffset(5);
    effect->setYOffset(5);
    effect->setColor(Qt::black);
    ui->label->setGraphicsEffect(effect);
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {

    delete ui;
    

    }

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by dheerendra
      #2

      ui->setupUi(this);

      Make the above statement as first line in your constructor. It should work.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      2
      • F Offline
        F Offline
        Fener386
        wrote on last edited by Fener386
        #3

        I have exactly the same problem. Anyone got a suggestion? MyPremierCreditCard

        jsulmJ 1 Reply Last reply
        0
        • F Fener386

          I have exactly the same problem. Anyone got a suggestion? MyPremierCreditCard

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Fener386 Did you try what @dheerendra suggested?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved