[Interest] QStackedWidget and QListView

Alexander Syvak alexander.svk at gmail.com
Sat Jul 27 02:04:48 CEST 2013


There's a model inherited from the QAbstractListModel. The dialog lay out
is implemented as following

    main_layout_raw_ptr = new (std::nothrow) QVBoxLayout;

    create_toolbar();

    main_layout_raw_ptr->addLayout(toolbars_layout_raw_ptr);

    create_central_layout();

    main_layout_raw_ptr->addLayout(central_layout_raw_ptr);

    this->setLayout(main_layout_raw_ptr);


The central layout is QHBoxLayout with two widgets: QListView and
QStackedWidget.

    central_layout_raw_ptr = new (std::nothrow) QHBoxLayout;

    listview_raw_ptr = new (std::nothrow) QListView;

    listview_raw_ptr ->setModel(list_model_raw_ptr);

    central_layout_raw_ptr->addWidget(listview_raw_ptr );

    stacked_pages_raw_ptr = new (std::nothrow) QStackedWidget;

    central_layout_raw_ptr->addWidget(stacked_pages_raw_ptr, 1); //
stretch factor is set

    connect(listview_raw_ptr ,SIGNAL(currentRowChanged(int)),

            stacked_pages_raw_ptr, SLOT(setCurrentIndex(int)) );


When the dialog is shown the next function body is executed


    emit beginResetModel();

    try

    {

        obs = psr.parse(events_src_file);

    }

    catch ( std::runtime_error & )

    {

        emit endResetModel();

        throw;

    }

    emit endResetModel();

However, the result is [image: Встроенное изображение 1]


Where is a mistake?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130727/48d74cf9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.PNG
Type: image/png
Size: 10216 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130727/48d74cf9/attachment.png>


More information about the Interest mailing list