[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What would you prefer for GUI programming in C++
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 52
Thread images: 7
File: GTK_vs_Qt.png (60 KB, 500x286) Image search: [Google]
GTK_vs_Qt.png
60 KB, 500x286
Gtk or Qt
>>
G T K
T
K
>>
>>53322259
I'd use opengl and some input library, gtk and qt are bloat.
>>
>>53322259
Gtk
Qt is a joke, they built a whole new language and ide WTF
That's like, c# visual studio tier bullshit
>>
Everything made with GTK ends up looking like total shit.
>>
>>53322259
fltk
>>
>>53322259
QT because of the license, IDE/designer, framework and somewhat ease of use. GTK is AIDS and only use it if you are a freetard worshiping Stallman. Another option is wxwidgets but it takes a bit to get used to.
>>
>>53322259
qt
>>
File: Vol6a.png (137 KB, 504x662) Image search: [Google]
Vol6a.png
137 KB, 504x662
Motif.
>>
some input library

Like ??
>>
>>53322359
some input library

Like ??
>>
>>53322259
Qt.
>>
File: why_no_one_ports_to_gtk.png (19 KB, 1124x244) Image search: [Google]
why_no_one_ports_to_gtk.png
19 KB, 1124x244
GTK is dead, everyone is switching to Qt today. Check this out https://www.wikivs.com/wiki/GTK_vs_Qt .
>>
>>53322259
Qt, of course.
>>
>>53322366
>>53322409
I'm getting mixed signals here. What does Qt's IDE look like?
>>
>>53322409

>QT because of the license
Are you an idiot? Both are licensed under the GPL for regular users. Except that Qt also has a proprietary license and isn't free software. The only person who would prefer that would be a Qt employee.
>>
>>53322829
You want an easy time developing and designing? Go QT and use their IDE. It's actually pretty nice but no visual studio experience. If you want to do everything the 90s way go GTK.

>>53322863
Are you retarded? Qt is triple licensed under GPLv3, LGPLv2.1 and a commercial license. If you actually intend to make money with QT or don't want to open up your shit to the entire world QT is the superior choice.
>>
SFGUI, but most of the time I just roll my own.
>>
>>53322259
Qt
>>
>>53322829
It is called qtcreator.
It is lighter than eclipse because it doesn't load everything all at once, but rather builds things when needed.
This means it is slow on huge projects but it faster on smaller projects.

Qt can be written as xml, but in qtcreator, there is a designer which makes it easy to make the interface.

I recommend it to everyone who wants to write a c++ application, regardless of whether it has a GUI or not.
Just try it out.
>>
>>53322259
GTK if portability isn't an issue. Lots more helper functions so I don't have to rebuild a find function from scratch.

Qt is still awesome in its own right, though.
>>
>>53322259
qt of course.
>>
File: file.png (52 KB, 1027x871) Image search: [Google]
file.png
52 KB, 1027x871
Anyone use QT for Python? I just started using it yesterday and it seems like a nightmare.

I've got a program I'm using that scrapes a whole bunch of records off a website, but my client is asking me to create a GUI so that they can use it.

Here's what I've mostly come up with.

from PyQt4 import QtGui, QtCore    # GUI

# Called by Window.search_web to create session
class Session_Mgr(QtGui.QThread):
def __init__(self, parent):
QThread.__init__(self)
self.session = None
self.parent = parent
self.captcha_inactivity_timer = 0

# Used by Window.get_captcha_input to set session var
def getSession(self):
return self.session

def initSession(self):
self.session = sessionmgr.Session() # External session class (synchronous)
self.emit(QtCore.SIGNAL('get_captcha_input()')) # Emits signal to parent class (Window)

# Entry point from Window.get_captcha_input()
def set_capcha_response(self, captcha):
if not self.session.verify_session(captcha): # External class that sends
self.session.initSession() # re-initialize session if validation failed
self.emit(QtCore.SIGNAL('get_captcha_input()'))

# Thread entry point
def run(self):
self.initSession()

# Dialog window for captcha input
class CaptchaInputDialog(QtGui.QDialog):
def __init__(self, parent=None, title='Fill in the Captcha', text=''):
QtGui.QWidget.__init__(self, parent)
captcha_image = QtGui.QLabel()
pixmap = QtGui.QPixmap(os.getcwd() + '/' + Enums.CACHE_LOC + "captcha.jpg")
captcha_image.setPixmap(pixmap)
layout.addWidget(captcha_image)
## textbox, etc..
button.clicked.connect(lambda: parent.captchaResponse(self))


Pic related is also a sequence diagram of how it currently works.
I have never done any GUI programming in my life, but holy shit there has to be a better way than this.
>>
>>53323683

Window class

# Main GUI thread
class Window(QtGui.QWidget):

def __init__(self, parent=None):
super(Window, self).__init__(parent)
QtGui.QWidget.__init__(self)
self.session_mgr = None
#Button
self.search = QtGui.QPushButton('Search', self)
self.search.clicked.connect(self.search_web)

def search_web(self):
if not self.session_mgr:
self.session_mgr = Session_Mgr(self)
# Signal slot to call get_captcha_input
self.connect(self.session_mgr, QtCore.SIGNAL("get_captcha_input()"), self.get_captcha_input)
self.session_mgr.start() # Start session_mgr thread
self.fn = search_all_thread # Race condition probably will happen here
self.args = ''

def get_captcha_input(self):
captcha_validator = CaptchaInputDialog(self)
captcha_validator.exec_() # Waits here for input from the user
self.session_mgr.set_capcha_response(str(captcha.text.text())) # Calls session_mgr thread to handle the captcha response
self.fn = self.fn(self.session_mgr.getSession(),self.args) # Calls function with session and args.
self.fn.start()
>>
wxWidgets
GTK is C-oriented and you have to pay for Qt
Both have problems with looking native under Windows and OS X. wxWidget, on the other side is basically a layer between your OS API and your program so it always looks native. And it much less bloated than Qt.
>>
Chromium framework and html/css/js.
Damned we are in the internet world, don't waste your time with windowed shit.
>>
I am agree with some of the folks here qt is great. But visual basic is far the best Gui Builder i have ever seen.

We should probably create something like this for.
>>
We should probably create something like this for.
... for Python and Java
>>
>>53323683
And this is really why qt is shit; bullshit signals/slots with 100 threads communicating the main graphics thread just to do shit.

In my honest opinion, if you did it using html/js, you would have had a much easier time.
>>
>>53323903
>webshit
you don't belong here
>>
>>53323696
>>53323683
Is there anything inherently wrong with how the GUI is structured?
I don't really know anything about the QT framework.

>>53323903
You may be right, but in my case, the scraping part of the program includes a lot of I/O document writing and parsing which won't possible to do in javascript, given that there's no decent PDF parsing libraries.
>>
>>53323797
My issue with web stuff is that it's usually IN the browser and not standalone. Have any experience with Chromium Embedded Framework? It looks kinda cool, like 3easy5me web UI but on capable of running standalone
>>
Qt obviously, gtk is dead

>>53323875
whats PyQt and PySide?
>>
>>53324186
I am mean we should create something for python, An IDE like Visaul Studio
>>
File: 1455416205447.gif (622 KB, 499x310) Image search: [Google]
1455416205447.gif
622 KB, 499x310
>>53324245
>new ip
>spouting nonsense
is your life empty?
>>
>>53322259
Doesn't QT have a strange way of rendering widgets or something?

It'll render them directly as opposed to using theming.
>>
>>53324262
Say whatever you want but Python and Java community needs something better
>>
>>53324342
better than what?
>>
>>53323683
I haven't analyzed your shit but you need to use a MVC or MVP pattern for your shit. It makes working with QT (and pretty much anything with a user interface) tons easier.
>>
>>53323705
>you have to pay for Qt
No you don't. You only have to pay if you are concerned about someone reverse-engineering your shit since LGPL allows that when you dynamically link to it.
>>
>>53322371
true, but at least it works
>>
>>53322579
It's because QT is so bloated and fucked it's impossible to port back to gtk
>>
File: 1457176452.jpg (53 KB, 880x571) Image search: [Google]
1457176452.jpg
53 KB, 880x571
>>53324430
gtk is quite literally shit
thats the reason about it all

heres a guy running actual company that develops something, talking about their switch from gtk to qt, he is close to Linux

https://www.youtube.com/watch?v=gGZyVSOnqm0

>TL;DW
gtk was pain in the ass shit
Qt is amazing and is the future and its community is the biggest help
>>
>>53324367
Java: Java needs something better than Scene Builder is shit

Python: I tried Qt, but it shit when you compare it Visual Studio.

I am not Microsoft fan but they are doing really great.
>>
File: 1457176524.png (130 KB, 1314x830) Image search: [Google]
1457176524.png
130 KB, 1314x830
>>
wxWidgets
>>
>>53324478
Qt is not IDE you moron, its a GUI framework
https://en.wikipedia.org/wiki/Qt_%28software%29

>inb4 I was just pretending to be retarded
>>
>>53324480
QT for embedded is quite nice but it's suffering from some annoying bugs due to some of its limitations of not having to run a window manager or x11. You need to have a different approach with your design.
>>
>>53324504
Oh

What i am saying is that Microsoft has done a great job at integrating C# and Visual Studio. Doesn't matter you create a GUI app or Web app (ASP.NET)). Everything is under one umbrella. And beginner friendly. You don't need to go through the internet browsing how to start this and that.

But there is nothing equivalent available for python or Java. Now don't praise QT,

I have tried QT and VS both. But i really like VS.

That's what i am telling you. Python and Java needs something like VS, which streamlines the process of creating app (GUI or web app).
>>
>>53324625
you're comparing the qt framework with .NET?

God how much stupidity can this board contain
>>
>>53325057
>you're comparing the qt framework with .NET?

Yes

I am comparing a good thing with great one.

If we can make a good thing great, i don't see any stupidity in it.
>>
>>53324480
oh no, I can't use GTK+ for Haiku and Symbian development! What a tragedy.
Thread replies: 52
Thread images: 7

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.