[Qt-interest] Need Help on applying Style for Application

Harsha T harsha123 at gmail.com
Fri Sep 25 12:56:39 CEST 2009


Thanks for the Reply.

I want to set my widget to mac style. I am very new to this QT. I just
completed 1 st chapter. Please help. Here is my program.

#include <QApplication>

#include <QHBoxLayout>

#include <QSpinBox>

#include <QSlider>

#include <QStyle>

int main(int argc, char* argv[])

{

QApplication::setStyle("macintosh");

QApplication app(argc, argv);

QWidget *window = new QWidget();

window->setWindowTitle("Age Application");

QSpinBox *spinBox = new QSpinBox();

QSlider *slider = new QSlider(Qt::Horizontal);

spinBox->setRange(0,135);

slider->setRange(0,135);

QObject::connect(spinBox,SIGNAL(valueChanged(int)),slider,SLOT(setValue(int)));

QObject::connect(slider,SIGNAL(valueChanged(int)),spinBox,SLOT(setValue(int)));

spinBox->setValue(35);

QHBoxLayout *layout = new QHBoxLayout();

layout->addWidget(spinBox);

layout->addWidget(slider);

window->setLayout(layout);

window->show();

return app.exec();

}



Thank you

Harsha

On Fri, Sep 25, 2009 at 4:19 PM, Raja Rokkam <rokkamraja at gmail.com> wrote:

> http://doc.trolltech.com/4.5/qstyle.html#details This will help you in
> doing what you want...
>
> -Raja.
>
>  On Fri, Sep 25, 2009 at 4:09 PM, Harsha T <harsha123 at gmail.com> wrote:
>
>>   Hello All,
>>
>> I am very new to QT and trying to apply style for the entire application.
>> I want to apply macintosh style for my application on XP, Is it possible.
>> Thanks in advance.
>>
>> -Harsha
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>


-- 
Rgds
Harsha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090925/ca758152/attachment.html 


More information about the Qt-interest-old mailing list