Results 1 to 3 of 3

Thread: Qt Creator Using KDE class

  1. #1
    Join Date
    Oct 2013
    Location
    South Ouest France
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Qt Creator Using KDE class

    Hello.

    Qt 5.1.1
    Qt Creator 2.8.1
    KDE 4.10.5
    OpenSuse 12.3
    Linux 3.7.10-1.16-desktop

    I would like to use KFontDialog

    I cannot build my project under 5.1.1 because of this error :
    Qt Code:
    1. /usr/include/kconfiggroup.h:745: error: 'qVariantCanConvert' was not declared in this scope
    To copy to clipboard, switch view to plain text mode 

    I have seen that qVariantCanConvert is deprecated.

    The project build correctly under 4.8.

    Any help is welcome.


    mainwindow.h
    ------------------
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5. #include <QtDebug>
    6. #include <kfontdialog.h>
    7.  
    8. namespace Ui {
    9. class MainWindow;
    10. }
    11.  
    12. class MainWindow : public QMainWindow
    13. {
    14. Q_OBJECT
    15.  
    16. public:
    17. explicit MainWindow(QWidget *parent = 0);
    18. ~MainWindow();
    19.  
    20. private:
    21. Ui::MainWindow *ui;
    22. };
    23.  
    24. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp
    ------------------
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. MainWindow::MainWindow(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::MainWindow)
    7. {
    8. ui->setupUi(this);
    9.  
    10.  
    11. QFont myFont;
    12. int result = KFontDialog::getFont( myFont );
    13. qDebug() << "Return Parameter is:" << result << endl;
    14.  
    15.  
    16. }
    17.  
    18. MainWindow::~MainWindow()
    19. {
    20. delete ui;
    21. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator Using KDE class

    Basically Qt5 and KDE 4 can't work together since KDE4 is based on Qt4.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator Using KDE class

    kfontdialog Qt5 version is part of the "kde4support" framework, making it likely that it has been mostly replaced by its Qt counterpart and only still exists for porting and corner cases.

    Cheers,
    _

Similar Threads

  1. Replies: 6
    Last Post: 18th September 2013, 21:03
  2. Replies: 1
    Last Post: 20th January 2012, 04:39
  3. Replies: 2
    Last Post: 22nd November 2011, 00:09
  4. qt creator create class problem
    By foxhengxing in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2010, 16:32
  5. Replies: 3
    Last Post: 27th December 2008, 19:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.