qt4

Serialization with Qt

I am programming a GUI with Qt. In my GUI I have a huge std::map. And "MyType" is a class that has different kinds of filds. So, in a word, I want to serialize the std::map. How can I do that? Does Qt provides us with neccesary features? ...

Encrypt/Decrypt SQLite-database and use it "on the fly"

Here's the thing: In my Qt4.6-Project, I use a SQLite-Database. This database shouldn't be unencrypted on my harddrive. So I want, that on every start of my program, the user gets asked to enter a password to decrypt the database. Of course the database never should appear "in clear" (not encrypted) on my harddrive. So is there any possi...

How can I use Qt to get html code of the redirected page??

I'm trying to use Qt to download the html code from the following url: http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=nucleotide&cmd=search&term=AB100362 this url will re-direct to www.ncbi.nlm.nih.gov/nuccore/27884304 I try to do it by following way, but I cannot get anything. it works for some webpage such as www.google....

Qt How to make a column in QTableWidget read only.

I would like to have one column in QTableWidget NOT editable. I forums have read a lot about some flags bould could not manage to implement. Thanks in advance! ...

how to create multiple selections in text edit box in qt4?

Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. In Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods. I have no proble...

How to set QNetworkReply properties to get correct NCBI pages?

I try to get this following url using the downloadURL function as follows: http://www.ncbi.nlm.nih.gov/nuccore/27884304 But the data is not as what we can see through the browser, now I know it's because some correct information (such as browser type) is needed. How can I know what kind of information I need to set, and how can I set ...

Qt - How to associate data with QTableWidgetItem?

I want to associate aditional data with each QTableWidgetItem inserted into the table, in order to use that data in future, when it is being clicked on a table item. But that data should not be visible. How can I do that? ...

Setting checkstate on a ListWidgetItem

Hi, I'm trying to create a list of checkbox items that change the status on activation. I can connect the activate signal and everything seems to work, but changes on the screen. Am I missing some steps here? Here's the list creation: self.listField = QtGui.QListWidget(self) muted_categories = qb.settingsCollection['mutedCategories']...

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

Qt 4.6 QLineEdit Style. How do I style the gray highlight border so it's rounded?

I'm styling a QLineEdit to have rounded borders for use as a search box. The rounding of the borders themselves were easy, but I can't figure out for the life of me how to round the highlighted portion of the widget when it has focus. I've tried QLineEdit::focus, but this only modifies the interior border. The images below show how the i...

How to resize QMdiArea together with main window?

Hi! I have created an MDI application (using Qt 4.6) in Qt Creator and added QMdiArea to it. Now if I create new child windows, they created inside the mdiArea. That's completely fine. However, the mdiArea has the fixed size which is neither aligned with the main window, nor changed if the main window resized. What I'm looking for is th...

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

Qt 4.6.2 - QPropertyAnimation not works

Hi guy, I have a problem. I use a QPropertyAnimation to move a QLabel but not works. void TitleChannel::changeChannel(float angle){ int channel=(int)(angle/60); QPropertyAnimation *animation = new QPropertyAnimation(label, "geometry"); animation->setDuration(10000); animation->setStartValue(QRect(0, 0, 360...

Seeking advice on moving Qt 4 and Java applications between desktops on KDE 3

We've got a (perhaps?) unusual situation where we have a lot of applications built on Qt 4 and some applications built in Java (Swing) but we're using KDE 3. We're on Red Hat Enterprise Linux 5 and since there's no official version of KDE 4 for it, upgrading to KDE 4 is not a possible option. One of the things on our project our custome...

Why am I not getting mousePressEvents in a QGLWidget?

I am trying to catch mouse press events in a QGLWidget. I am attempting to use the movements of the mouse to move an artificial cursor (a "floating" dot) in a stereo window. I have reimplemented mousePressEvent in my own QGLWidget, here are the relevant sections of the .h and .cpp files: the .h file protected: void initializeG...

Proper way to relay signals across classes in qt4?

I have a QMainWindow which spawns a few wizards. The QMainWindow has a QFrame class that lists a collection of objects. I want to launch this window from within my wizard's QWizardPages. Basically, I need to connect a signal to a slot in the grand parent. The most obvious way to do this would be: MyMainWindow *mainWindow = qobject_cast...

Newline character into textfile using QFile

i want to put a newline into a txt file, i tried with many alternative with so many help from this forum but i am getting always unknown character always. Please help for(int i=0;i<fileDet.size();i++) { qDebug()<<"Name directory"<<fileDet.at(i); QFile data("output.txt"); if (data.open(QFile::Append )) { QTextStream out(&data);...

Constructing / destructing QApplication causes QWebView to mess up rendering of HTML

We need to create & destroy instances of QApplication, as we want to use Qt in a plug-in to an existing host application. void multiQT() { int argc = 0; QApplication app(argc, NULL); QWebView view; view.setHtml("<html><head><title>Title</title></head><body><h1>Hello World</h1></body></html>"); view.show(); app....

Qt : what is the difference between layout and widget?

I thought that layout is just a widget that keeps more widgets inside. But now I find that I can't add it to other widgets using addWidget. For instance how to add a layout to QSplitter? ...