The following code I am using to find the number of read bytes from QFile. With some files it gives the correct file size, but with some files it gives me a value that is approximatively fileCSV.size()/2. I am sending two files that have same number of characters in it, but have different file sizes link text. Should i use some other obj...
Hi,
i want to display a big string in Qlablel for this simply i have created a label in Qt GUI editor,
then i put the string, with the Wordwrap property ON.
here text is not coming to the next line itself, instead its crossing the view region.
but if i give "\n" it works well.
how to put up big string in label, to display in visible r...
Hi,
My GUI project in Qt has a lot of "configuration pages" classes which all inherit directly from QWidget.
Recently, I realized that all these classes share 2 commons slots (loadSettings() and saveSettings()).
Regarding this, I have two questions:
Does it make sense to write a intermediate base abstract class (lets name it BaseCon...
I need to support Windows 98. The Qt documentation claims this is possible, but there are no instructions. The distributed binaries of Qt 4.6 don't run on Win98 and the majority of Qt applications I have sampled also don't. For several apps that do run on 98, I have asked authors how they did it, but the common answer is that it was acci...
I am using the Qt QGraphicsScene class, adding pre-defined items such as QGraphicsRectItem, QGraphicsLineItem, etc. and I want to serialize the scene contents to disk. However, the base QGraphicsItem class (that the other items I use derive from) doesn't support serialization so I need to roll my own code. The problem is that all acces...
QT creator can build and run my projects perfectly, but it will skip straight over any breakpoints I set. I can't find any options to fix this, and I'd appreciate some help.
EDIT: The SDK is built in debug mode, and the project build configuration is set to debug.
...
Hello!
I recently started investigating Qt for myself and have the following question:
Suppose I have some QTreeWidget* widget. At some moment I want to add some items to it and this is done via the following call:
QList<QTreeWidgetItem*> items;
// Prepare the items
QTreeWidgetItem* item1 = new QTreeWidgetItem(...);
QTreeWidgetItem* ...
Is it possible to tell the Qt MOC that I would like to declare the class and implement it in a single file rather than splitting them up into an .h and .cpp file?
...
I'm trying to use QSystemTrayIcon to display a message after application initialization. My main loop immediately calls Init() function by using a single-shot timer with zero period:
int r;
QTimer::singleShot(0, &app, SLOT(Init()));
r = app.exec();
return r;
After some initialization steps, and the creation of trayIcon in MyApplicatio...
The ellipse is actually a circle. I know all the coordinates of both things, I just need to know whether or not a line goes through an ellipse.
Is this built in anywhere? SPecifically I am using QGraphicsEllipseIem and QLine but i can convert them to any other type
thanks
...
As the title says, how can I receive notification whenever a multi-line QTextEdit changes the size of its content?
(Note: *content size* is different from the control size, i.e. I want to know when lines were added or removed, or changed height because of a font change).
...
How do I process a signal of in a subclass? Let's say my subclass is derived from QTextEdit and is interested in the signal textChanged. It seems silly to connect an object to itself, I should be able to simply override the textChange method -- but it isn't virtual.
What is the accepted way to do this?
...
I use Visual Studio 2008, MySQL 5.0.90,Qt 4.6.3 and C++
I try connect MySql but it gives this error messages.
Driver not loaded.
I am new programmer. How cann I solve this problem? Thank a lot.
...
I want a Qt window to come up with the following arrangement of dock widgets on the right.
Qt allows you to provide an argument to the addDockWidget method of QMainWindow to specify the position (top, bottom, left or right) but apparently not how two QDockWidgets placed on the same side will be arranged.
Here is the code that adds th...
A senior developer in my team used traditional C-style callbacks in our Qt application instead of using Qt signal/slot mechanisms.
My first reflex would be to replace his code and use Qt signal/slot instead.
Is there any good reasons to use callbacks in a Qt application/library?
Thanks.
...
I would like to read and parse certain elements of html files but I'm not interested in rendering it in any way.
Basically I would like to go through all my div tags and get some of its style attributes.
This is what I've done so far:
QWebPage page;
QWebFrame * frame = page.mainFrame();
QUrl fileUrl("localFile.html");
frame->setUrl(fil...
I want to start a new C++ (Qt) Open Source project and I'm wondering if there is an existing template somewhere for files usually found in an Open Source project but that are not purely source code (README, LICENSE, CHANGELOG, etc.)
I could probably find a popular Open Source project for inspiration but if there is some existing generi...
Using Qt Creator, I am creating a class with custom slots in Qt:
class CustomEdit : public QTextEdit
{
Q_OBJECT
public:
CustomEdit(QWidget* parent);
public slots:
void onTextChanged ();
};
However, I'm getting thise linker error:
undefined reference to 'vtable for CustomEdit'
The documentation says:
if you get ...
I have this class:
class CustomEdit : public QTextEdit
{
Q_GADGET
public:
CustomEdit(QWidget* parent);
public slots:
void onTextChanged ();
};
CustomEdit::CustomEdit(QWidget* parent)
: QTextEdit(parent)
{
connect( this, SIGNAL(textChanged()), this, SLOT(onTextChanged()));
}
void CustomEdit::onTextChanged (...
I like Qt Creator as an IDE, but the built-in compiler is slower than dirt.
Can I replace it, and if so, with what?
Developing on Windows but targeting multiple Mac as well.
...