qt

Optimize the Binary size of QT ?

Hi All, Currently we are working on how to optimize the application's binary size of QT. I need only one QLable and QLineEdit widget in application and i have removed other widgets from the compilation options. Currenlty application link libQtGui and libQtCore library. I have compiled QT for embedded arm architecture. I have compile one...

How to extract selected area of the gui component to PDF in QT

Hi guys I need to make the tool like Snagit and to take the picture the selected area of the component. I'm searching how to make this tool in Qt. I firstly prefer using Qt native library but if there is no library which fullfills this requirement, any good c++ libray can be accepted for me. Any help will be appreciated...

How to format the selected text in a QTextEdit by pressing a button.

I want to format a selected text in a QTextEdit by clicking a button. For axample I want to make it bold if it is not-bold, or not-bold if it is bold. Please help me with an example. EDIT: Actually I have found already a code - qt demo for text editor which does what I need: void MyTextEdit::boldText(bool isBold) //this is the SLOT fo...

Compiling libshout using QT/qmake

I'm trying to link my QT application to a DLL (libshout), while building for Windows. I've added the appropriate lines to my .pro file: LIBS += -L/local/lib -lmp3lame LIBS += -L/local/lib -lshout LIBS += -L/local/lib -logg LIBS += -L/local/lib -lvorbis LIBS += -lwsock32 I've also successfully built and installed libshout to /local/li...

Choosing a Perl GUI Module for maximum cross platform usage

I'm working on a couple of personal project to improve my Perl skills. Among other things they need to provide a GUI interface on different OSes. In the past what little GUI work I did on Perl used TK (and that was just working through some sample projects). I know that beyond TK, Qt and GTK are also options. Are there others? Among...

What Qt widget(s) to use for read-only, scrollable, collapsible, icon list

I'm relatively new to Qt, and am not entirely familiar with the out-of-the-box widgets. I have a somewhat (but not very) complex widget to create, and don't want to reinvent any wheels. What is the best QWidget to use as a starting point to subclass and/or QWidgets to use to compose my widget. Here is the end-result I am looking for (apo...

Is there any cleaner way to do this? (Prepared SQL queries in Qt C++)

I'm using QSqlQuery::prepare() and ::addBindValue() for my queries in a Qt project I'm working on. There's a lot of repeated code and though I think that's the "right" way, I wanted to make sure. Perhaps someone has alternative ideas? Example: QSqlQuery newQuery; newQuery.prepare("INSERT INTO table " "(foo,bar,baz," ...

What Qt widgets to use to draw a "game-of-life"-like application ?

For an experiment, I'd like to create a simple graphical application. My goal isn't complex: I just need to draw single pixels or lines of different colors, and refresh the view regularly. Something like Conway's Game of Life. I'm used to work with Qt but never for this kind of task. What widgets/objects should I use to get started ? ...

Keypad Driver Change in QT Event Handling ?

Hello All, I want to handle the event that like in mobile kaypad. I mean i want to handle multiple code for one key press event just like mobile keypad if we press e.g 2 key two times then it detect 'a' just like that. Is it possible from the driver ? If i want to handle in driver level then how to handle it ? i mean QT internally do th...

How do I get the correct case of a path?

I have a small but itching problem. How do I get the correct case for a Windows path in Qt? Let's say i have a path c:\documents and settings\wolfgang\documents stored in a QString str and i want to know the correct case, here C:\Document and Settings\Wolfgang\Documents. QDir(str).absolutePath() doesn't get me the path with correct case...

FUSE (Filesystem in Userspace) with Qt Programming

Hi all, I'm trying to use FUSE with Qt, but fuse_main() and app.exec() has their own event loop. This mean that if I start one the other will not start, since the first that starts prevents the other to start as shown below. How to deal with this? For more info about fuse, go to http://fuse.sourceforge.net/ Please, if possible, prov...

Font size QComboBox items?

Say I fill QComboBox with a number on each line. And lines are very close vertically. How can I control vertical the distance? ...

c++ Qt SIGNAL and SLOT not firing

Hi All I am new to C++ Qt programming. Having difficulty with hooking up buttons to signals and events. Not sure what i'm doing wrong, please see code below. Main.cpp #include <QtGui/QApplication> #include "MainWidget.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWidget mainWidget; mainWidget.s...

How to create a bulleted or numbered list with Qt?

How to create a bulleted or numbered list in QTextEdit with Qt by clicking a button? Also it is necessary that make a list the paragraphes which are selected by clicking the same button. And when the cursor is in the list and you click the button, the the list item becomes not-list item, but a simple paragraph. In two words I want to cr...

Why can't we create object in Qt without the new keyword (i.e. on stack)?

Why can't we create object in QT without the new keyword? Usually we create pointer to an object, like this: QLabel *ql=new QLabel(); ql->show() But I want to create an object like this: QLabel ql=QLabel(); ql.show() Is it possible? ...

qt + oracle connecting problem

Hi, I'm trying to connect to my db in Oracle with the following code: #include "mainwindow.h" #include <QCoreApplication> #include <QtGui> #include <QtSql> int main(int argc, char **argv) { QCoreApplication myApp(argc, argv); QSqlDatabase db; db.addDatabase("QOCI"); db.setDatabaseName("RFV75"); db.setUserName("RFV...

Get filename from QFile ?

Greetings all, eg: QFile f("/home/umanga/Desktop/image.jpg"); How I get only the filename - "image.jpg" Thanks in advance ...

Qt: can i load and manipulate the web page dom with QWebKit without rendering the page?

is there any way to load url and to manipulate the page dom without rendering the page i like to do it problematically without showing the page it self in the browser ...

Qt, CMake, Visual Studio and Q_OBJECT in cpp files

Hi, I'm developing a large project using Qt 4.6, CMake 2.8 and Visual Studio 2008 for the Windows platform. As far the build system goes, it's all standard stuff: I'm using CMake's QT4_WRAP_CPP macro to generate moc files from header files, which are then linked into the final executable in the add_executable command. Everything is wor...

How to add pre processing defs (macros) to qt creator?

In Eclipse there is an option to specify pre processing defines (#ifdef macros) to a project by using the Symbols option in Paths and Symbols. This helps in effective indexing of code which is cross platform. Is there any option to provide these in Qt creator? ...