According to the link ,I have done it vertically but I want to do the things horizontally as I have mentioned in the link but cant able to....Can somebody please help me....
https://picasaweb.google.com/pradhikari88/NOKIA#
Printable View
According to the link ,I have done it vertically but I want to do the things horizontally as I have mentioned in the link but cant able to....Can somebody please help me....
https://picasaweb.google.com/pradhikari88/NOKIA#
Maybe, if you explain what the problem is, post the code etc.Quote:
Can somebody please help me....
Code:
bgWidget->setStyleSheet("QWidget#bgWidget{background-image: url(:/images/Resource/n8_home_bg.jpg);}"); // create buttons " border: 1px solid #333; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #0f3f5c, stop: 1 #0a354e);\n" "}\n" "\n" "QPushButton#video:pressed{\n" " border: 1px solid #333; \n" " color: #8a9fac; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #adcbd9, stop: 1 #fff);\n" "}")); video->setFixedHeight(80); video->setFont(sansFont); " border: 1px solid #333; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #0f3f5c, stop: 1 #0a354e);\n" "}\n" "\n" "QPushButton#photo:pressed{\n" " border: 1px solid #333; \n" " color: #8a9fac; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #adcbd9, stop: 1 #fff);\n" "}")); photo->setFixedHeight(80); photo->setFont(sansFont); " border: 1px solid #333; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #0f3f5c, stop: 1 #0a354e);\n" "}\n" "\n" "QPushButton#radio:pressed{\n" " color: #8a9fac; \n" " border: 1px solid #333; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #adcbd9, stop: 1 #fff);\n" "}")); radio->setFixedHeight(80); radio->setFont(sansFont); " border: 1px solid #333; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #0f3f5c, stop: 1 #0a354e);\n" "}\n" "\n" "QPushButton#news:pressed{\n" " border: 1px solid #333; \n" " color: #8a9fac; \n" " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #adcbd9, stop: 1 #fff);\n" "}")); news->setFixedHeight(80); news->setFont(sansFont); // Setup button layouts buttonLayout->setContentsMargins(0,150,0,3); buttonLayout->setSpacing(3); buttonLayout->addWidget(video); buttonLayout->addWidget(photo); buttonLayout->addWidget(radio); buttonLayout->addWidget(news); bgWidget->setLayout(buttonLayout); // Setup main layout mainLayout->setContentsMargins(0,0,0,0); mainLayout->addWidget(bgWidget); this->setLayout(mainLayout);
So just change from QVBoxLayout to QHBoxLayout.
Thanks for your reply....I tried but not working....Actually I want my QLabel should appear from top of the buttons to the lefthand side of the Buttons as I have mensioned the images in my link..My vertical and horizontal view are coming properly but I want It should appear like the horizontal image I have given....I have tried a lot in all the way I know but cant able to.....could you please tell me exactly what I have to do in this....
Show your code (that is not working)Quote:
.I tried but not working..
I have done upto this and here how can I declare a function based on my screen size ....means if (screen size =someValue)
stackedWidget->setCurrentIndex(0);
can anybody please tell me how should I declare a function for this
i'm getting my screen size like this...
SIZE:: QSize(360, 640)
SIZE:: QSize(640, 360)
Code:
#include <QtGui/QVBoxLayout> #include <QtGui/QPushButton> #include <QtGui> #include <QResizeEvent> #include "rotate.h" { video1->setFixedHeight(80); photo1->setFixedHeight(80); radio1->setFixedHeight(80); news1->setFixedHeight(80); buttonLayout1->setContentsMargins(0,150,0,3); buttonLayout1->setSpacing(3); buttonLayout1->addWidget(video1); buttonLayout1->addWidget(photo1); buttonLayout1->addWidget(radio1); buttonLayout1->addWidget(news1); vWidget->setLayout(buttonLayout1); ///////////////////////////////////////////////////////// video2->setFixedHeight(60); photo2->setFixedHeight(60); radio2->setFixedHeight(60); news2->setFixedHeight(60); buttonLayout2->addWidget(video2); buttonLayout2->addWidget(photo2); buttonLayout2->addWidget(radio2); buttonLayout2->addWidget(news2); hLayout2->addWidget(home); hLayout2->addWidget(back); vLayout2->addWidget(label); vLayout2->addLayout(hLayout2); hLayout3->addLayout(vLayout2); hLayout3->addLayout(buttonLayout2); hWidget->setLayout(hLayout3); /////////////////////////////////////////////////////////////// stackedWidget->addWidget(vWidget); stackedWidget->addWidget(hWidget); layout->addWidget(stackedWidget); setLayout(layout); stackedWidget->setCurrentIndex(1); } { qDebug()<<"SIZE::"<<qApp->desktop()->size(); }