1

I am new to the GUI development environment. I found qt to be interesting as it is a huge framework but it requires its program to be coded in C++. I want to create a small windowed GUI program which could have transitions etc. provided by QML. What are the possible ways to compile it along with existing C code with or without qt creator ?

user3636470
  • 67
  • 1
  • 5
  • 1
    you can obviously use a C library in a C++ program. Just pay attention to the linkage and you'll be all set – Marco A. Sep 24 '14 at 20:37
  • Thank you, for a helpful suggestion. What are the steps to design a GUI program as i described above, where i would use QML to add some custom elements and transition effects to them ? – user3636470 Sep 24 '14 at 20:41
  • This is very broad question. You would write your GUI in QML, and have a C++ wrapper for interacting with the C code. Also, in title you talk about "pre built C program", in the body you talk about "existing C code", which is it? – hyde Sep 24 '14 at 20:46
  • I talked about the existing C code which i have built as well. In case it doesn't works or can't be linked, so i decribed it as C code in the end. Sorry about the confusion – user3636470 Sep 24 '14 at 20:51

1 Answers1

0

As long as you pay attention to linkage (C functions should use C linkage), there will be no problems: a C library can safely be used in a C++ program.

For what concerns implementing your GUI with QML, start by taking a look at the Qt QML examples and work your way from there.

QML is mostly used for mobile UI render (i.e. when there's no native support openGL kicks in and renders the element via the available driver), anyway it can play along just fine on any Qt-supported platform.

Community
  • 1
  • 1
Marco A.
  • 43,032
  • 26
  • 132
  • 246
  • Can you tell me the basic steps to do so exactly to build the type of application i described because as far as i know, firstly, i will edit the QML in the designer provided by the Qt creator. But i don't know ahead about adding it in C++ program or so. – user3636470 Sep 24 '14 at 20:56
  • 1
    I can't do your homework for you, I'm sorry. Download Qt Creator and use the tutorial provided there. – Marco A. Sep 24 '14 at 20:58