Category Archives: Qt-Tips
Removing MinGW dll dependencies in QT Static linking
libgcc_s_dw2-1.dll Passing -static-libgcc will remove this dependency for all languages other than C. Note: C++ exceptions depends on this option. mingwm10.dll Remove -mthreads option from your makefile. Note: Multithreading and C++ exceptions depends on this option.
Use QColor from getColor on QLabel and QTextbox
//To use color on text and label //Simple sample :) QColor color = QColorDialog::getColor(QColor(ui->backgroundColorPickerText->text()), this); if(color.isValid()) { QPixmap pix(21, 21); pix.fill(color); ui->backgroundColorPickerLabel->setPixmap(pix); ui->backgroundColorPickerText->setText(color.name()); }
create a custom dialog box with multi line input in qt
//create a custom dialog box with multi line input void MainWindow::createMultilineInput() { //class variable dlgMultiLine = new QDialog(this); //local variable QGridLayout *gridLayout = new QGridLayout(dlgMultiLine); //class variable txtMultiline = new QPlainTextEdit(); txtMultiline->setObjectName(QString::fromUtf8("txtMultiline")); gridLayout->addWidget(txtMultiline, 0, 0, 1, 1); … Continue reading
getting all files from subdirectories recursively with c using qt framework/
// Display a dialog to the user to choose his music directory QString directory_path = QFileDialog::getExistingDirectory(this, tr("Select your music directory"), QDir::currentPath()); // Then create an instance of our QDirIterator, which takes as parameters // the directory, a QDir filter … Continue reading
Create single instance application in Qt 4 : Qt Tip #1
Many times we want only single instance of application. How can we achieve this. I’m going to show a simple way to achieve this. We need a Utility that is freely provided by Qt guys . Click here to know … Continue reading