×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Problem with StyleSheet

    Hi all!

    I have trouble when using StyleSheet in QT symbian. When not using the stylesheet everything is normal but if I set the StyleDheet for Button the border appears in content area as shown below:


    In the second photo I set StyleSheet for PushButton :
    ui.pushButton->setStyleSheet("text-align: center left;");
    Not only QPushButton, QTabWdget, QToolButton also seen similar cases.
    Someone please help me solve this problem!
    Thank for your help!

    I’m using : S60_3rd_FP2_SDK_v1.1
    qt-symbian-opensource-4.6.2
    Carbide.c++_v2.3
    Language: Vietnamese
    I have tested in Emulator and Nokia E63.

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Thumbs up Re: Problem with StyleSheet

    Check this below thread and answer about stylesheet in Qt..
    Thread

    ok.

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Problem with StyleSheet

    Try to add this code to main function and remove other setStyleSheet calls.
    Code:
    QApplication app(argc, argv);
    app.setStyleSheet("QPushButton { text-align: left; }");

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    Thank divanov!!

    I have tried your solution but no success. The border till there

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Problem with StyleSheet

    Please, make a screenshot of this sample application in your environment:
    Code:
    #include <QtGui>
    
    int main (int argc, char **argv)
    {
        QApplication app(argc, argv);
        app.setStyleSheet("QPushButton { text-align: left }");
    
        QMainWindow window;
    
        QPushButton *button1 = new QPushButton("Button 1");
        QPushButton *button2 = new QPushButton("Button 2");
        QVBoxLayout *layout = new QVBoxLayout();
        layout->addWidget(button1);
        layout->addWidget(button2);
        QWidget widget;
        widget.setLayout(layout);
        window.setCentralWidget(&widget);
        window.show();
    
        return app.exec();
    }

  6. #6
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    Hi divanov.
    This is the results with your code:


  7. #7
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Problem with StyleSheet

    Quote Originally Posted by Zombieisme View Post
    Hi divanov.
    This is the results with your code:

    Great! This frame is actually a focus.

  8. #8
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    But I want the black border not showing up when the button has focus

  9. #9
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Problem with StyleSheet

    Could you please make a screenshot of this sample application?
    Code:
    #include <QtGui>
    
    int main (int argc, char **argv)
    {
        QApplication app(argc, argv);
        //app.setStyleSheet("QPushButton { text-align: left }");
    
        QMainWindow window;
    
        QPushButton *button1 = new QPushButton("Button 1");
        QPushButton *button2 = new QPushButton("Button 2");
        QVBoxLayout *layout = new QVBoxLayout();
        layout->addWidget(button1);
        layout->addWidget(button2);
        QWidget widget;
        widget.setLayout(layout);
        window.setCentralWidget(&widget);
        window.showMaximized();
    
        return app.exec();
    }

  10. #10
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    Quote Originally Posted by divanov View Post
    Could you please make a screenshot of this sample application?
    It here. No StyleSheet - No Border


  11. #11
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Problem with StyleSheet

    We generally avoid that box by using setFocusPolicy(Qt::NoFocus).

  12. #12
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    Quote Originally Posted by danhicksbyron View Post
    We generally avoid that box by using setFocusPolicy(Qt::NoFocus).
    Hi danhicksbyron !
    Sorry for my delay.

    My application use keypad to change focus, so if set NoFocus I can focus on the Button

  13. #13
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Problem with StyleSheet

    Hi,

    It is a bug in the QS60Style. I already created an error about it to JIRA (Qt's error handling tool): http://bugreports.qt.nokia.com/browse/QTBUG-10549.

    S.

  14. #14
    Registered User
    Join Date
    Mar 2010
    Posts
    53

    Re: Problem with StyleSheet

    Quote Originally Posted by Fuzzbender View Post
    Hi,

    It is a bug in the QS60Style. I already created an error about it to JIRA (Qt's error handling tool): http://bugreports.qt.nokia.com/browse/QTBUG-10549.

    S.
    Thank Fuzzbender !

Similar Threads

  1. Problem with CAknDoubleStyleListBox with a CAknSearchField
    By jjig in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-09-17, 00:58
  2. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  3. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  4. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  5. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×