qt

How to specify different Debug/Release output directories in QMake .pro file

I have a Qt project and I would like to output compilation files outside the source tree. I currently have the following directory structure: / |_/build |_/mylib |_/include |_/src |_/resources Depending on the configuration (debug/release), I will like to output the resulting files inside the build directory under build/debug o...

Qt layout problem.

I have a following Qt code: QVBoxLayout* box = new QVBoxLayout; label = new QLabel(); // will be set later dynamically box->addWidget (label); Text in label will be set later. The problem is that when label resizes, it resizes QVBoxLayout, and it resizes other neighboring widgets. I don't want to make a label or layout fixed width. ...

Qt - Calling widget parent's slots

I wrote a small program to test accessing a widget parent's slot. Basically, it has two classes: Widget: namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); QLabel *newlabel; QString foo; public slots: void changeLabel(); private: Ui...

QLocale, what is the scope of the global QLocale::setDefault()?

Problem: I have a QT based multiplatform (win,mac,*nix) application that parses ascii files containing decimal numbers. parsing is done using a variety of different code pieces that use anything from qt string stuff, c++ stdin, oldstyle scanf, etc. ascii files have always the '.' (dot) as separated decimal (e.g. in the file to be par...

Qt variable re-assignment

I have two examples I have a question about. Let me explain via some code: Question 1: QStringList qsl(); // Create a list and store something in it qsl << "foo"; QString test = "this is a test"; qsl = test.split(" ", QString::SkipEmptyParts); // Memory Leak? What happens when I re-assign the qsl variable what happens to "foo" and ...

Qt - serialize/deserialaize text plus picture

I want to use a field (kind of QTextEdit), which is capabale of storing picture and text (like MS Word is doing) and it serializes and deserialaizes picture+text data. Is there any Qt Widget that allows us to manipulate with picture and text simultaniously and it has set/get functions which operate with serializable type? In othger word...

Cross-platform high-level widget toolkits for C

Are there any high-level, cross-platform, and abstracted (simple to use) widget toolkits for C that are either very lightweight and fast or can be compiled for other toolkits, such as Qt and GTK+? EDIT: Most C++ libraries lack C bindings, so they will be of little (or no) help. ...

Emulating a web browser

Hello, we are tasked with basically emulating a browser to fetch webpages, looking to automate tests on different web pages. This will be used for (ideally) console-ish applications that run in the background and generate reports. We tried going with .NET and the WatiN library, but it was built on a Marshalled IE, and so it lacked many...

How to enable editing for QTableWidget

I'm using QTableWidget as view widget and QTableWidgetItem as items. How to enable editing for specific QTableWidgetItem cells? ...

Coupling between controller and view

The litmus test for me for a good MVC implementation is how easy it is to swap out the view. I've always done this really badly due to being lazy but now I want to do it right. This is in C++ but it should apply equally to non-desktop applications, if I am to believe the hype. Here is one example: the application controller has to check...

Importing .dll into Qt

I want to bring a .dll dependency into my Qt project. So I added this to my .pro file: win32 { LIBS += C:\lib\dependency.lib LIBS += C:\lib\dependency.dll } And then (I don't know if this is the right syntax or not) #include <windows.h> Q_DECL_IMPORT int WINAPI DoSomething(); btw the .dll looks something like this: #include <win...

facebook authentication using qt

can authentication for facebook be done without a web browser in qt? the way i want to authenticate is to enter a username and password in text boxes and pass it as parameters in the url? is it possible? please help. thanks in advance. ...

Customize page number when printing a QTextDocument

Hi, I'm trying to print the content of a QTextEdit. For that I'm using QTextDocument::print(QPrinter*). Doing that, a page number is automatically added at the right bottom of the page. Is there any way to change its format / move it / get rid of it? Thanks. ...

Linux QT OpenCL basic setup

Hi, what's the basic setup for Linux to compilie a C/C++ examples from OpenCL SDK? ...

How to make the title bold?

Hi all, In Qmessagebox how can I make the title text bold? Here is the sample code, which I am using to disply a messagebox int ret = QMessageBox::warning(this, tr("My Application"), tr("document has been modified.\n" "Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard ...

Stop single QModelIndex from being update

I have a QTreeView with data that changes over time, with a dataChanged signal being emitted in the QAbstractItemModel every second. The items in the QTreeView can be edited as well, but when a editor is opened for a certain item the editor string is updated while I edit is, which is very annoying. Any way to prevent an editor to be upda...

QT EventTransition implementation

I am trying to build an QT State Maschine. I have some States, and for those States i need Transition that alter the Graphics on my gui. The Problem i having and the only reason i am asking, i am Stuck and Point 1. The compiler cant identifie the QTEventTransition. I have QT 4.6 wroking with QT Creator on Windows. The compiler does n...

how can i inherit from both QWidget and QThread?

I have a class like this class GUI : public QWidget, public QThread When I do the above i get errors about connect signals. The error says "Reference to "connect" is ambiguous". Is there a way to inherit from both? Thank you ...

Is this a situation where Qt Model/View architecture is not useful?

Hi, I am writing a GUI based application where I read a string of values from serial port every few seconds and I need to display most of the values in some type graphical indicator(I was thinking of QprogressBar maybe) that displays the range and the value. Some of the other data that I am parsing from the string are the date and fault...

Conway's Game of Life - C++ and Qt

I've done all of the layouts and have most of the code written even. But, I'm stuck in two places. 1) I'm not quite sure how to set up the timer. Am I using it correctly in the gridwindow class? And, am I used the timer functions/signals/slots correctly with the other gridwindow functions. 2) In GridWindow's timerFired() function, I'm ...