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 :
/usr/include/kconfiggroup.h:745: error: 'qVariantCanConvert' was not declared in this scope
/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
------------------
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtDebug>
#include <kfontdialog.h>
namespace Ui {
class MainWindow;
}
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtDebug>
#include <kfontdialog.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
mainwindow.cpp
------------------
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
int result = KFontDialog::getFont( myFont );
qDebug() << "Return Parameter is:" << result << endl;
}
MainWindow::~MainWindow()
{
delete ui;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QFont myFont;
int result = KFontDialog::getFont( myFont );
qDebug() << "Return Parameter is:" << result << endl;
}
MainWindow::~MainWindow()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
Bookmarks