Even when you get this bit working, like I said I suspect your whole approach like now is not going to achieve what you want in the way of making these values available to every module, so you're going to have to do it a different way like I said anyway...
Good evening, I'm sorry for my absence.
It's true! The problem is a C ++ concept that I have been studying for a short time, together with QT. But those who use QT, if I understand correctly, also know C ++. For that I asked the question here. Apart from that, I think it's right that what you said also on the approach. I think that my intent must act in another way. the question is which one?
in your connect statement the first param is an object emitting a signal and the second one is a method (signal) of that object's class. Class QPushButton doesn't have a method (signal) named sayHello. It's a method (signal) in MainWindow class.
QPushButton has a method (signal) named clicked(), so you can connect that. If you want to call pushed() when the button "Hi" is clicked then you connect like this:
If you want the main window to emit sayHello when the button "Hi" is pressed and then in response to that you want to call replyHi you make two connections:
connect(ui->pushButton_2, &QPushButton::clicked, this, &MainWindow::sayHello); // emits sayHello when the button is clicked
connect(this, &MainWindow::sayHello, this, &MainWindow::replyHi); // calls replyHi when sayHello is emitted
Yes, and therein lies the dilemma - the extern "C" turns off the function decoration that template function names require. I'd gone through and used extern "C" on all my classes, and that got me into trouble.
That's because C does not support templates (or classes!). The API wrapped in extern "C" must be C-compatible.
Can I then add USE_NAMESPACE to the definition of an application that links to that library?
Nope. The linker very much cares about namespaces, to answer your title. The namespace identifier will be part of the fully qualified name of the symbol, so you need to link with code compiled with a compatible header.
this has nothing to do with Qt.
std::to_string is C++11, you have to make sure you have a recent enough compiler and to enable C++11 features. If you use Qt Creator you should add CONFIG += c++11 in your .pro file and re-run qmake
Alternatively you can #include <sstream> and use std::stringstream gstream; gstream << 4; std::string g=gstream.str();
Actually, while I'd deleted the action code from mainwindow.cpp, I hadn't deleted its prototype in mainwindow.h. That's what the compiler was complaining about. So I deleted it in the .h and then ran Build -> Clean All. Doing that removed the reference to the deleted action in the moc file. Problem solved. Thanks again for your help.
Thank you for your response. I understand exactly what you're talking about. This is what I needed, I just didn't know how to go about it. I'll get busy with this and see if I can accomplish what you laid out for me. Thanks again. Very much appreciated.
Anyway, the bug is in line 61 in = &inFile; - you assign a variable created on a stack to variable in. In the next line, the inFile goes out of scope and is deleted. So when you try to access in later in the code, it segfaults.
Thanks !! . I know it's not Qt problem but that's why i posted it in C++ section
I would guess that is indeed the reason if none of those work! It always helps if you tell us which OS you are under, especially if it's not Windows! I would imagine this is a desktop-thing, so more than Lubuntu what is probably relevant is which desktop manager you are using. And it may be that your manager does not allow you not to have an icon....
I am using Linux - Lubuntu which has LXDE. Is there anyway to fix this? Is there any other way in QT to show a frame-less window/dialog/message/label/etc without a task-bar entry?
Can you specifically explain to me why Qt 5 is better than Qt4? Are you talking about Qt service?
Qt 4 reached End-of-Life status in December 2015. This means it is no longer supported -- it will not receive any new features, bug fixes, or security fixes.
If someone finds a security vulnerability in Qt 4, that means they could attack any computer that runs Qt 4 software. The user of the software will have no protection because the flaw will never be fixed. In contrast, if such a vulnerability is found in a supported version of Qt 5, the vulnerability will be fixed urgently so that users cannot be attacked.
If you find a bug in Qt 4 that affects your project, there is not much you can do about it -- you'll need to find your own workaround to the bug or patch Qt yourself. In contrast, if you find a bug in a supported version of Qt 5, you can file a bug report and there's a good chance it will be fixed.
In any case, better have some more information about your project otherwise it's only going to be speculations.
What specific kind of information?
For starters: What is your development PC's OS? What is your deployment target's OS? Will the final product be released to customers, or is it for internal use only? How do you plan to maintain the project? Which features of Qt do you plan to use?
Hi I had the same problem with qtsqldrivers-config.pri
I leave it here, maybe it will be helpful
Go to :
After that I got:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. yes
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Then go to:
Run qmake again:
You will see as a part of an output message that it was compiled and moved into:
"mv -f libqsqlmysql.so ../plugins/sqldrivers/"
I try to solve this problem for the whole night,your solution saved me.Solve the problem perfectly. Thanks very much.Thanks .
Disabled Categories are greyed out
This topic will be moved to the category
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.