Results 1 to 1 of 1

Thread: background/border style is repeated on other widgtes

  1. #1
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default background/border style is repeated on other widgtes

    Hi,

    I am trying to make the UI similar to modren mobile phones with transparent background.

    in the following program the background image is either repeating/or the icons are placed in a box like struture.

    I have few questions:
    1) is there any way to to display just icons without background/border image and box shape.
    2) need to display icons starting from top left position in a gridlayout
    3) whenever i select the icon it should be differentiated by making the background dim or box around.


    i have attached the screens with both background(backgr.png) and border(bord.png) , but that not is not totally what i want.

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : QMainWindow(parent)
    3. {
    4. QWidget *neww = new QWidget(parent);
    5. //neww->setStyleSheet("background-image: url(:/green2.jpeg);background-repeat: none; border: none");
    6. neww->setStyleSheet("border-image: url(:/green2.jpeg);background-repeat: none; border: none");
    7. setCentralWidget(neww);
    8. neww->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
    9. QPushButton *neww1 = new QPushButton;//(neww);
    10. QPushButton *neww2 = new QPushButton;//(neww);
    11. neww2->setIcon(QIcon(":/1.png"));
    12. neww1->setIcon(QIcon(":/home.png"));
    13. neww1->setFixedSize(QSize(50,50));
    14. neww2->setFixedSize(QSize(50,50));
    15.  
    16. QHBoxLayout *hlayout = new QHBoxLayout;
    17.  
    18. hlayout->addWidget(neww1,0, Qt :: AlignTop |Qt :: AlignLeft);
    19. hlayout->addWidget(neww2,Qt :: AlignTop |Qt :: AlignLeft);
    20. //Qt :: AlignHorizontal_Mask|
    21. neww->setLayout(hlayout);
    22.  
    23. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. Replies: 0
    Last Post: 2nd April 2013, 10:48
  2. 3D Border Style for Rectangle in QML
    By tauseef in forum Qt Programming
    Replies: 1
    Last Post: 2nd April 2013, 06:10
  3. negative border radius style sheet
    By matteo.ceruti in forum Qt Programming
    Replies: 0
    Last Post: 23rd December 2011, 14:19
  4. QWidget's border style
    By luochen601 in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2010, 07:17
  5. Window Style: No border but resizable
    By Peppy in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2010, 18:21

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.