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,17 @@
|
||||
include(ECMMarkAsTest)
|
||||
include(ECMMarkNonGuiExecutable)
|
||||
|
||||
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
|
||||
|
||||
macro(ktextwidgets_executable_tests)
|
||||
foreach(_testname ${ARGN})
|
||||
add_executable(${_testname} ${_testname}.cpp)
|
||||
target_link_libraries(${_testname} Qt6::Test KF6::TextWidgets)
|
||||
ecm_mark_nongui_executable(${_testname})
|
||||
ecm_mark_as_test(${_testname})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
ktextwidgets_executable_tests(
|
||||
ktextedittest
|
||||
)
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
This file is part of the KDE libraries
|
||||
SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <ktextedit.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QFile>
|
||||
#include <QTest>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication::setApplicationName(QStringLiteral("ktextedittest"));
|
||||
QApplication app(argc, argv);
|
||||
KTextEdit *edit = new KTextEdit();
|
||||
|
||||
// QAction* action = new QAction("Select All", edit);
|
||||
// action->setShortcut( Qt::CTRL | Qt::Key_Underscore );
|
||||
// edit->addAction(action);
|
||||
// QObject::connect(action, SIGNAL(triggered()), edit, SLOT(selectAll()));
|
||||
|
||||
QFile file(QFINDTESTDATA(QLatin1String("ktextedittest.cpp")));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
edit->setPlainText(QLatin1String(file.readAll()));
|
||||
file.close();
|
||||
}
|
||||
|
||||
edit->resize(600, 600);
|
||||
edit->show();
|
||||
return app.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user