Search Results

Search found 2217 results on 89 pages for 'qt creator'.

Page 11/89 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Retrieve position of a google maps v3 marker to Qt in a desktop app with QtWebKit

    - by nelas
    I'm building a Qt app with Python where you can point and click at a (google) map and get the coordinates of the location. The map is shown through a QWebView loading a simple HTML page and the user can create markers by clicking. Screenshot of the widget after clicking on the map: However, I'm having trouble to retrieve the just-clicked location coordinates back to Qt (so that I can use them as variables -- and, for example, show them in the QLineEdits on the topleft corner above, as current location of the marker). This is the relevant part of the HTML file: <script type="text/javascript"> var map; function initialize() { var local = new google.maps.LatLng(-23.4,-40.3); var myOptions = { zoom: 5, center: local, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'rightclick', function(event) { placeMarker(event.latLng); }); } function placeMarker(location) { var clickedLocation = new google.maps.LatLng(location); var marker = new google.maps.Marker({ position: location, map: map }); map.setCenter(location); } function dummyTxt() { return 'This works.'; } </script> I've been trying with evaluateJavaScript, but was not able to retrieve the coordinates. I tried to created a function to access the position with marker.getPosition(), but with no luck. The dummy below works though.. newplace = QWebView.page().mainFrame().evaluateJavaScript(QString('dummyTxt()')) >>> print newplace.toString() This works. Any suggestions on how to get the coordinates back to Qt?

    Read the article

  • Qt moc failure without an error message

    - by Robert Parker
    So I'm pretty new to Qt, and I've just inherited a project from someone else who is also new to Qt. He isn't around this week btw. We are using Visual Studio 2008, and have the latest version of Qt installed(4.6.2). The project builds on my coworker's machine fine, and I can get the project from svn and build it directly. But under any other circumstances it refuses to build on my machine, and it doesn't give me much of an explanation why. Even if I just do a 'build clean' and then a 'build' it doesn't work. Any slight modification will make it fail. When I try to build the entire project I get the error message: 1Moc'ing MatrixTypeInterface.h... 1moc: Cannot create .\GeneratedFiles\Debug\moc_MatrixTypeInterface.cpp;.\GeneratedFiles\Debug\moc_matrixtypeinterface.cpp 1Project : error PRJ0019: A tool returned an error code from "Moc'ing MatrixTypeInterface.h..." The moc tool doesn't give any sort of error message as to why it isn't working, and I wasted most of yesterday trying to figure out why. I got the command that VS was using to call moc, and I entered in the command line myself. It didn't write anything to the screen. Any ideas?

    Read the article

  • QT EventTransition implementation

    - by Thomas
    I am trying to build an QT State Maschine. I have some States, and for those States i need Transition that alter the Graphics on my gui. The Problem i having and the only reason i am asking, i am Stuck and Point 1. The compiler cant identifie the QTEventTransition. I have QT 4.6 wroking with QT Creator on Windows. The compiler does not find Header #include < QtEventTransition This is what i did i never did this bevor but i think it should be correct, I have A Header File where i have my Transitions Declareted like this: class validateBoatTransition : public QtEventTransition { public: validateBoatTransition(Widget *widget,ServerSkeleton* server); protected: bool eventTest(QEvent *e); void onTransition(QEvent *); private: Chart* ourChart; Message current; BarelySocket* myBarelySocket; }; Than i have my Cpp File where i have this: validateBoatTransition::validateBoatTransition(Widget *widget,ServerSkeleton* server) { } void validateBoatTransition::onTransition(QEvent *e) { /* My Logik should go here */ } What i want is that if the Transition is activated by an Button (clicked) it should fire this transition! I searched the net, but cant find an solution. Can i do that? I should i think. Yours Thomas

    Read the article

  • Qt moc not error

    - by Robert Parker
    So I'm pretty new to Qt, and I've just inherited a project from someone else who is also new to Qt. He isn't around this week btw. We are using Visual Studio 2008, and have the latest version of Qt installed(4.6.2). The project builds on my coworker's machine fine, and I can get the project from svn and build it directly. But under any other circumstances it refuses to build on my machine, and it doesn't give me much of an explanation why. Even if I just do a 'build clean' and then a 'build' it doesn't work. Any slight modification will make it fail. When I try to build the entire project I get the error message: 1Moc'ing MatrixTypeInterface.h... 1moc: Cannot create .\GeneratedFiles\Debug\moc_MatrixTypeInterface.cpp;.\GeneratedFiles\Debug\moc_matrixtypeinterface.cpp 1Project : error PRJ0019: A tool returned an error code from "Moc'ing MatrixTypeInterface.h..." The moc tool doesn't give any sort of error message as to why it isn't working, and I wasted most of yesterday trying to figure out why. I got the command that VS was using to call moc, and I entered in the command line myself. It didn't write anything to the screen. Any ideas?

    Read the article

  • Prototyping Qt/C++ in Python

    - by tstenner
    I want to write a C++ application with Qt, but build a prototype first using Python and then gradually replace the Python code with C++. Is this the right approach, and what tools (bindings, binding generators, IDE) should I use? Ideally, everything should be available in the Ubuntu repositories so I wouldn't have to worry about incompatible or old versions and have everything set up with a simple aptitude install. Is there any comprehensive documentation about this process or do I have to learn every single component, and if yes, which ones? Right now I have multiple choices to make: Qt Creator, because of the nice auto completion and Qt integration. Eclipse, as it offers support for both C++ and Python. Eric (haven't used it yet) Vim PySide as it's working with CMake and Boost.Python, so theoretically it will make replacing python code easier. PyQt as it's more widely used (more support) and is available as a Debian package. Edit: As I will have to deploy the program to various computers, the C++-solution would require 1-5 files (the program and some library files if I'm linking it statically), using Python I'd have to build PyQt/PySide/SIP/whatever on every platform and explain how to install Python and everything else.

    Read the article

  • Qt display image in a new window

    - by user312543
    Hi, I am naive to Qt and GUI programming. http://stackoverflow.com/questions/1357960/qt-jpg-image-display/2605463#2605463 The procedure given for displaying an image is working fine and thank you for providing that. But I want to display an image when I click on radiobutton. I created a slot, and I connected the button click event to the slot (dispImage is my slot). My slot consists only the code which is working to display an image (First answer in this link). I am able to compile it and run it. But the o/p is not as we desire. On button click, image windoe flashes for a sec and disappears. One more point to share is, I tried the same with windowsflags example present in qt examples. In this example I want to display the image on the preview window created by us. Even this is also not worked for me. Please provide me the solution. Thanks in advance.

    Read the article

  • C++/Qt - Memory allocation question

    - by HardCoder1986
    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* item2 = new QTreeWidgetItem(...); items.append(item1); items.append(item2); widget->addTopLevelItems(items); So far it looks ok, but I don't actually understand who should control the objects' lifetime. I should explain this with an example: Let's say, another function calls widget->clear();. I don't know what happens beneath this call but I do think that memory allocated for item1 and item2 doesn't get disposed here, because their ownage wasn't actually transfered. And, bang, we have a memory leak. The question is the following - does Qt have something to offer for this kind of situation? I could use boost::shared_ptr or any other smart pointer and write something like shared_ptr<QTreeWidgetItem> ptr(new QTreeWidgetItem(...)); items.append(ptr.get()); but I don't know if the Qt itself would try to make explicit delete calls on my pointers (which would be disastrous since I state them as shared_ptr-managed). How would you solve this problem? Maybe everything is evident and I miss something really simple?

    Read the article

  • What package do I need to build a Qt 5 & CMake application?

    - by Kevin Reid
    I'm trying to build sdrangelove, which wants Qt 5 and uses CMake for its build system, on Ubuntu 13.10. What package do I need to install to give it the file it's asking for here? There are a lot of *qt5* packages, and I've tried installing the promising looking ones to no effect. All the discussions I've found either have things working fine or are talking about writing CMake build rules rather than executing them. I don't have a lot of experience with the organization of Debian/Ubuntu packaging. CMake Error at CMakeLists.txt:14 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" (requested version 5.0) with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed.

    Read the article

  • Who knows the value of global variables in the qt qtscript script to access the global variable to change the global variable value; [closed]

    - by dawntrees
    Who knows the value of global variables in the qt qtscript script to access the global variable to change the global variable value; forexample int gVar=0; int main(int argc, char *argv[]) { QScriptEngine engine; QScriptValue varValue = m_engine-newVariant(gVar); engine.globalObject().setProperty("gVar", varValue); QScriptValue result = m_engine->evaluate("gVar=100;"); qDebug()<<"gVar================"<<gVar; return 0; } Why gVar = 0 and not equal to 100; how can we make gVar equal to 100(gVar=100) Who can help group I appreciate it, thanks!

    Read the article

  • Functions connected to signals in QtScript (on Qt 4.5.2) are not firing

    - by Cody Brocious
    I've injected into a proprietary Qt (4.5.2) application, added my own compatible build of QtScript, and have managed to get access to all the signals I need. However, when connecting to them (via QtScript) my functions are never called. I've come up with a few theories for why this is and I've tested everything I can think of, but I've hit a bit of a wall. Note, I've never had any connection exceptions whatsoever. Here are my current theories: The signals I'm connecting to are already connected to other slots, and that's somehow blocking it (but as far as I know, all Qt signals fire to all slots with no extra work, and can't be restricted in this way) The signals are rejecting my connection, or disconnecting me after connection (but I see no facility for this) My connection is happening from another thread, and this is somehow causing it not to connect properly Are any of these theories plausible? If not, what have I missed?

    Read the article

  • Qt vs .NET - plz no n00bs who don't know wtf they're talking about [closed]

    - by Pirate for Profit
    Man in all these Qt vs. .NET discussions 90% these people don't know WTF they're talking about. Trying to get a real comparison chart going before we embark on a major fucking project. And yes I'm drunk, and yes I use cocaine. Event Handling In Qt the event handling system you just emit signals when something cool happens and then catch them in slots, for instance emit valueChanged(int percent, bool something); and void MyCatcherObj::valueChanged(int p, bool ok){} blocking them and disconnecting them when needed, doing it across threads... once you get the hang of it, it just seems a lot more natural and intuitive than the way the .NET event handling is set up (you know, object sender, CustomEventArgs e). And I'm not just talking about syntax, because in the end the .NET delegate crap is the bomb. I'm also talking about in more than just reflection (because, yes, .NET obviously has much stronger reflection capabilities). I'm talking about in the way the system feels to a human being. Qt wins hands down i m o. Basically, the footprints make more sense and you can visualize the project easier without the clunky event handling system. I wish I could it explain it better. The only thing is, I do love some of the ease of C# compared to C++ and .NET's assembly architecture. That is a big bonus for modular projects, which are a PITA to do in C++. Database Ease of Doing Crap Also what about datasets and database manipulations. I think .net wins here but I'm not sure. Threading/Conccurency How do you guys think of the threading? In .NET, all I've ever done is make like a list of master worker threads with locks. I like QConcurrentFramework, you don't worry about locks or anything, and with the ease of the signal slot system across threads it's nice to get notified about the progress of things. Memory Usage Also what do you think of the overall memory usage comparison. Is the .NET garbage collector pretty on the ball and quick compared to the instantaneous nature of native memory management? Or does it just let programs leak up a storm and lag the computer then clean it up when it's about to really lag? However, I am a n00b who doesn't know what I'm talking about, please school me on the subject.

    Read the article

  • Resizing QT's QTextEdit to Match Text Height: maximumViewportSize()

    - by Aaron
    I am trying to use a QTextEdit widget inside of a form containing several QT widgets. The form itself sits inside a QScrollArea that is the central widget for a window. My intent is that any necessary scrolling will take place in the main QScrollArea (rather than inside any widgets), and any widgets inside will automatically resize their height to hold their contents. I have tried to implement the automatic resizing of height with a QTextEdit, but have run into an odd issue. I created a sub-class of QTextEdit and reimplemented sizeHint() like this: QSize OperationEditor::sizeHint() const { QSize sizehint = QTextBrowser::sizeHint(); sizehint.setHeight(this->fitted_height); return sizehint; } this-fitted_height is kept up-to-date via this slot that is wired to the QTextEdit's "contentsChanged()" signal: void OperationEditor::fitHeightToDocument() { this->document()->setTextWidth(this->viewport()->width()); QSize document_size(this->document()->size().toSize()); this->fitted_height = document_size.height(); this->updateGeometry(); } The size policy of the QTextEdit sub-class is: this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); I took this approach after reading this post. Here is my problem: As the QTextEdit gradually resizes to fill the window, it stops getting larger and starts scrolling within the QTextEdit, no matter what height is returned from sizeHint(). If I initially have sizeHint() return some large constant number, then the QTextEdit is very big and is contained nicely within the outer QScrollArea, as one would expect. However, if sizeHint gradually adjusts the size of the QTextEdit rather than just making it really big to start, then it tops out when it fills the current window and starts scrolling instead of growing. I have traced this problem to be that, no matter what my sizeHint() returns, it will never resize the QTextEdit larger than the value returned from maximumViewportSize(), which is inherited from QAbstractScrollArea. Note that this is not the same number as viewport()-maximumSize(). I am unable to figure out how to set that value. Looking at QT's source code, maximumViewportSize() is returning "the size of the viewport as if the scroll bars had no valid scrolling range." This value is basically computed as the current size of the widget minus (2 * frameWidth + margins) plus any scrollbar widths/heights. This does not make a lot of sense to me, and it's not clear to me why that number would be used anywhere in a way that supercede's the sub-class's sizeHint() implementation. Also, it does seem odd that the single "frameWidth" integer is used in computing both the width and the height. Can anyone please shed some light on this? I suspect that my poor understanding of QT's layout engine is to blame here.

    Read the article

  • Using sem_t in a Qt Project

    - by thauburger
    Hi everyone, I'm working on a simulation in Qt (C++), and would like to make use of a Semaphore wrapper class I made for the sem_t type. Although I am including semaphore.h in my wrapper class, running qmake provides the following error: 'sem_t does not name a type' I believe this is a library/linking error, since I can compile the class without problems from the command line. I've read that you can specify external libraries to include during compilation. However, I'm a) not sure how to do this in the project file, and b) not sure which library to include in order to access semaphore.h. Any help would be greatly appreciated. Thanks, Tom Here's the wrapper class for reference: Semaphore.h #ifndef SEMAPHORE_H #define SEMAPHORE_H #include <semaphore.h> class Semaphore { public: Semaphore(int initialValue = 1); int getValue(); void wait(); void post(); private: sem_t mSemaphore; }; #endif Semaphore.cpp #include "Semaphore.h" Semaphore::Semaphore(int initialValue) { sem_init(&mSemaphore, 0, initialValue); } int Semaphore::getValue() { int value; sem_getvalue(&mSemaphore, &value); return value; } void Semaphore::wait() { sem_wait(&mSemaphore); } void Semaphore::post() { sem_post(&mSemaphore); } And, the QT Project File: TARGET = RestaurantSimulation TEMPLATE = app QT += SOURCES += main.cpp \ RestaurantGUI.cpp \ RestaurantSetup.cpp \ WidgetManager.cpp \ RestaurantView.cpp \ Table.cpp \ GUIFood.cpp \ GUIItem.cpp \ GUICustomer.cpp \ GUIWaiter.cpp \ Semaphore.cpp HEADERS += RestaurantGUI.h \ RestaurantSetup.h \ WidgetManager.h \ RestaurantView.h \ Table.h \ GUIFood.h \ GUIItem.h \ GUICustomer.h \ GUIWaiter.h \ Semaphore.h FORMS += RestaurantSetup.ui LIBS += Full Compiler Output: g++ -c -pipe -g -gdwarf-2 -arch i386 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED - I/usr/local/Qt4.6/mkspecs/macx-g++ -I. - I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore - I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui - I/usr/include -I. -I. -F/Library/Frameworks -o main.o main.cpp In file included from RestaurantGUI.h:10, from main.cpp:2: Semaphore.h:14: error: 'sem_t' does not name a type make: *** [main.o] Error 1 make: Leaving directory `/Users/thauburger/Desktop/RestaurantSimulation' Exited with code 2. Error while building project RestaurantSimulation When executing build step 'Make'

    Read the article

  • Use Google Test from Qt in Windows

    - by Dave
    I have a simple test file, TestMe.cpp: #include <gtest/gtest.h> TEST(MyTest, SomeTest) { EXPECT_EQ(1, 1); } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } I have Google Test built as a static library. (I can provide the makefile if it's relevant.) I can compile TestMe.cpp from a command-line with no problem: g++ TestMe.cpp -IC:\gtest-1.5.0\gtest-1.5.0\include -L../gtest/staticlib -lgtest -o TestMe.exe It runs as expected. However, I cannot get this to compile in Qt. My Qt project file, in the same directory: SOURCES += TestMe.cpp INCLUDEPATH += C:\gtest-1.5.0\gtest-1.5.0\include LIBS += -L../gtest/staticlib -lgtest This results in 17 "unresolved external symbol" errors related to gtest functions. I'm pulling my hair out here, as I'm sure it's something simple. Any ideas?

    Read the article

  • How can let Qt Graphics View Framework support custom layers

    - by jnblue
    Qt's graphics view frameworks is very powerful, but I have not found a way to support custom layers. In Qt, there is a QGraphicsScene::ItemLayer,but QGraphicsScene renders all items are in this layer. I want manage the items with several layers, Just like Illustrator and CorelDraw. all the item only in the current layer will receive the event, be selected or get the key focus etc.. Other layers(not current layer) will not receive all scene event. The most reasons of using layers is I could catalogue a large number of items more clearly.And without needing transfer events to all the layers' items ,I think the graphics frameworks will be more efficient. The last question, does QGraphicsView support rendering server stacked graphics scenes at the same time? If support, I think the "custom layers" can be solved in this way. Thanks very much!

    Read the article

  • Qt Serial Port Errors - Data not getting read

    - by user2970546
    I'm trying to read a serial port with the Qt SerialPort library. I can read the data using HyperTerminal. In Qt I used the following code to try and do the same thing. Qt says the the port has been opened correctly, but for some reason, the bytesAvailable from the serial port is always 0. serial.setPortName("COM20"); if (serial.open(QIODevice::ReadOnly)) qDebug() << "Opened port " << endl; else qDebug() << "Unable to open port" << endl; serial.setDataBits(QSerialPort::Data8); serial.setParity(QSerialPort::EvenParity); serial.setBaudRate(QSerialPort::Baud115200); qDebug() << "Is open?? " << serial.isOpen(); // Wait unit serial port data is ready while (!serial.bytesAvailable()) { //qDebug() << serial.bytesAvailable()<<endl; continue; } QByteArray data = serial.read(100); qDebug() << "This is the data -" << data << endl; serial.close(); In comparison, MATLAB code with the same structure as the above code, successfully manages to read the serial port data %Serial Port Grapher - Shurjo Banerjee s = serial('COM20'); s.BaudRate = 460800; s.Parity = 'even'; try input('Ready to begin?'); catch end fopen(s); fh = figure(); hold on; t = 1; while (s.BytesAvailable <= 0) continue end a = fread(s, 1) old_t = 1; old_a = a; while true if (s.BytesAvailable > 0) a = fread(s, 1) figure(fh) t = t + 1; plot([old_t t], [old_a a]); old_t = t; old_a = a; end end fclose(s);

    Read the article

  • Memory leak in Qt signal and slots

    - by Ajay
    Hello, I am running valgrind on my Qt code,and even on successful exit of the application, get the following report from valgrind 8,832 bytes in 92 blocks are still reachable in loss record 12 of 12 at 0x4025390: operator new(unsigned int) (vg_replace_malloc.c:214) ==3339== by 0x4B75F05: QMutex::QMutex(QMutex::RecursionMode) (qmutex.cpp:123) ==3339== by 0x4B77602: QMutexPool::get(void const*) (qmutexpool.cpp:137) ==3339== by 0x4CA0EC2: signalSlotLock(QObject const*) (qobject.cpp:112) ==3339== by 0x4CA3939: QMetaObjectPrivate::connect(QObject const*, int, QObject const*, int, int, int*) (qobject.cpp:2900) ==3339== by 0x4CA5C00: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2599) I disconnect all signal connections and also delete the objects. The above mentioned leak increases if i increase the amount of signal and slot connections? Can anybody help with this?

    Read the article

  • Symbian qt threading

    - by Umesha MS
    Hi, 1) In symbian c++ thread is not recommended. Instead of that they recommend active object for multi tasking. Presently I am using QT to develop a application in symbian. Since there is no active object in QT I thought of using thread. My question is , can I use thread, is it is recommended. If it is not recommended, how to achieve multitasking. 2) I have created a sample thread class as shown bellow. When I call test function from the constructer of the main window thread will start but UI will be in hung state, infact main window itself will not be displayed. Please help me to solve the problem. class CSampleThread: public QThread { Q_OBJECT public: CSampleThread(QObject *parent = 0) : QThread(parent) {} virtual ~CSampleThread() {} void test(){ QThread::start(LowPriority); } protected: void run() { while(true){} } };

    Read the article

  • How can I link glibc statically with qt

    - by yan bellavance
    I have built a static version of qt and download a static version of glibc. Now I would like to link glibc statically to my qt application. I know about going into the .pro and adding the line LIBS += -L path/to/static_lib but I am wondering if these that is enough? Will it still link glibc statically even though the OS I am building on has the dynamic libraries also? The reason I am doing this is to deploy the application in a standalone manner. (After installing and updating Red Hat 5.3 glibc_2.9 was not found on the target computer)

    Read the article

  • FFmpeg and qt, Unable to find a suitable output format for '>'

    - by Spredzy
    Hi all, I'm trying to execute a ffmpeg operation through Qt I would like to execute this line : ./ffmpeg -t 10 -i temp1 -f mpeg - > temp2 When I execute through the terminal, it works perfectly fine. How ever when I launch it through Qt like this : QProcess *process = new QProcess(); QString parameters("./ffmpeg -t 10 -i temp1 -f mpeg - > temp2"); std::cout << process->execute(parameters) << std::endl; I get an Unable to find a suitable output format for '>' any body has the idea of why ?

    Read the article

  • Qt LGPL licencing for a free application with closed source

    - by Andy M
    Hey everyone, I'm working on an application developped with Qt 4.6.2. I'm linking dynamicaly and I don't want to share my source code. The application is totally free and I don't plan on selling any part of it. I did not make any changes in the Qt library, I'm only using it to develop the application... I just want to share my free application, without having to share the source code... My question is, what would be your advices in choosing the correct licencing ? Thanks in advance for your answers !

    Read the article

  • How to provide Input to Dialogs designed by Qt Designer

    - by GG
    Hello, I am a Qt beginner and working with Qt Designer to develop some small UI elements. I read http://doc.trolltech.com/4.5/designer-using-a-ui-file.html to use these GUI elements in my code and using multiple inheritance approach. I am introducing bookmark feature which somewhat look like http://img293.imageshack.us/img293/3041/screenshotyb.png. Now the problem I am facing is How can I show all existing bookmark folders in the drop down(say folders are in a QVector). So my main problem is how can I pass some inputs to the UI element. I think I'm clear, please let me know if further explanation is required. Sorry for adding links directly, rich formatting in my browser is not working. Thanks in advance,

    Read the article

  • Check whether a string is a valid filename with Qt

    - by ereOn
    Hi, Is there a way with Qt 4.6 to check if a given QString is a valid filename (or directory name) on the current operating system ? I want to check for the name to be valid, not for the file to exist. Examples: // Some valid names test under_score .dotted-name // Some specific names colon:name // valid under UNIX OSes, but not on Windows what? // valid under UNIX OSes, but still not on Windows How would I achieve this ? Is there some Qt built-in function ? I'd like to avoid creating an empty file, but if there is no other reliable way, I would still like to see how to do it in a "clean" way. Many thanks.

    Read the article

  • Getting Parent Layout in Qt

    - by Austin
    Hi, quick question. Is there any way to (easily) retrieve the parent layout of a widget in Qt? PS: QObject::parent() won't work, for logical reasons. EDIT: I'm positive the widget has a parent layout, because I added it to a layout earlier in the code. Now, I have many other layouts in the window and while it is possible for me to keep track of them, I just want to know if there is an easy and clean way to get the parent layout. EDIT2: Sorry, "easy and clean" was probably not the best way of putting. I meant using the Qt API. EDIT3: I'm adding the widget to the layout like this: QHBoxLayout* layout = new QHBoxLayout; layout-addWidget(button);

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >