Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
||||
remove_definitions(-DQT_NO_CAST_TO_ASCII)
|
||||
|
||||
include(ECMMarkAsTest)
|
||||
|
||||
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
|
||||
|
||||
macro(kitemviews_executable_tests)
|
||||
foreach(_testname ${ARGN})
|
||||
add_executable(${_testname} ${_testname}.cpp)
|
||||
target_link_libraries(${_testname} Qt6::Test KF6::ItemViews)
|
||||
ecm_mark_as_test(${_testname})
|
||||
endforeach(_testname)
|
||||
endmacro()
|
||||
|
||||
kitemviews_executable_tests(
|
||||
kcategorizedviewtest
|
||||
kwidgetitemdelegatetest
|
||||
ktreewidgetsearchlinetest
|
||||
)
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
SPDX-FileCopyrightText: 2007, 2009 Rafael Fernández López <ereslibre@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QIcon>
|
||||
#include <QMainWindow>
|
||||
#include <QStringListModel>
|
||||
|
||||
#include <kcategorizedsortfilterproxymodel.h>
|
||||
#include <kcategorizedview.h>
|
||||
#include <kcategorydrawer.h>
|
||||
|
||||
QStringList icons;
|
||||
|
||||
class MyModel : public QStringListModel
|
||||
{
|
||||
public:
|
||||
QVariant data(const QModelIndex &index, int role) const override
|
||||
{
|
||||
switch (role) {
|
||||
case KCategorizedSortFilterProxyModel::CategoryDisplayRole: {
|
||||
return QString::number(index.row() / 10);
|
||||
}
|
||||
case KCategorizedSortFilterProxyModel::CategorySortRole: {
|
||||
return index.row() / 10;
|
||||
}
|
||||
case Qt::DecorationRole:
|
||||
return QIcon::fromTheme(icons[index.row() % 4]).pixmap(QSize(48, 48));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QStringListModel::data(index, role);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
icons << QStringLiteral("konqueror");
|
||||
icons << QStringLiteral("okular");
|
||||
icons << QStringLiteral("plasma");
|
||||
icons << QStringLiteral("system-file-manager");
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMainWindow *mainWindow = new QMainWindow();
|
||||
mainWindow->setMinimumSize(640, 480);
|
||||
KCategorizedView *listView = new KCategorizedView();
|
||||
listView->setCategoryDrawer(new KCategoryDrawer(listView));
|
||||
listView->setViewMode(QListView::IconMode);
|
||||
MyModel *model = new MyModel();
|
||||
|
||||
model->insertRows(0, 100);
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
model->setData(model->index(i, 0), QString::number(i), Qt::DisplayRole);
|
||||
}
|
||||
|
||||
KCategorizedSortFilterProxyModel *proxyModel = new KCategorizedSortFilterProxyModel();
|
||||
proxyModel->setCategorizedModel(true);
|
||||
proxyModel->setSourceModel(model);
|
||||
|
||||
listView->setModel(proxyModel);
|
||||
|
||||
mainWindow->setCentralWidget(listView);
|
||||
|
||||
mainWindow->show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
#include "ktreewidgetsearchlinetest.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHeaderView>
|
||||
#include <QPushButton>
|
||||
#include <QString>
|
||||
#include <QTreeWidget>
|
||||
|
||||
#include <ktreewidgetsearchline.h>
|
||||
#include <ktreewidgetsearchlinewidget.h>
|
||||
|
||||
KTreeWidgetSearchLineTest::KTreeWidgetSearchLineTest()
|
||||
: QDialog()
|
||||
{
|
||||
// to test KWhatsThisManager too:
|
||||
setWhatsThis(QStringLiteral("This is a test dialog for KTreeWidgetSearchLineTest"));
|
||||
tw = new QTreeWidget(this);
|
||||
tw->setColumnCount(4);
|
||||
tw->setHeaderLabels(QStringList() << QStringLiteral("Item") << QStringLiteral("Price") << QStringLiteral("HIDDEN COLUMN") << QStringLiteral("Source"));
|
||||
tw->hideColumn(2);
|
||||
|
||||
KTreeWidgetSearchLineWidget *searchWidget = new KTreeWidgetSearchLineWidget(this, tw);
|
||||
m_searchLine = searchWidget->searchLine();
|
||||
|
||||
QTreeWidgetItem *red = new QTreeWidgetItem(tw, QStringList() << QStringLiteral("Red"));
|
||||
red->setWhatsThis(0, QStringLiteral("This item is red"));
|
||||
red->setWhatsThis(1, QStringLiteral("This item is pricy"));
|
||||
tw->expandItem(red);
|
||||
QTreeWidgetItem *blue = new QTreeWidgetItem(tw, QStringList() << QStringLiteral("Blue"));
|
||||
tw->expandItem(blue);
|
||||
QTreeWidgetItem *green = new QTreeWidgetItem(tw, QStringList() << QStringLiteral("Green"));
|
||||
tw->expandItem(green);
|
||||
QTreeWidgetItem *yellow = new QTreeWidgetItem(tw, QStringList() << QStringLiteral("Yellow"));
|
||||
tw->expandItem(yellow);
|
||||
|
||||
create2ndLevel(red);
|
||||
create2ndLevel(blue);
|
||||
create2ndLevel(green);
|
||||
create2ndLevel(yellow);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
|
||||
QHBoxLayout *hbox = new QHBoxLayout();
|
||||
|
||||
QPushButton *caseSensitive = new QPushButton(QStringLiteral("&Case Sensitive"), this);
|
||||
hbox->addWidget(caseSensitive);
|
||||
caseSensitive->setCheckable(true);
|
||||
connect(caseSensitive, SIGNAL(toggled(bool)), SLOT(switchCaseSensitivity(bool)));
|
||||
|
||||
QPushButton *keepParentsVisible = new QPushButton(QStringLiteral("Keep &Parents Visible"), this);
|
||||
hbox->addWidget(keepParentsVisible);
|
||||
keepParentsVisible->setCheckable(true);
|
||||
keepParentsVisible->setChecked(true);
|
||||
connect(keepParentsVisible, SIGNAL(toggled(bool)), m_searchLine, SLOT(setKeepParentsVisible(bool)));
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
|
||||
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
layout->addWidget(searchWidget);
|
||||
layout->addWidget(tw);
|
||||
layout->addLayout(hbox);
|
||||
layout->addWidget(buttonBox);
|
||||
|
||||
m_searchLine->setFocus();
|
||||
|
||||
resize(350, 600);
|
||||
}
|
||||
|
||||
void KTreeWidgetSearchLineTest::create3rdLevel(QTreeWidgetItem *item)
|
||||
{
|
||||
new QTreeWidgetItem(item, QStringList() << QStringLiteral("Growing") << QStringLiteral("$2.00") << QString("") << QStringLiteral("Farmer"));
|
||||
new QTreeWidgetItem(item, QStringList() << QStringLiteral("Ripe") << QStringLiteral("$8.00") << QString("") << QStringLiteral("Market"));
|
||||
new QTreeWidgetItem(item, QStringList() << QStringLiteral("Decaying") << QStringLiteral("$0.50") << QString("") << QStringLiteral("Ground"));
|
||||
new QTreeWidgetItem(item, QStringList() << QStringLiteral("Pickled") << QStringLiteral("$4.00") << QString("") << QStringLiteral("Shop"));
|
||||
}
|
||||
|
||||
void KTreeWidgetSearchLineTest::create2ndLevel(QTreeWidgetItem *item)
|
||||
{
|
||||
QTreeWidgetItem *beans = new QTreeWidgetItem(item, QStringList() << QStringLiteral("Beans"));
|
||||
tw->expandItem(beans);
|
||||
create3rdLevel(beans);
|
||||
|
||||
QTreeWidgetItem *grapes = new QTreeWidgetItem(item, QStringList() << QStringLiteral("Grapes"));
|
||||
tw->expandItem(grapes);
|
||||
create3rdLevel(grapes);
|
||||
|
||||
QTreeWidgetItem *plums = new QTreeWidgetItem(item, QStringList() << QStringLiteral("Plums"));
|
||||
tw->expandItem(plums);
|
||||
create3rdLevel(plums);
|
||||
|
||||
QTreeWidgetItem *bananas = new QTreeWidgetItem(item, QStringList() << QStringLiteral("Bananas"));
|
||||
tw->expandItem(bananas);
|
||||
create3rdLevel(bananas);
|
||||
}
|
||||
|
||||
void KTreeWidgetSearchLineTest::switchCaseSensitivity(bool cs)
|
||||
{
|
||||
m_searchLine->setCaseSensitivity(cs ? Qt::CaseSensitive : Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
void KTreeWidgetSearchLineTest::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
|
||||
for (int i = 0; i < tw->header()->count(); ++i) {
|
||||
if (!tw->header()->isSectionHidden(i)) {
|
||||
tw->resizeColumnToContents(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication::setApplicationName(QStringLiteral("KTreeWidgetSearchLineTest"));
|
||||
QApplication app(argc, argv);
|
||||
KTreeWidgetSearchLineTest dialog;
|
||||
|
||||
dialog.exec();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "moc_ktreewidgetsearchlinetest.cpp"
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef ktreewidgetsearchlinetest_h
|
||||
#define ktreewidgetsearchlinetest_h
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class KTreeWidgetSearchLineTest : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KTreeWidgetSearchLineTest();
|
||||
|
||||
void create2ndLevel(class QTreeWidgetItem *item);
|
||||
void create3rdLevel(QTreeWidgetItem *item);
|
||||
|
||||
public Q_SLOTS:
|
||||
void switchCaseSensitivity(bool cs);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private:
|
||||
class KTreeWidgetSearchLine *m_searchLine;
|
||||
class QTreeWidget *tw;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
SPDX-FileCopyrightText: 2007-2008 Rafael Fernández López <ereslibre@kde.org>
|
||||
SPDX-FileCopyrightText: 2008 Kevin Ottens <ervin@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QLineEdit>
|
||||
#include <QListView>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QRadialGradient>
|
||||
#include <QStringListModel>
|
||||
#include <QToolButton>
|
||||
|
||||
#include <kwidgetitemdelegate.h>
|
||||
|
||||
#define HARDCODED_BORDER 10
|
||||
#define EQUALLY_SIZED_TOOLBUTTONS 1
|
||||
|
||||
#if EQUALLY_SIZED_TOOLBUTTONS
|
||||
#include <QStyleOptionToolButton>
|
||||
#endif
|
||||
|
||||
class TestWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TestWidget(QWidget *parent = nullptr)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
setAttribute(Qt::WA_Hover);
|
||||
}
|
||||
|
||||
~TestWidget() override
|
||||
{
|
||||
}
|
||||
|
||||
QSize sizeHint() const override
|
||||
{
|
||||
return QSize(30, 30);
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override
|
||||
{
|
||||
QPainter p(this);
|
||||
|
||||
QRadialGradient radialGrad(QPointF(event->rect().width() / 2, event->rect().height() / 2), qMin(event->rect().width() / 2, event->rect().height() / 2));
|
||||
|
||||
if (underMouse()) {
|
||||
radialGrad.setColorAt(0, Qt::green);
|
||||
} else {
|
||||
radialGrad.setColorAt(0, Qt::red);
|
||||
}
|
||||
|
||||
radialGrad.setColorAt(1, Qt::transparent);
|
||||
|
||||
p.fillRect(event->rect(), radialGrad);
|
||||
|
||||
p.setPen(Qt::black);
|
||||
p.drawLine(0, 15, 30, 15);
|
||||
p.drawLine(15, 0, 15, 30);
|
||||
|
||||
p.end();
|
||||
}
|
||||
|
||||
bool event(QEvent *event) override
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
|
||||
if (mouseEvent->pos().x() > 15 //
|
||||
&& mouseEvent->pos().y() < 15) {
|
||||
qDebug() << "First quarter";
|
||||
} else if (mouseEvent->pos().x() < 15 //
|
||||
&& mouseEvent->pos().y() < 15) {
|
||||
qDebug() << "Second quarter";
|
||||
} else if (mouseEvent->pos().x() < 15 //
|
||||
&& mouseEvent->pos().y() > 15) {
|
||||
qDebug() << "Third quarter";
|
||||
} else {
|
||||
qDebug() << "Forth quarter";
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::event(event);
|
||||
}
|
||||
};
|
||||
|
||||
class MyDelegate : public KWidgetItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MyDelegate(QAbstractItemView *itemView, QObject *parent = nullptr)
|
||||
: KWidgetItemDelegate(itemView, parent)
|
||||
{
|
||||
for (int i = 0; i < 100; i++) {
|
||||
installed[i] = i % 5;
|
||||
}
|
||||
}
|
||||
|
||||
~MyDelegate() override
|
||||
{
|
||||
}
|
||||
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(index);
|
||||
|
||||
return sizeHint();
|
||||
}
|
||||
|
||||
QSize sizeHint() const
|
||||
{
|
||||
return QSize(600, 60);
|
||||
}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
painter->save();
|
||||
|
||||
itemView()->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter, nullptr);
|
||||
|
||||
if (option.state & QStyle::State_Selected) {
|
||||
painter->setPen(option.palette.highlightedText().color());
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
QList<QWidget *> createItemWidgets(const QModelIndex &index) const override
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
QPushButton *button = new QPushButton();
|
||||
QToolButton *toolButton = new QToolButton();
|
||||
|
||||
setBlockedEventTypes(button, QList<QEvent::Type>() << QEvent::MouseButtonPress << QEvent::MouseButtonRelease << QEvent::MouseButtonDblClick);
|
||||
|
||||
setBlockedEventTypes(toolButton, QList<QEvent::Type>() << QEvent::MouseButtonPress << QEvent::MouseButtonRelease << QEvent::MouseButtonDblClick);
|
||||
|
||||
connect(button, SIGNAL(clicked(bool)), this, SLOT(mySlot()));
|
||||
connect(toolButton, SIGNAL(triggered(QAction *)), this, SLOT(mySlot2()));
|
||||
connect(toolButton, SIGNAL(clicked(bool)), this, SLOT(mySlot3()));
|
||||
|
||||
return QList<QWidget *>() << button << new TestWidget() << new QLineEdit() << toolButton;
|
||||
}
|
||||
|
||||
void updateItemWidgets(const QList<QWidget *> &widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const override
|
||||
{
|
||||
QPushButton *button = static_cast<QPushButton *>(widgets[0]);
|
||||
button->setText(QStringLiteral("Test me"));
|
||||
button->setIcon(QIcon::fromTheme(QStringLiteral("kde")));
|
||||
button->resize(button->sizeHint());
|
||||
button->move(HARDCODED_BORDER, sizeHint().height() / 2 - button->height() / 2);
|
||||
|
||||
TestWidget *testWidget = static_cast<TestWidget *>(widgets[1]);
|
||||
|
||||
testWidget->resize(testWidget->sizeHint());
|
||||
testWidget->move(2 * HARDCODED_BORDER + button->sizeHint().width(), //
|
||||
sizeHint().height() / 2 - testWidget->size().height() / 2);
|
||||
|
||||
// Hide the test widget when row can be divided by three
|
||||
testWidget->setVisible((index.row() % 3) != 0);
|
||||
|
||||
QLineEdit *lineEdit = static_cast<QLineEdit *>(widgets[2]);
|
||||
|
||||
lineEdit->setClearButtonEnabled(true);
|
||||
lineEdit->resize(lineEdit->sizeHint());
|
||||
lineEdit->move(3 * HARDCODED_BORDER + button->sizeHint().width() + testWidget->sizeHint().width(),
|
||||
sizeHint().height() / 2 - lineEdit->size().height() / 2);
|
||||
|
||||
QToolButton *toolButton = static_cast<QToolButton *>(widgets[3]);
|
||||
|
||||
if (!toolButton->menu()) {
|
||||
QMenu *myMenu = new QMenu(toolButton);
|
||||
myMenu->addAction(QStringLiteral("Save"));
|
||||
myMenu->addAction(QStringLiteral("Load"));
|
||||
myMenu->addSeparator();
|
||||
myMenu->addAction(QStringLiteral("Close"));
|
||||
toolButton->setMenu(myMenu);
|
||||
}
|
||||
|
||||
toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
toolButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
|
||||
if (installed[index.row()]) {
|
||||
toolButton->setText(QStringLiteral("Uninstall"));
|
||||
} else {
|
||||
toolButton->setText(QStringLiteral("Install"));
|
||||
}
|
||||
|
||||
toolButton->resize(toolButton->sizeHint());
|
||||
#if EQUALLY_SIZED_TOOLBUTTONS
|
||||
QStyleOptionToolButton toolButtonOpt;
|
||||
toolButtonOpt.initFrom(toolButton);
|
||||
toolButtonOpt.features = QStyleOptionToolButton::MenuButtonPopup;
|
||||
toolButtonOpt.arrowType = Qt::DownArrow;
|
||||
toolButtonOpt.toolButtonStyle = Qt::ToolButtonTextBesideIcon;
|
||||
|
||||
toolButtonOpt.text = "Install";
|
||||
int widthInstall = QApplication::style()
|
||||
->sizeFromContents(QStyle::CT_ToolButton,
|
||||
&toolButtonOpt,
|
||||
QSize(option.fontMetrics.boundingRect(QStringLiteral("Install")).width() + HARDCODED_BORDER * 3,
|
||||
option.fontMetrics.height()),
|
||||
toolButton)
|
||||
.width();
|
||||
toolButtonOpt.text = "Uninstall";
|
||||
int widthUninstall = QApplication::style()
|
||||
->sizeFromContents(QStyle::CT_ToolButton,
|
||||
&toolButtonOpt,
|
||||
QSize(option.fontMetrics.boundingRect(QStringLiteral("Uninstall")).width() + HARDCODED_BORDER * 3,
|
||||
option.fontMetrics.height()),
|
||||
toolButton)
|
||||
.width();
|
||||
|
||||
QSize size = toolButton->sizeHint();
|
||||
size.setWidth(qMax(widthInstall, widthUninstall));
|
||||
toolButton->resize(size);
|
||||
#endif
|
||||
toolButton->move(option.rect.width() - toolButton->size().width() - HARDCODED_BORDER, //
|
||||
sizeHint().height() / 2 - toolButton->size().height() / 2);
|
||||
|
||||
// Eat more space
|
||||
lineEdit->resize(option.rect.width() - toolButton->width() - testWidget->width() - button->width() - 5 * HARDCODED_BORDER, lineEdit->height());
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
void mySlot()
|
||||
{
|
||||
QMessageBox::information(nullptr, QStringLiteral("Button clicked"), QStringLiteral("The button in row %1 was clicked").arg(focusedIndex().row()));
|
||||
}
|
||||
|
||||
void mySlot2()
|
||||
{
|
||||
QMessageBox::information(nullptr,
|
||||
QStringLiteral("Toolbutton menu item clicked"),
|
||||
QStringLiteral("A menu item was triggered in row %1").arg(focusedIndex().row()));
|
||||
}
|
||||
|
||||
void mySlot3()
|
||||
{
|
||||
bool isInstalled = installed[focusedIndex().row()];
|
||||
installed[focusedIndex().row()] = !isInstalled;
|
||||
const_cast<QAbstractItemModel *>(focusedIndex().model())->setData(focusedIndex(), QStringLiteral("makemodelbeupdated"));
|
||||
}
|
||||
|
||||
private:
|
||||
bool installed[100];
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMainWindow *mainWindow = new QMainWindow();
|
||||
mainWindow->setMinimumSize(640, 480);
|
||||
QListView *listView = new QListView();
|
||||
QStringListModel *model = new QStringListModel();
|
||||
|
||||
model->insertRows(0, 100);
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
model->setData(model->index(i, 0), QString("Test " + QString::number(i)), Qt::DisplayRole);
|
||||
}
|
||||
|
||||
listView->setModel(model);
|
||||
MyDelegate *myDelegate = new MyDelegate(listView);
|
||||
listView->setItemDelegate(myDelegate);
|
||||
listView->setVerticalScrollMode(QListView::ScrollPerPixel);
|
||||
|
||||
mainWindow->setCentralWidget(listView);
|
||||
|
||||
mainWindow->show();
|
||||
|
||||
model->removeRows(0, 95);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
#include "kwidgetitemdelegatetest.moc"
|
||||
Reference in New Issue
Block a user