GTK or QT?

Discussion in 'Desktop / X' started by bashcommando, Jul 28, 2014.

?

GTK or QT?

  1. GTK

    2 vote(s)
    40.0%
  2. QT

    3 vote(s)
    60.0%
  1. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    Which one is good for new X11 programmers? I am trying to use GL in the window.

  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,346
    Likes Received:
    447
    Trophy Points:
    83
    Just my opinion, but I love QT. Not just how it looks but using QT Creator makes everything sooo easy.
    spin89 likes this.
  3. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    I just want to use gedit and g++. Is it compatable with gl?
  4. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,346
    Likes Received:
    447
    Trophy Points:
    83
  5. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    Why hasn't anybody suggested anything about GTK yet? I want something efficient, easy, and something that can import openGL objects. I also want to compare the two.
  6. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,346
    Likes Received:
    447
    Trophy Points:
    83
    Qt has become more popular. Works on more platforms, easier to use, less system resources.

    Sorry I don't have any GTK experience. :(
  7. Darren Hale

    Darren Hale Active Member

    Messages:
    290
    Likes Received:
    122
    Trophy Points:
    43
    Some of the old gtk1 apps are fun to run like xmms and use less resources especially for retro hardware, like to be up to date with browser though. Must admit Avidemux looks better with QT interface.
  8. JasKinasis

    JasKinasis Member

    Messages:
    69
    Likes Received:
    33
    Trophy Points:
    18
    Other than a few basic tutorials, I haven't done anything much with GTK myself.

    I've used wxWidgets a lot in the past. I quite like wxWidgets and have ported a few old Windows MFC programs (in-house tools at a previous job) to wxWidgets in order to make them cross-platform (Windows, Mac and Linux). Had to put a few conditional compilation kludges in there for some platform specific/compiler specific functionality, but on the whole it was relatively straightforward. But I've recently started messing with QT.

    Ryan has answered the GL part of your question, but on the subject of using gedit and g++:

    Using an IDE like QT Creator or Kdevelop is certainly quick and easy, but it is
    possible to use QT without using an IDE. I have created a few small QT projects completely on the command line (using vim to write the source files and the command line to compile).

    Basically, you create a directory with the name of your project, which contains your source tree. When you are ready to try your first attempt at compiling, you need to navigate into the project directory and use qmake to create a project file:
    Code:
     qmake -project
    The -project switch causes qmake to examine the content of the current directory (and recurses through the sub-directories) and auto-magically creates a project file named foo.pro (where foo is the name of the current/project directory).

    Next you run the command:
    Code:
    qmake foo.pro
    Again, where foo.pro is the name of the project file generated by qmake. This examines the project file and does some other automatic witchcraft to create some makefiles throughout your source tree.

    Finally, you can attempt to compile your project using good old, trusty make:
    Code:
    make
    All being well, your project should compile and build!
    If not, you know the drill - fix any errors the compiler whines about and run make again until it builds!

    Also note: if you add or remove any files from your source tree, you will need to use qmake to regenerate the project file and the makefiles as per the steps above before using make to compile/build again!
  9. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    I don't really care about popularity, But I like everything else you said.
  10. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    Don't care about looks because I am making a video game, thats why I asked about GL. I like the fact about running on old computers. But I don't think GL is.
  11. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    Is it possible to make QT programs without qmake?
  12. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    Can I use OpenGL in Plain X11?
  13. JasKinasis

    JasKinasis Member

    Messages:
    69
    Likes Received:
    33
    Trophy Points:
    18
    It should be possible to use X11 with gl.

    Or you could just use opengl for everything, with glut to deal with the windowing side of things.
  14. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    I'm not using glut because its not open-source. Can you give me a link or an example on gl and x11
  15. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,346
    Likes Received:
    447
    Trophy Points:
    83
  16. JasKinasis

    JasKinasis Member

    Messages:
    69
    Likes Received:
    33
    Trophy Points:
    18
    I've not done anything with bare X for some time now, but I'll see if I can dig something out.

    BTW: You are right, the original version of glut was freeware, but was not open source and has not been updated since 1998 or thereabouts. However, because of those factors, I don't think any modern distros have ever shipped the original glut (at least not in the last 10 years or so!). AFAIK the version of glut distributed in the repos of all Linux distros is freeglut, which is a cross-platform, open-source re-implementation of glut, released under the MIT/X consortium licence, which is the same licence that X11 is subject to.
    See details here.

    So freeglut is open source! Sorry, I should have specified freeglut in my previous post. I just assumed it was common knowledge that freeglut was the implementation of glut used nowadays, so I didn't mention it. :/

    API-wise, freeglut is compatible with the original glut; but it's had various improvements made to it over time and it's been ported to work on more platforms than the original glut too!

    So there is no reason to avoid using freeglut!


    Edit: Here's an example using X11 and GL...
    http://content.gpwiki.org/index.php/OpenGL:Tutorials:Setting_up_OpenGL_on_X11
    Last edited: Jul 31, 2014
    ryanvade likes this.

Share This Page