qt4

No such signal in QT4

I have a signal and a slot that should fit together quite nicely. class MemberVisitor: public QObject { Q_OBJECT signals: void processMember(Member* member, bool &breakLoop); public: void processList(QList<Member*>* list); }; along with: class MemberFinder: public QObject { Q_OBJECT public slots: void processMembe...

How to paginate a QPlainTextEdit?

I've been using QPlainTextEdit for editing text in our application. Recently it was decided that we need to display the text in a paginated format instead of a consistent block of text. After lots of research, I've come to the realization that while QPlainTextEdit does not have any knowledge of pages or pagination, QPlainTextDocument doe...

QTWebKit Mac Flash 10.1 plugin Double Type Error

I actually use PyQT but I can replicate the issue using QT aswell. Basically when I navigate to a flash website where I have to input text using QWebView it doubles all my key presses. This only happens in flash 10.1, it does not happen when I use the flash 10.0 or lower plugin (I have tested flash 9 aswell). The bug, as far as I can ...

How to change text alignment in QTabWidget?

I cannot find a way to set the text alignment in a QTabWidget. After I've created an instance of this widget, I've set its tabPosition property to West, but I wish it showed text/label horizontally. I've given a look to the Qt's stylesheets, but as you can see, the text-align property can only be set on QPushButton and QProgressBar. I...

How to use QColumnView to display multiple columns of data

I want to display data in multiple columns in a QColumnView. I am using Qt Creator and Qt 4 for development. Consider an address book application where you have multiple groups: Group 1, Group 2, etc. Your contacts can belong to any of those groups. Group 1: John Smith Pocahontas Group 2: Chief Powhatan Group 3: ... W...

Qt4 Model/View - Transforming data in View?

Here's my use case (very simplified). I have some data from DB in QSQLTableModel and I need to transform it: merge few fields into one (and display as such) or split one field into few. How and where this should be done in Model/View? Notes: I tried using AbstractProxyModel to do this, but I guess, it's suitable only for filtering or...

How to use QT 4.6.3 Binding with Lazarus

Is there a way to use QT 4.6.3 visual controls with Lazarus 0.9.28.2 Beta? How I can install the QT widgets and have them in my Controls pallete? ...

QtSingleApplication QMessageBox yes action is taken even if no is selected

I have an application in Qt that will override a shut down in case a user didn't save their document. It looks like this: class MyApplication : public QtSingleApplication { public: MyApplication(int argc, char *argv[]) : QtSingleApplication(argc, argv, true) { } ~MyApplication() { } void commitData(QSe...

QT Plugin with CMake

Greetings all, I am trying to implement a QT Plugin with CMake. But this "Q_EXPORT_PLUGIN2" directive stops my class from compiling. I can compile the plugin if I commented this out,but it won't work as a plugin if I do so. QT doc says: Q_EXPORT_PLUGIN2 ( PluginName, ClassName ) The value of PluginName should correspond to the...

QtConcurrent in QT for Symbian

Hi all! I have a question about supporting of QtConcurrent in Qt for Symbian. I use Qt 4.6.2 but I'dont understant how to use QtConcurrent. All works fine on Wice platform in the same version of QT, but doesn't work on Symbian. How to enable QtConcurrent, QFuture, QFutureWatcher? Big thanks in advance for your answers! ...

Using linux sockets the QT way?

I have been googling this, but I can't seems to find it. Is there a QT way to use linux sockets? It looked like the QSocket class is used for network sockets and not for local linux sockets. Anyone knows anything about this? And maybe a tutorial to get started? ...

Promote to custom widget in a namespace

I have MyCustomWidget in a namespace MyNameSpace namespace MyNameSpace{ class MyCustomWidget : public QWidget{ }; } How do I promote a QWidget to MyCustomWidget in my UI form? It doesn't seem to accept a custom namespace. ...

What determines sorting of files in a QFileDialog?

Users open files in our app through a QFileDialog. The order of the filenames is bizarre. What is determining the sorting order, and how can we make it sort by filenames, or otherwise impose our own sorting, perhaps giving it a pointer to our own comparison function? The documentation and online forums haven't been helpful. Unless i...

How can I move file into Recycle Bin / trash on different platforms using PyQt4?

I would like to add the next feature to my cross-platform PyQt4 application: when user selects some file and select "remove" action on it that file will be moved to Recycle Bin folder instead of being permantly removed. I think I can find Windows-specific solution using Win32 API or something similar, but I'd like to know does similar op...

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...

At will scaling and rotation in a 2D space -- Almost but a funny translation

Hi, I posted few weeks ago a problem that I had with combining rotation and scaling in a 2D space. Thanks to SigTerm (StackOverflow) and a tutor of geometry I almost make it work. However, I have a translation problem. When the software scales an object using a fixed-point of scaling, the result matrix has a translation, but we (my tuto...

Are QUndoCommands supposed to be tied to a view or a model?

In Qt's undo framework, you can have a stack of QUndoCommand instances. Each of these describes an action in the user interface. In our application, we have a set of views working on a set of models, some in combination, and we often have more than one view working on the same set of models. I'm now looking at the ability to undo acti...

How do I open a dialog and retrieve strings from it, in QT 4?

This is the main window so far and the second window is a dialog window. How do I get the text from a textbox on window2 when it closes? Thanks. #include "mainwindow.h" #include "window2.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ...

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 ...

How do I get resize handles in QT?

Is there a way to get a resize effect between two widgets? Like say I have two QTextEdit boxes next to eachother, I want to get a handle between them so I can move it back and forth. Sort of in the same way that the textarea I'm writing in now has a handle at the bottom for making it larger. I'm using QT Creator and I can't seem to figu...