简体   繁体   English

Qtcreator中的KDE的Hello World

[英]Hello World for KDE in Qtcreator

I have just begun programming for KDE, the problem I face is I don't know what exactly should be the pro file for a KDE project, I have an idea for cmake though 我刚刚开始为KDE编程,我面临的问题是我不知道KDE项目的专业文件到底应该是什么,尽管我有一个cmake的想法

I also tried in pro file: 我也在pro文件中尝试过:

LIBS += -lkdeui LIBS + = -lkdeui

I still get problem KApplication not found 我仍然遇到问题KApplication找不到

Code main.cpp: 代码main.cpp:

    #include <cstdlib>

    #include <KApplication>
    #include <KAboutData>
    #include <KCmdLineArgs>
    #include <KMessageBox>
    #include <KLocale>

    int main (int argc, char *argv[])
    {
        KAboutData aboutData("tutorial1",0,ki18n("Tutorial 1"),"1.0",ki18n("Displays a KMessageBox popup"),KAboutData::License_GPL,ki18n("(c) 2007"),ki18n("Some text..."),"http://example.com/","submit@bugs.kde.org");

        KCmdLineArgs::init( argc, argv, &aboutData );
        KApplication app;
        KGuiItem yesButton( i18n( "Hello" ), QString(),
                            i18n( "This is a tooltip" ),
                            i18n( "This is a WhatsThis help text." ) );
        return
            KMessageBox ::questionYesNo
            (0, i18n( "Hello World" ), i18n( "Hello" ), yesButton )
            == KMessageBox ::Yes? EXIT_SUCCESS: EXIT_FAILURE;
    }

and tutorial.pro file is: 而tutorial.pro文件是:

    TEMPLATE = app
    CONFIG += console
    CONFIG -= qt
    SOURCES += main.cpp
    LIBS += -lkdeui

You need to install development files for kde libraries, these are missing. 您需要为kde库安装开发文件,但缺少这些文件。 I don't know which Linux distro you are using (if any) but, for example, in Debian the required package is called kdelibs5-dev . 我不知道您正在使用哪个Linux发行版(如果有),例如,在Debian中,所需的软件包称为kdelibs5-dev

You will probably also need to specify the include path for these development files after installing the package. 安装软件包后,您可能还需要为这些开发文件指定包含路径。 Like INCLUDEPATH += /usr/include/KDE INCLUDEPATH += /usr/include/KDE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 简单的 godoc 你好世界 - SIMPLE godoc Hello world 从Emacs中的默认“ hello world”项目开始 - Start off with a default “hello world” project in Emacs Android Hello World:可以将APK安装到Android中,无法运行/启动APK - Android Hello World: Able to install APK into Android, won't run/start APK QTCreator:将qt项目用于另一个项目 - QTCreator : Use qt project into another 如何将 QtCreator 项目转换为 Visual Studio 项目 - How to convert QtCreator project to Visual Studio project 如何从git仓库创建qtCreator项目? - how create qtCreator project from a git repository? 如何从另一个项目导入项目头文件并将其用作qtcreator项目的库 - how to import project header files from another project and use it as library for qtcreator projects 在实际项目中与其他 web 开发人员合作时的步骤是什么? - What are the steps when working with other web developers in a real world project? 您好,我正在尝试为我的项目构建 Apk,但遇到了这些错误,我尝试了互联网上的所有解决方案,但仍然无法正常工作.. 知道吗? - Hello, I'm trying to build Apk for my project and I got these errors, I tried every solution on the internet but still not working.. any idea?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM