qt4

Date check for counting 30 days

Hi, I want to count the days passed with respect to a given date. I have a predefined date with me and i want to check the days passed, once the day pass 30 days with respect to the given time i want to get a message. example given date is25/03/2010 and when my system date reaches 25/04/2010 i have to get a message. How can i implement...

Adding an inheritance to an Qt designed object

Hello, I have a problem and I want to implement the MVC pattern to my QT application, that's why I need for example to inherite in my QTableWidget about another class like myClass { myMethod(); } but our QTableWidget is contained by our Mainwidows that is designed by the QT designer and generate an ui_MainWindow class ! Do you ...

Best Practice: QT4 QList<Mything*>... on Heap, or QList<Mything> using reference?

Hi Folks, Learning C++, so be gentle :)... I have been designing my application primarily using heap variables (coming from C), so I've designed structures like this: QList<Criteria*> _Criteria; // ... Criteria *c = new Criteria(....); _Criteria.append(c); All through my program, I'm passing pointers to specific Criteria, or often t...

Cannot complete a basic task in QT4

Hi all, I cannot open a new window in QT. I new in QT so I think I am missing something. I only write the code below and settings windows just shows itself and closes. I have commented out destructor but still problem persists. SettingsWindow s; s.show(); What do I do wrong ? By the way I cannot either debug it, debuger does not stop...

Copy directory using Qt

I want to copy a directory from one drive to another drive. My selected directory contains many sub directories and files. How can I implement the same using Qt? ...

Qstring replace is not working fine

hi, i want to replace temp.replace (QString("/"), QString("\")); Here i am getting error error C2001: newline in constant error C2275: 'QString' : illegal use of this type as an expression How can i replace "/" with "\" ...

How to make Qt::Tool not stay on top of the main window.

I have problem with Qt::Tool flag. When I create new widget with Qt::Tool flag it appears on top of the main window. But when I switch back to main window and make it active the I still have the tool widget in front so it my main window is not fully visible. Qt::WindowStaysOnTopHint is not active. Just in case - environment is KDE4 Th...

Qt - resize QTextEdit in a QWidget while it is being resized the QWidget

How to make QTextEdit to be resized in a QWidget while the QWidget is being resized? Should I overload resizeEvent functin for the QWidget? ...

QSplitter becoming undistinguishable between QWidget and QTabWidget

I am puting a QWidget and a QTabWidget next to each other in one horisontal splitter. And the splitter loses it's shape, you can know that there is a splitter only by hovering mouse on it. How to make it visible? Thanks. ...

[QT development] - Way to exclude a char from a word selection

I'm extending a QPlainTextEdit. When I double click on a word containing a pipe char ex : {"foo"|upper|reverse} the whole text is surrounded. I'd like to exclude the pipe char "|" from the selection and don't know what to do Is there a way to change the behavior of QTextCursor::WordUnderCursor? I'd like that char to act the same as a ...

Qt Stylesheets with derived classes

Can I use Qt stylesheets with a derived widget? I'd like to be able to define some custom properties on the widget (like various colors) and be able to define their value in a stylesheet. Is this possible? ...

How to open file and Directory in QT

Hi, I want to open Directory and file using the same function. Is it possible to do the same in QT. I used QString directory = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); Here i can open only directory. How to open both file and direc...

Supported Audio Formats of Qt4 Phonon?

I am making a music player in PyQt4, and I am using Phonon to play the music itself. This application is aimed primarily at Windows, but I plan on also supporting Mac and Linux versions. What I want to know is which audio formats are supported by Phonon so that I can ensure that the user only enters those files. ...

Digital SIgnature on video

Hi, I want to keep digital signature on each video i recorded, so that when that video is playing in any player it have to show video with the signature. I want to keep an image in transparent form same like channel logo on each video showing in channels. I am using directshow ...

click feature in Qt

Hi, I just want to clarify, weather the feature is present or not in Qt. The scenario is like this, I have a list view with items, I want to place the icon to the listview when the item is selected. The selection I mean is, first time when I click item should be selected, next time if I click the same item then it should display some ...

Qt -how to know whether content in child widgets has been changed?

In QMainWindow I have 2 QSplitters. In that splitters I have QTextEdit, QLineEdits, QTableWinget, Ragio buttons and so on... I want to know if somthing has been chaged after pressing File->New menu button. Is there any general method for doing this? Somwhere I have read that it is recomended to use isWindowModified() function of QMainWi...

Accessing an enum stored in a QVariant

Hi, I have registered an enumeration type "ClefType" within my header file - this enum is registered with the MetaObject system using the Q_DECLARE_METATYPE and Q_ENUMS macros. qRegisterMetaType is also called in the class constructor. This allows me to use this type in a Q_PROPERTY, this all works fine. However, later on, I need to be...

exposing subcontrols from the custom widget plugin in QT

I am using QT 4.3. I have created one custom widget plugin. I could be able to show it in the desiner tool box as well as use it on the form with no problem. This custom widget internally holds QGroupBox, QLabel, QTextEdit. Now I want to apply the styles to individual componets of this custom widget. I want to expose these internal ...

Normal C++ code in Qt doesnt build and run

Hello. I am using Qt under linux, if it matters. I ran successfully under Geany (a simple c++ compiler) the following: //my first program in C++ Hello World! #include <iostream> using namespace std; int main () {cout << "Hello World!"; return 0;} I opened Qt source file and copied the exact same code and i can't build or run. Thank...

qtruby, QUiLoader and respond_to?

I'm writing a simple Qt4 application in Ruby (using qtruby) to teach myself both. Mostly it has gone well, but in trying to use Ruby's "duck typing" I've run into a snag; respond_to? doesn't seem to reflect reality. irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'Qt4' => true irb(main):003:0> require 'qtuitools' =...