×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    25

    QScrollarea content getting wrong focus

    This problem is related to non touch symbian devices.

    I have a top menu with a button.

    below that button i have made a simple scrollarea with buttons. Result OK, the focus were set on the buttons correctly.

    Then i made it a bit more complex:

    I added QFrames that holds a button.
    If i try to scroll up (From bottom), the focus is going like this:

    scrollareabutton5->topbutton->scrollareabutton4->topbutton->scrollareabutton3->topbutton->scrollareabutton2->topbutton->scrollareabutton1->topbutton
    when it should go like this:
    scrollareabutton5->scrollareabutton4->scrollareabutton3->scrollareabutton2->scrollareabutton1->topbutton

    NB! This works on the simulator, not on a device....
    Here is how it looks:


    I use the topbutton "Add frame with button" to add the Frame to the qscrollarea:

    Code:
    void MainWindow::on_pushButton_clicked()
    {
    
            qDebug() << "Button pushed";
    
            QFrame *frame = new QFrame(this->ui->scrollAreaWidgetContents);
            frame->setMinimumSize(50,50);
            frame->setFocusPolicy(Qt::NoFocus);
            QHBoxLayout *layout = new QHBoxLayout(frame);
            frame->setLayout(layout);
    
    
            QLabel *label = new QLabel("This a label", frame);
    
            QPushButton *button = new QPushButton(frame);
            button->setText("Button");
    
            layout->addWidget(label);
            layout->addWidget(button);
            ui->scrollAreaWidgetContentsLayout->addWidget(frame);
    
    }
    If someone want to test the project i can send them the file, or share it here?

    Thanks in advance!
    Last edited by ikteivi; 2011-04-18 at 08:38.

  2. #2
    Registered User
    Join Date
    Apr 2011
    Posts
    25

    Re: QScrollarea content getting wrong focus

    Solved by setting the navigation mode:

    QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder);

Similar Threads

  1. Not getting Focus gained event
    By himsymbian in forum Symbian
    Replies: 1
    Last Post: 2009-10-07, 09:00
  2. CEikCommandButton not getting focus
    By raj8nokiaforum in forum Symbian
    Replies: 3
    Last Post: 2009-06-11, 09:42
  3. Wrong content received from RPropery::Get
    By Schonfeldt in forum Symbian
    Replies: 7
    Last Post: 2008-04-22, 13:25

Posting Permissions

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