6#include "QskSelectionSubWindow.h"
7#include "QskSimpleListBox.h"
16 return qobject_cast< QskSimpleListBox* >( subWindow->contentItem() );
22 return qobject_cast< QskSimpleListBox* >( subWindow->contentItem() );
32 setObjectName( QStringLiteral(
"QskSelectionSubWindowListBox" ) );
34 connect(
this, &QskSimpleListBox::selectedRowChanged,
35 subWindow, &QskSelectionSubWindow::selectedRowChanged );
37 connect(
this, &QskSimpleListBox::selectedEntryChanged,
38 subWindow, &QskSelectionSubWindow::selectedEntryChanged );
40 connect(
this, &QskSimpleListBox::entriesChanged,
41 subWindow, &QskSelectionSubWindow::entriesChanged );
46QskSelectionSubWindow::QskSelectionSubWindow( QQuickItem* parent )
49 auto listBox =
new ListBox(
this );
51 listBox->setPreferredSize( 500, 500 );
54 setContentItem( listBox );
55 setDialogActions( QskDialog::Ok | QskDialog::Cancel );
58QskSelectionSubWindow::~QskSelectionSubWindow()
62void QskSelectionSubWindow::setEntries(
const QStringList& entries )
64 if (
auto listBox = qskListBox(
this ) )
65 listBox->setEntries( entries );
68QStringList QskSelectionSubWindow::entries()
const
70 if (
auto listBox = qskListBox(
this ) )
71 return listBox->entries();
76void QskSelectionSubWindow::setSelectedRow(
int row )
78 if (
auto listBox = qskListBox(
this ) )
79 listBox->setSelectedRow( row );
82int QskSelectionSubWindow::selectedRow()
const
84 if (
auto listBox = qskListBox(
this ) )
85 return listBox->selectedRow();
90QString QskSelectionSubWindow::selectedEntry()
const
92 if (
auto listBox = qskListBox(
this ) )
93 return listBox->selectedEntry();
98#include "moc_QskSelectionSubWindow.cpp"