qt

Qt multiple key combo event

Hi guys, I'm using Qt 4.6 and I'd like to react to multi-key combos (e.g. Key_Q+Key_W) that are being held down. So when you hold down a key combo, the event should be called all the time, just the same way as it works with single key events. I tried to use QShortcuts and enable autorepeat for them, but that didn't work: keyCombos_.pus...

QTableView sorting signal?

I use QTableView + QStandardItemModel to show some data (data stored in some other data structure), and this table view is sortable. Since it is sortable, when sorting this model, I also need to sort the order of stored data. I try to implement a slot for the sorting signal, but I don't know what signal is emitted when clicking the head...

Adding Qxt plugin to Designer

Hey guys, I'm having a problem with adding the Qxt library to Qt Designer. The error it gives is: Cannot load library C:/Qt/4.6.2/plugins/designer/QxtDesignerPlugins.dll; The specified module cannot be found. Any ideas on what the problem is? ...

Qt Action Dropdown Widget

Hello, I am creating a drawing application where the user can insert primitive shapes, like circles, triangles, etc. In the toolbar, I would like to have a single "Add Shape" button that shows a dropdown widget when pressed. In the dropdown, I would like to have a grid of QAction icons representing the different shapes the user can ad...

libssh2_channel_close will be blocked until the remote command exit

I use libssh2 to login a remote computer, then call libssh2_channel_exec to execute a daemon program, the daemon program will then select a available tcpip port and print the selected prot to console(stdio). Then, the daemon will listen the port for the incomming connect. After these step, the client will read the selected tcp port from...

c++ qt taskbar menu action

hello, i got this code in qt creator; int main( int argc, char* argv[] ) { QApplication oApp( argc, argv ); QAction *action1; QMenu menu; QSystemTrayIcon TrayIcon( QIcon("favicon.ico") ); TrayIcon.show(); action1= new QAction("action1", NULL); action1->setStatusTip("Create a new file"); menu.addAction(bf2142); TrayIcon.setC...

c++ qt quit on action

i got an action in my menu; connect(action, SIGNAL(triggered()), this, SLOT(action1())); but when i executed the function my program always exited. how to solve this? ...

qt - In QGraphicsScene I can't get the correct Item

I am trying to create a chessboard. All the coins are transparent and the board is not. When I tried to get the clicked item using the function 'itemAt' it always returning the backGround item(that means the board). I am suspecting that due to the fact that the coins are transparent, they are not selected. ...

Is int guaranteed to be 32 bits on each platform supported by Qt, or only qint32?

I remember reading somewhere that Qt guarantees the size of some data types on supported platforms. Is it that int will be at least 32 bits everywhere, and qint32 will be exactly 32 bits everywhere? Or something else? C++ guarantees that int will be at least 16 bits, and some Qt structures like QRect and QPoint use int internally. I'm d...

How to handle state transitions and yet replace "if" statements with polymorphic types?

Recently I was listening to a tech talk on clean coding. The speaker was a test engineer, who emphasized on avoiding the "if" statements in the code and use polymorphism as much as possible. Also he advocated against global states. I quite agree with him, yet i need a clarification on replacing the global state and "if" statement using ...

Are you aware of any lexical analyzer or lexer in Qt?

Are you aware of any lexical analyzer or lexer in Qt? I need it for parsing text files. ...

Qt's QList: which is the canonical form of getting the number of items in a list?

Qt's QList class provides several methods for getting the number of items in the list - count, length, and size. As we all know, consistency is important, so which should be the canonical/preferred method to use of those 3? ...

How to tell the mouse button using QApplication::mouseButtons() in a "click" slot??

I have a QMainWindow, and want to handle the "clicked" signal from a smaller widget (such as tableview) inside it. Originally I connect the signal to a slot of this QMainWindow, this is the most common approach. Now I need to tell which mouse button is clicked, and do different things for left and right button, I found that the "clicke...

How to design a text editor in QT ?

I want to design a text editor in QT and planning to implement the following basic features, 1) Basic editing features like cut,paste,formatting,indentation etc. 2) Auto completion based on the context.(Based on some xml input file) 3) Syntax highlighting ( based on some xml input file ) Can you please suggest some approaches for the...

Qt - How to get the "Temp" dir for an arbitrary user?

For each OS there is a location for storing temporary data. It could be like: C:/Users/[user name]/AppData/Temp (or so). How can I get this path independently from OS with QT? ...

c++ qt read xml file

if i got an xml file like this: <?xml version="1.0" encoding="utf-8"?> <name> <id>1</id> </name> how can i read everything that i got string id = ... (1 in this case); ...

How to ensure that randomly generated numbers are not being repеаted?

Possible Duplicates: Unique random numbers in O(1)? How do you efficiently generate a list of K non-repeating integers between 0 and an upper bound N I want to generate random number in a certain diapason, and I must be sure, that each new number is not a duplicate of formers. One solution is to store formerly generated numb...

how to load dynamiclly Qgif and Qjpg in Qt 4.6

hi i like to load the qgif,qjpeg,qmng,qico,qsvg,qtiff as dynamic plug ins in Qt because i dont what to break the Qt LGPL license is in the docs its says only about statically linking . link text ...

Synchronizing sqlite database from memory to file

I'm writing an application which must log information pretty frequently, say, twice in a second. I wish to save the information to an sqlite database, however I don't mind to commit changes to the disk once every ten minutes. Executing my queries when using a file-database takes to long, and makes the computer lag. An optional solution...

Where to install files for Qt-based application on Ubuntu/Debian

I am looking for tips on how to package my Qt-based application for Ubuntu/Debian distributions. Let's say the application (executable) is myapp. Running objdump -p myapp | grep NEEDED, I see that it has the following dependencies: libicuuc.so.44 libicui18n.so.44 libicudata.so.44 libQtGui.so.4 libQtCore.so.4 libpthread.so.0 libstdc++.so...