Active Topics

 


Reply
Thread Tools
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#11
Use what works best with the app you want to write and the language skills you have.

There are strengths and weaknesses in every framework and language, and we have the ability to pick and choose the best components from any of the stacks.

we are maemo, we have choice.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#12
Originally Posted by TA-t3 View Post
If you want to program in C, or Vala, use Gtk, if you want to program QT you'll have to use C++. (If there's a wrapper for C -- sounds unlikely -- I'm unaware of it).

I for one will never program in C++, so an UI based around QT isn't as attractive to me as a Gtk UI.
The level of C++ knowledge required (over C) to use Qt is fairly minimal (that is IMHO also the reason why nobody bothers to do a C wrapper). Considering how gobjects mimic, well, objects, one could argue that the difference is mostly in syntax. If you have a problem using a C++ compiler or have a personal dislike for stuff written in C++, that's OK, but for most people this is pretty much a non-issue.
 

The Following 2 Users Say Thank You to attila77 For This Useful Post:
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#13
Well, you're effectively saying that most people are completely happy with writing in C++. Maybe this is true, but maybe not. In any case it's of course possible to write using any toolkit, as long as run-time libs are available. However, the fact that it doesn't take too much C++ knowledge to use QT isn't an issue, the point is that if you write your UI stuff in C++ you're in practice pretty much forced to write the actual application in C++ too. I for one prefers pretty much any other object oriented language before I will touch C++.

We can write in any toolkit, but it's not as interesting to write a Gtk application for an UI which is based on Qt.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#14
Originally Posted by TA-t3 View Post
the point is that if you write your UI stuff in C++ you're in practice pretty much forced to write the actual application in C++ too. I for one prefers pretty much any other object oriented language before I will touch C++.
That's not what I tried to say. I'm saying GTK's gobjects are not as far from Qt's QObjects (which are of course C++) as one may think, the signal/slot mechanism is fairly similar, etc. I don't really understand what's *forcing* you to use C++ outside of referencing Qt's objects (except the benefit of, say, subclassing various Qt classes).

Take a look at the hello world comparison - I don't see this being THAT much different. When I needed to rewrite some of my code from Qt to GTK (some gstreamer related stuff for Fremantle), I really was under the impression that the differences are primarily in syntax (a la someting_new() instead of new something() and show(something) instead of something.show()), the C/C++ split never occured to me.

Code:
int main(int argc, char *argv[])
 {
   QMainWindow *window;
   QPushButton *button;

   QApplication app(argc, argv);

   window = new QMainWindow();
   button = new QPushButton("Hello world!");

   app.connect(button, SIGNAL("clicked()", window, SLOT("close()"));
...
Code:
int main (int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *button;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  button = gtk_button_new_with_label ("Hello World");

  gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			     GTK_SIGNAL_FUNC (gtk_widget_destroy),
			     GTK_OBJECT (window));
...
I'd like to underline that I'm not pushing for either framework, it's just that I don't understand after some dabbling with both, what's the big deal with the C++ thing (when you're going to do the same thing in GTK, just with a different metaobject system). Maybe I'm just too pragmatic and look at stuff differently than others, so, to avoid transforming this thread into YAGVQT (yet another gtk vs qt thread), that will be all from me on this topic
 

The Following User Says Thank You to attila77 For This Useful Post:
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#15
Don't get me wrong, I don't doubt at all that the actual widget handling is quite similar (nicer, actually) when done in C++/Qt compared to C/Gtk (except that Gtk gets so much easier when using Vala instead of C ), what I tried to say was that if you write the UI handling in C++ you would really want to write the rest of the application (the part that actually does something) in C++ too, which I personally don't wish to. I agree that the C++/Qt API itself is decent.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2009-09-21 at 18:45.
 

The Following User Says Thank You to TA-t3 For This Useful Post:
Reply

Tags
maemo5 qt programming


 
Forum Jump


All times are GMT. The time now is 18:24.