Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • [SOLVED] mainwindow and dialog load up as separate programs

    9
    0 Votes
    9 Posts
    4k Views
    D
    please, remove line 20 in mainwindow.h or change line 9 in mainwindow.cpp to @ tt = new Dialog(this); @
  • Calling the dialog checkbox from mainwindow

    17
    0 Votes
    17 Posts
    7k Views
    K
    yes that's correct
  • How do you bind a QStringList to a QListView?

    3
    0 Votes
    3 Posts
    7k Views
    D
    [quote]I have a collection of records, each containing two fields: a Name and a collection of strings associated with that name. I would like to bind the Name to a Label (no problems doing this) and the string collection to a QListView, such that the collection of strings displayed in the QListView update when a new record becomes active.[/quote] Can you elaborate more on the part "when a new record becomes active"? What do you mean? Do you have a QDWM-like interface, in which you move upon the records? (Btw, Qt provides QStringListModel.)
  • QTreeView Filter

    4
    0 Votes
    4 Posts
    3k Views
    D
    Of course, it's possible to implement a custom proxy model that applies your filter. I just don't think that something like that is already available in Qt.
  • Downloading app

    5
    0 Votes
    5 Posts
    3k Views
    A
    i think youtube provide a function to det the url ...because many app support youtube download like"http://keepvid.com/":http://keepvid.com/..does anyone know how??
  • [SOLVED]Library H-E-Double Hockey Stick: Now Missing Driver

    8
    0 Votes
    8 Posts
    3k Views
    B
    All I know is I want one.
  • Multiple network cards on one PC. Packages sent through the driver.

    9
    0 Votes
    9 Posts
    6k Views
    L
    Like this: @ udpSockect.bind(QHostAddress::LocalHost,12345); @
  • Unreferenced Libraries?

    16
    0 Votes
    16 Posts
    5k Views
    J
    Thanks for the help guys!
  • [problem found]Qt Creator slow on Mac v10.7 (Lion)

    7
    0 Votes
    7 Posts
    4k Views
    M
    Thanks! Always useful to have a reference to the bug on the thread.
  • Link library

    9
    0 Votes
    9 Posts
    7k Views
    L
    "Can I release a non-free program that's designed to load a GPL-covered plug-in?":http://www.gnu.org/licenses/gpl-faq.html#NFUseGPLPlugins Yes, there might be combinations which allow for using GPL code within closed source projects, but... The licensor wants you to contribute if you benefit - this is the reason why he had chosen the GPL in the first place. If he wanted that his code can be used in closed source applications he wouldn't have chosen the GPL or will grant you a more permissive license. So it doesn't matter how technically or legally sophisticated your solution is - it is against the licensors intention and therefore unethical and illegal. Just ask yourself: does you product require the GPL code to function? Personal view, IANAL!
  • Qt database

    7
    0 Votes
    7 Posts
    4k Views
    A
    thank you very much =)
  • SetItemDelegateForRow vs setItemDelegate?

    3
    0 Votes
    3 Posts
    5k Views
    A
    Thanks, Volker. I will try it. I did have paint and sizeHint already reimplemented but maybe I didn't do something correctly as the list items were drawing on top of each other when I tried setItemDelegate initially.
  • QUdpSocket difference between Windows and Linux

    12
    0 Votes
    12 Posts
    9k Views
    L
    I'm out of ideas now. Could you compose a minimal compilable example demonstrating the issue?
  • [Solved]Problem emiting a signal with and enum from a thread

    6
    0 Votes
    6 Posts
    9k Views
    P
    Thank you Volker, I had a couple of problems I forgot about the Q_DECLARE_METATYPE(myType); and I don't' think I was never consistent with the global scope specifier. Mixing doesn't work but if you always use one or the other it works. [edit] forgot to mention that you also have to use a worker object For those who follow below is the working code. @#ifndef QTTHREADS_H #define QTTHREADS_H #include <QtGui/QMainWindow> #include <QThread> #include "ui_qtthreads.h" enum myType { abc ,def ,ghi }; //Q_ENUMS(myType); Q_DECLARE_METATYPE ( myType ); class myWorker : public QObject { Q_OBJECT public: myType m_myTypeVar; public: void SendSignals(int nCount); signals: void sgn_To_MainThread(qreal rValue); #ifdef WITH_GLOBAL_SCOPE void sgn_To_MainThread(::myType l_myTypeVar); #else void sgn_To_MainThread(myType l_myTypeVar); #endif }; class MyThread : public QThread { Q_OBJECT public: MyThread(QWidget * parent); QWidget * m_parent; myWorker * m_pMyWorkerObject; protected: void run(); bool m_bExit; }; class QTThreads : public QMainWindow { Q_OBJECT public: QTThreads(QWidget parent = 0, Qt::WFlags flags = 0); ~QTThreads(); MyThread m_myThread; myType m_myTypeVar; private: Ui::QTThreadsClass ui; public slots: void slt_From_Worker(qreal rValue); #ifdef WITH_GLOBAL_SCOPE void slt_From_Worker(::myType l_myTypeVar); #else void slt_From_Worker(myType l_myTypeVar); #endif }; #endif // QTTHREADS_H @ @#include "qtthreads.h" #include <QDebug> QTThreads::QTThreads(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) , m_myTypeVar(abc) { m_myThread = new MyThread(this); ui.setupUi(this); m_myThread->start(); } QTThreads::~QTThreads() { } void QTThreads::slt_From_Worker(qreal l_rValue) { qDebug() << "slt_From_Worker() " << l_rValue; } #ifdef WITH_GLOBAL_SCOPE void QTThreads::slt_From_Worker(::myType l_myTypeVar) #else void QTThreads::slt_From_Worker(myType l_myTypeVar) #endif { qDebug() << "slt_From_Worker() enum "<<l_myTypeVar; } //////////////////////////////////////////////// //////////////////////////////////////////////// //////////////////////////////////////////////// MyThread::MyThread(QWidget * parent) :m_bExit(false) { #ifdef WITH_GLOBAL_SCOPE qRegisterMetaType<::myType>( "::myType" ); #else qRegisterMetaType<myType>( "myType" ); #endif m_parent = parent; m_pMyWorkerObject = new myWorker(); connect(m_pMyWorkerObject, SIGNAL(sgn_To_MainThread(qreal)) ,m_parent, SLOT(slt_From_Worker(qreal)), Qt::QueuedConnection); #ifdef WITH_GLOBAL_SCOPE connect(m_pMyWorkerObject, SIGNAL(sgn_To_MainThread(::myType)) ,m_parent, SLOT(slt_From_Worker(::myType)), Qt::QueuedConnection); #else connect(m_pMyWorkerObject, SIGNAL(sgn_To_MainThread(myType)) ,m_parent, SLOT(slt_From_Worker(myType))/, Qt::QueuedConnection/); #endif } void MyThread::run() { quint32 nCount = 0; qDebug()<< "thread Started"; while(!m_bExit) { qDebug()<< "Sending ... " << nCount++; m_pMyWorkerObject->SendSignals(nCount); msleep(1000); if(nCount>500) nCount = 0; } qDebug()<< "thread Stopped"; } void myWorker::SendSignals(int nCount) { emit sgn_To_MainThread(((qreal)nCount)/2); emit sgn_To_MainThread(::ghi); }@
  • TextFinder example running standalone on win7 - runtime error 0xc0150002

    10
    0 Votes
    10 Posts
    6k Views
    J
    BTW - installing Visual Studio C++ 2008 Express, plus adding the directory "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" to my PATH env variable (so Qt can find nmake) seemed to do the trick! Thanks again Loladiro.
  • Book example build failed for Qt 4.7.3

    5
    0 Votes
    5 Posts
    3k Views
    K
    several projects like: Folderview petridish1 petridish2 Yes, It comes from: #ifdef MSVC_COMPILER it looks like MSVC_COMPILER is not defined. and using MinGW build OK. I fixed it by add: #include <cmath> to all files contain "MSVC_COMPILER" BUT, still, I can not build the project "textedit" by using VC 2008
  • Using Webcam

    2
    0 Votes
    2 Posts
    2k Views
    M
    Check out the Multimedia API in Qt Mobility.
  • How to contact a server url and retrieve the answer is a string

    Moved
    5
    0 Votes
    5 Posts
    2k Views
    L
    Just for the records: QHttp is obsolete. Do not use it in new code - use QNAM instead. The code you've posted is a good start. As soon as the request has been finished the finished() signal is emitted and can be used to process the request.
  • Programmatically setting tab order in a hierarchy of widgets

    2
    0 Votes
    2 Posts
    6k Views
    G
    As far as I know, the tab order is "global" to a specific window, so I doubt you can save something here. As you're adding the buttons programmatically, I would just have three QWidgetLists (typedefs for QList<QWidget *>) that contain all the buttons and iterate over them once a new button is added and call setTabOrder.
  • Problem trying to fix a Qt bug

    4
    0 Votes
    4 Posts
    3k Views
    L
    If you need help with the merge request (I assumed from the IRC logs that that's what you're going to do), feel free to ask. Also, please post a link to the merge request here, once you have submitted it.