Results 1 to 2 of 2

Thread: QToolButton and scrollarea transparency

  1. #1
    Join Date
    Feb 2015
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default QToolButton and scrollarea transparency

    Hi i have scrollarea and i add object of QToolButton class in that area. When i try to set background color and transparency of QToolButton object in that scrollArea i got button with only solid color.
    .
    .
    .
    gridLayout = new QGridLayout;
    QWidget *viewport=new QWidget;

    viewport->setProperty("viewport",true);
    viewport->setStyleSheet("QWidget[viewport=true]{ background-color:rgba(255,0,0,0);border-image: url(:/icons/logo.png)0 0 0 0 stretch stretch }");
    viewport->setLayout(gridLayout);
    scrollArea = new QScrollArea;
    scrollArea->setStyleSheet("background-color:rgba(0,0,255,70)");
    scrollArea->setWidget(viewport);
    ui->proizvodL->addWidget(scrollArea);
    scrollArea->setWidgetResizable(true);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysO ff);
    scrollArea->setMinimumWidth(cScrollAreaSize);

    scrollArea->setMaximumWidth(900);
    scrollArea->setWidgetResizable(true);
    scrollArea->sizePolicy().setHorizontalStretch(1);
    scrollArea->sizePolicy().setVerticalStretch(1);

    .
    .
    .

    Proizvod *newProizvod=new Proizvod(query->value(2).toString(),query->value(2).toString(),query->value(2).toString(),false,query->value(3).toString(),
    query->value(0).toInt(),query->value(1).toInt(),query->value(5).toFloat());

    connect(newProizvod,SIGNAL(kliknuto(Proizvod*)),th is,SLOT(prikaziSveIzKategorije(Proizvod*)));

    proizvodi.insert(lastProizvodId,newProizvod);


    //ui->proizvodL->addWidget(newProizvod,lastProizvodId/6,lastProizvodId%6);
    gridLayout->addWidget(newProizvod,lastProizvodId/(scrollArea->size().width()/80),lastProizvodId%(scrollArea->size().width()/80));

    lastProizvodId++;

    newProizvod->setStyleSheet("background-color:rgba(0,0,255,30)");


    Why my button are not transparent ?
    How can i fix this?

    Thanks a lot

  2. #2
    Join Date
    Feb 2015
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QToolButton and scrollarea transparency

    I was solve my problem, fusion style was make trouble...

Similar Threads

  1. Help me about QGridLayout and ScrollArea
    By homerux in forum Newbie
    Replies: 3
    Last Post: 12th August 2013, 00:11
  2. scrollArea
    By skizzik in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2011, 12:55
  3. ItemViews in ScrollArea
    By SElsner in forum Newbie
    Replies: 3
    Last Post: 4th June 2010, 23:59
  4. Autoscroll in ScrollArea
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2009, 05:37
  5. QTreeWidget without the ScrollArea?
    By Paalrammer in forum Newbie
    Replies: 5
    Last Post: 13th February 2007, 19:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.